Commit Graph

20443 Commits

Author SHA1 Message Date
Isaac Liu da943add35
Merge branch 'apache:trunk' into liuisaac/CASSANDRA-19831/trunk 2026-08-01 11:48:39 -04:00
Dmitry Konstantinov e0e4feb120 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Apply performance optimizations for rows merging logic
2026-07-29 23:42:15 +01:00
Dmitry Konstantinov 1e3d43b2dd Apply performance optimizations for rows merging logic
duplicate MergeIterator class to avoid megamorphic calls in hot path for Row/ComplexCell and UnfilteredRowIterators
disable inlining for sinkInBinaryHeap, move typical case outside to improve hot path inlining
replace List for versions with array
fast path for same column metadata in cell merger
avoid potential megamorphic cell method invocation in ALIVE DeletionTime
minDeletionTime calculation optimization for merge logic
do not add an empty iterator, merge 2 loops into 1

patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21524
2026-07-29 23:28:07 +01:00
Caleb Rackliffe bcd9e662d2 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Fix operationMode reporting DECOMMISSION_FAILED instead of LEAVING when resuming a failed decommission
2026-07-29 15:25:14 -05:00
Minal Kyada feef3fcf51 Fix operationMode reporting DECOMMISSION_FAILED instead of LEAVING when resuming a failed decommission
Patch by Minal Kyada; reviewed by Caleb Rackliffe and Sam Tunnicliffe for CASSANDRA-21493
2026-07-29 15:15:02 -05:00
Francisco Guerrero 5d1830775d Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  [CASSANDRA-21536] Profile pollution in AbstractType.writeValue makes serialization slow for all column types
2026-07-29 14:21:37 -05:00
koo.taejin aa1447571b [CASSANDRA-21536] Profile pollution in AbstractType.writeValue makes serialization slow for all column types
Description:
AbstractType.writeValue() is one shared method. All column types use it.

Inside writeValue(), it calls valueLengthIfFixed(). This is a virtual call. Many types override this method (Int32Type, LongType, UTF8Type, ...).

In a real cluster, many column types pass through writeValue(). So the profile always sees lots types.

Because of this, the JIT cannot inline the call. It stays as a vtable call. Also, the compiled body of writeValue() becomes big, so the JIT refuses to inline writeValue() itself ("already compiled into a big method").

We also see the same itable/vtable stubs in async-profiler output from a real cluster, running with default production options and a normal workload.

How to solve:
Add a final int field to AbstractType. Set it in the constructor. writeValue() reads this field instead of calling valueLengthIfFixed().

A field read needs no type profile. So profile pollution has no effect on it. The valueLengthIfFixed() method is not changed. Only the write path uses the field.

Result:
Production is always the polluted state, so this is the real-world comparison

 JMH, JDK 17 / arm64, 1 thread, 10 x 1s warmup and measurement:

                    before          after       improvement
   readValue        49.99M ops/s    56.44M ops/s  +12.90%
   writeValue       99.63M ops/s   114.46M ops/s  +14.88%

patch by Koo Taejin; reviewed by Dmitry Konstantinov, Francisco Guerrero for CASSANDRA-21536
2026-07-29 14:16:15 -05:00
Dmitry Konstantinov 565c366ee1 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Avoid megamorphic calls for Cell.timestamp/ttl/path/localDeletionTimeAsUnsignedInt methods
2026-07-29 09:24:51 +01:00
Dmitry Konstantinov 725c61c1f7 Avoid megamorphic calls for Cell.timestamp/ttl/path/localDeletionTimeAsUnsignedInt methods
minDeletionTime is also added to Cell to avoid double invocation of localDeletionTime method

patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21526
2026-07-29 09:15:24 +01:00
Francisco Guerrero 57dabaea8c Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Bound declared value length against readable bytes in CBUtil
2026-07-27 10:20:02 -05:00
Francisco Guerrero 247289d7b6 Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Bound declared value length against readable bytes in CBUtil
2026-07-27 10:13:42 -05:00
Francisco Guerrero ecc0a3e77b Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Bound declared value length against readable bytes in CBUtil
2026-07-27 10:05:03 -05:00
Francisco Guerrero 2507eceb29 Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Bound declared value length against readable bytes in CBUtil
2026-07-27 10:01:06 -05:00
Francisco Guerrero 251b0e9b91 Bound declared value length against readable bytes in CBUtil
A 32-bit length field read from the wire by CBUtil.readValue (and its
siblings) flowed directly into new byte[length] with no upper bound,
allowing an unauthenticated client to drive the JVM into
OutOfMemoryError: 'Requested array size exceeds VM limit' — and, with
the default -XX:OnOutOfMemoryError=kill -9 %p, terminate the process —
by declaring Integer.MAX_VALUE as the SASL-token length in AUTH_RESPONSE.

Guard the allocation in the single private readRawBytes(ByteBuf, int)
that all int32-length readers funnel through, rejecting lengths that
exceed the buffer's readable bytes with a ProtocolException.

patch by Francisco Guerrero; reviewed by Stefan Miklosovic for CASSANDRA-21521
2026-07-27 09:51:36 -05:00
Francisco Guerrero 4412926e4f Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  ninja fix: ensure defaultReadThresholds is cleared for CASSANDRA-21467
2026-07-27 09:37:15 -05:00
Francisco Guerrero 3cae8aa6f6 ninja fix: ensure defaultReadThresholds is cleared for CASSANDRA-21467 2026-07-27 09:31:35 -05:00
Stefan Miklosovic af202bddc2
Merge branch 'cassandra-6.0' into trunk 2026-07-27 15:53:17 +02:00
Francisco Guerrero 8fc52f5d2f
Reduce allocations in DefaultQueryOptions when read thresholds are enabled
patch by Francisco Guerrero; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-21467
2026-07-27 15:50:28 +02:00
Francisco Guerrero a3ec88632d Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Ensure a Message's Response streamId is always set
2026-07-26 21:13:21 -05:00
Francisco Guerrero f7f52421c7 Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Ensure a Message's Response streamId is always set
2026-07-26 21:06:39 -05:00
Francisco Guerrero 79c8669b84 Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Ensure a Message's Response streamId is always set
2026-07-26 20:59:15 -05:00
Francisco Guerrero 9ddfe0fb22 Ensure a Message's Response streamId is always set
patch by Francisco Guerrero; reviewed by Caleb Rackliffe, Benedict Elliot Smith, Tejal Chakeres, Alexander Mitin for CASSANDRA-21508
2026-07-26 20:51:21 -05:00
Dmitry Konstantinov b3acdfda08 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Reduce number of scheduledTasks on metric id release in ThreadLocalMetrics
2026-07-26 17:48:09 +01:00
Dmitry Konstantinov ddfdf5d69f Reduce number of scheduledTasks on metric id release in ThreadLocalMetrics
Use a single one-time scheduled task with two tick-tock buffers to recycle metric IDs after a sufficiently long delay.
Use phantom references for ThreadLocalMetrics cleanup ony if it is needed to reduce the references processing overhead.

patch by Dmitry Konstantinov; reviewed by Benedict Elliott Smith for CASSANDRA-21475
2026-07-26 17:46:40 +01:00
Stefan Miklosovic 3bee9024c2
Merge branch 'cassandra-6.0' into trunk 2026-07-26 11:27:16 +02:00
koo.taejin 03304bce53
Cache various Enum.values() used in deserialization to avoid per-read array allocation
patch by Koo Taejin; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-21528
2026-07-26 11:15:22 +02:00
Edward db0871ce8b Don't increment client metrics on messaging service connection unpause
patch by Edward Chu; reviewed by Aleksey Yeschenko for CASSANDRA-21491
2026-07-25 13:04:33 +01:00
Stefan Miklosovic 3fad760416
Merge branch 'cassandra-6.0' into trunk 2026-07-25 09:56:30 +02:00
Arvind Kandpal f51c29c196
Add compound primary key example to nodetool getendpoints help
patch by Arvind Kandpal; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-15904
2026-07-25 09:53:44 +02:00
Stefan Miklosovic 7666b19ac6
Merge branch 'cassandra-6.0' into trunk 2026-07-24 23:23:36 +02:00
dhingarkan 564d30ad8e
Fix Accord transaction error message when altering a table
patch by Motoki Unno; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-20580
2026-07-24 23:22:26 +02:00
Stefan Miklosovic ca42cfe68d
Add nodetool getreplicas
nodetool getendpoints is deprecated. Also, all StorageServiceMBean.getNaturalEndpoints* methods are
deprecated and they call their replica counterparts. The deprecated methods are also not used directly anywhere
in the code (nor tests).

patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-17665
2026-07-23 21:51:51 +02:00
Stefan Miklosovic d75d603281
Merge branch 'cassandra-6.0' into trunk 2026-07-20 20:47:47 +02:00
Stefan Miklosovic 15a6bac06d
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-07-20 20:45:18 +02:00
Stefan Miklosovic bd345213c1
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-07-20 20:43:56 +02:00
Stefan Miklosovic 1c702382de
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-07-20 20:42:36 +02:00
Jeremiah Jordan 26d7b166ba
Verify extension type before initializing reflectively-loaded classes
Cassandra resolves pluggable extensions by class name from configuration, schema, and tooling
inputs. These names were loaded with an initializing Class.forName(name) and type-checked only
afterward, so the named class ran its static initializer before its type was confirmed. After this
change such classes will be loaded without initialization, verified against the expected interface or
base class, and initialized only through normal use after validation.

A shared FBUtilities.classForNameWithoutInitialization helper and typed
instanceOrConstruct/construct overloads apply this to the configurable extension points loaded by
class name: the authentication, authorization, role-management, network and
internode-authenticator backends, the partitioner, audit logger, configuration loader, seed provider,
snitch, abstract types, secondary and custom indexes, compaction strategy, compressor, replication
strategy, SASI analyzers, key and cache providers, query handler, storage and stream hooks, tracing,
the JMX authorization proxy, MBeans, the monotonic clock, nodetool Sjk, triggers, the
sstableloader and stress class options, and diagnostic event classes (loaded without initialization
and checked against DiagnosticEvent, preserving the InvalidClassException contract and the existing
package restriction).

Regression tests confirm that an invalid-type load is rejected without initializing the target
class, and that valid implementations still resolve.

Hadoop client integration and hard-coded JDK and internal class probes are left unchanged.

patch by Jeremiah Jordan; reviewed by Stefan Miklosovic for CASSANDRA-21525
2026-07-20 20:03:45 +02:00
Caleb Rackliffe f989d96b4b Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  SAI Component Checksum Validation Should be Segment-Aware
2026-07-18 23:21:07 -05:00
Caleb Rackliffe 27cc24bc79 Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  SAI Component Checksum Validation Should be Segment-Aware
2026-07-18 23:14:02 -05:00
Caleb Rackliffe 4bd98de6ee SAI Component Checksum Validation Should be Segment-Aware
patch by Caleb Rackliffe; reviewed by Francisco Guerrero for CASSANDRA-21516
2026-07-18 22:53:56 -05:00
Dmitry Konstantinov a14a954788 Fix flakiness in CommitLogSegmentManagerCDCTest
Restore deleteCDCRawFiles logic which is present in 6.0 and trunk but probably lost in 5.0 due to merges
Files may be concurrently removed by the CDC management thread, so we tolerate a file that has already been deleted rather than failing the test.
Fix IndexOutOfBoundsException at commitlog.AbstractCommitLogSegmentManager.forceRecycleAll - it is already fixed in 6.0/trunk.
Cleanup test data after run to reduce disk usage.

Patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-20091
2026-07-12 21:55:58 +01:00
Maxim Muzafarov d60927cb14
Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Forbid ambiguous option/parameter keys in nodetool command hierarchy
2026-07-11 21:39:38 +02:00
Maxim Muzafarov 7874fdae57
Forbid ambiguous option/parameter keys in nodetool command hierarchy
patch by Maxim Muzafarov; reviewed by Dmitry Konstantinov for CASSANDRA-21509
2026-07-11 21:31:41 +02:00
Isaac Liu 21b428ab72
Merge branch 'apache:trunk' into liuisaac/CASSANDRA-19831/trunk 2026-07-10 22:37:14 -04:00
Dmitry Konstantinov 788bbc0891 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Expose immediately-executed tasks in the queries virtual table
2026-07-09 09:31:02 +01:00
Dmitry Konstantinov 480320f3cf Expose immediately-executed tasks in the queries virtual table
SEPExecutor.maybeExecuteImmediately() runs a task synchronously on the
calling worker thread, nested within the task the worker is already
running. Such immediate tasks were invisible in system_views.queries, which only exposed each worker's primary running task.
This is common on the coordinator path, where a local read or mutation is executed immediately within the enclosing QUERY task.

Each SEPWorker now also tracks an immediate current task, set around
maybeExecuteImmediately(), and exposes it as an additional
DebuggableTaskRunner, so the queries table reports both the enclosing
task and the immediate one as separate rows.

patch by Dmitry Konstantinov; reviewed by Caleb Rackliffe for CASSANDRA-21471
2026-07-09 09:22:10 +01:00
Sam Tunnicliffe 1332e217f9 Merge branch 'cassandra-6.0' into trunk 2026-07-08 15:36:49 +01:00
Sam Tunnicliffe 1df3a8cef0 Setup async transformation before making internode request
Patch by Sam Tunnicliffe and Dmitry Konstantinov; reviewed by Sam
Tunnicliffe and Dmitry Konstantinov for CASSANDRA-21384

Co-authored-by: Dmitry Konstantinov <netudima@gmail.com>
2026-07-08 15:35:09 +01:00
liuisaac 7a5e3d3cc9 CASSANDRA-19831: Off-heap -> Non-heap
Changed wording of "Off-heap" to "Non-heap" to be more generic and
match the contract defined in the comments of the method

Patch by Isaac Liu; reviewed by TBD for CASSANDRA-19831
2026-07-06 23:38:07 -04:00
liuisaac 1ca922b108 CASSANDRA-19831: Clarify off-heap OOM error msg
Updated wording for the log to be less redundant and even more
straightforward for operators to understand

Patch by Isaac Liu; reviewed by TBD for CASSANDRA-19831
2026-07-06 23:31:00 -04:00