Commit Graph

32130 Commits

Author SHA1 Message Date
Benedict Elliott Smith a40a5831ff
Merge 9893f3b2fd into 10557d7ffe 2026-07-31 14:17:13 +00:00
Benedict Elliott Smith 9893f3b2fd UNFINISHED.md - Claude generated summary of remaining work 2026-07-31 15:17:05 +01:00
Benedict Elliott Smith 25f6d75be8 fixup 2026-07-31 15:01:32 +01:00
Benedict Elliott Smith ba683a02fd Improve Rebootstrap:
- Distinguish corrupt/incomplete cases; latter case only refuses uncertain data
     - Ensures quorum durability before marking own log faulty
     - Refuse unsafe operations more selectively once log marked faulty
     - Simplify and merge logic with standard bootstrap
2026-07-30 16:20:22 +01:00
Benedict Elliott Smith 988235c736 fix ThreadLocalTaskRunner reentrancy
claude tests

fix negative histogram values under simulation, and catch and refuse bad values in other cases
2026-07-30 15:58:20 +01:00
Benedict Elliott Smith c4b0257b38 Refactor AccordExecutor/Task responsibilities, in particular:
- fix race conditions when updating Task.info (between running and Exclusive methods)
 - do not run consequences of actions that fail and do not become durable (e.g. applying to data store/post-applying a transaction that we failed to complete the PreApplied/Applying step for)
2026-07-30 12:42:07 +01:00
Sam Tunnicliffe 10557d7ffe Merge branch 'cassandra-6.0' into trunk 2026-07-30 11:21:35 +01:00
C. Scott Andreas 8fd77ffea3 Improve stability of CMSShutdownTest
Patch by C. Scott Andreas; reviewed by Sam Tunnicliffe for CASSANDRA-21501
2026-07-30 11:14:52 +01: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
mck bdbdf8d710
Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Jenkins improvements: fail-fast, disk-usage, helm overrides and safety
2026-07-28 22:18:59 +02:00
mck 6a5bb352af
Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Jenkins improvements: fail-fast, disk-usage, helm overrides and safety
2026-07-28 22:18:14 +02:00
Mick Semb Wever 209ef2b6c4
Jenkins improvements: fail-fast, disk-usage, helm overrides and safety
* Add ephemeral-storage requests and limits to agents, and log peak disk usage
Agents were evicted at the node level due to lack of disk space. Each pod needs minimum 100GiB, and each template now budgets 80Gi of the ~89Gi that a 100GiB node allocates, with docker's own volume carries a 60Gi sizeLimit.  Exceeding either evicts the pod, so logging has been added in each test split before and after the run. All script blocks in Jenkinsfile are now labeled for improved readability in test runs.

* `.build/run-ci` must not silently drop a site's helm values customisations
Long-lived instances like pre-ci.cassandra.apache.org carry values in addition to the jenkins-deployment.yaml, and any `helm upgrade -f jenkins-deployment.yaml` (or `.build/run-ci`) would drop them.  Allow these values to be kept in a separate file, passed in with `--values-override`. Before upgrading helm values, we now compare the deployed values against what is about to be applied and require confirmation for anything only the site holds.  This catches added keys and dropped list items (but it cannot catch every change).
Also keep the jenkins-home pvc claim on uninstall, so --only-tear-down no longer destroys build history. Add jenkins-test.sh and a gha workflow for test validating changes under .jenkins/

 patch by Mick Semb Wever; reviewed by Dmitry Konstantinov for CASSANDRA-21523
2026-07-28 21:58:28 +02:00
Stefan Miklosovic 63c0072e0c
Merge branch 'cassandra-6.0' into trunk 2026-07-28 14:14:04 +02:00
Stefan Miklosovic e874e3a90b
Prepare debian changelog for 6.0-alpha2 2026-07-28 13:55:01 +02:00
Stefan Miklosovic d411c9a2c7
Merge branch 'cassandra-6.0' into trunk 2026-07-28 13:21:47 +02:00
Stefan Miklosovic f6fa474948
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-07-28 13:21:39 +02:00
Benedict Elliott Smith 15bede148a split AccordExecutor et al into own package 2026-07-28 12:16:31 +01:00
Stefan Miklosovic b5f2a54210
Prepare debian changelog for 5.0.9 2026-07-28 12:57:24 +02:00
Benedict Elliott Smith 37b4fbf08f Accord Executor QoS
Fairness: tasks are grouped by kind of work, and for each group we track work arrival and service via decaying counters. If work for some group(s) begin to be served at a much lower rate than some other group (e.g. because that group has a large backlog, that by simple priority comes first), then we begin processing some fraction of the work by service-ratio rather than priority. This means that we cannot starve request processing because, e.g., a sync point has produced thousands of state save tasks.

Incremental processing: tasks that process many keys may be declared INCR or ASYNC. ASYNC indicates the keys are needed (so should be loaded), but may be used in follow-up work so the task may be executed if the data is not yet loaded. An ASYNC task may be followed by an INCR task that processes keys as they are loaded, with limits to the batch sizes. This limits the latency impact of processing larger transactions such as sync points. INCR tasks may be declared to be processed in either an arbitrary order with no isolation, or “atomically” with its parent task. In the latter case, the complete unit of work appears to execute as a single execution to external observers (blocking progress on unprocessed keys).

Key-level ordering: AccordCacheEntry can inflate a special Queue object that can be used to impose ordering constraints: FIFO for atomic work (once it has been part processed, or submitted as part of a parent task); prioritised for tasks that have a key-level priority to impose (i.e. PreAccept/Accept/Commit/Stable/Apply want to be ordered by TxnId); and unsequenced tasks for those that have no sequencing restrictions.

Additional improvements:
 - AccordCacheEntry are now explicitly LOCKED for the duration of their usage, which may span multiple executions for long running INCR tasks.
 - ExclusiveExecutor releases its ownership lock immediately, since AccordCacheEntry locks guarantee safety (as they will not be released until the task is cleaned up)
 - CassandraThread tracks active and locked AccordExecutor, so that we may safely and more aggressively use executeMaybeImmediately, safe in the knowledge it will never permit cross-executor executions or multiple executor locks to be held.

Also:
 - Rename PreLoadContext -> ExecutionContext
 - Break out AccordExecutor/AccordTask into separate package
2026-07-28 11:39:53 +01:00
Stefan Miklosovic 74bb6b5eca
Merge branch 'cassandra-6.0' into trunk 2026-07-28 12:35:23 +02:00
Stefan Miklosovic 4c1d57e6f3
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-07-28 12:35:15 +02:00
Stefan Miklosovic 5e1d691818
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-07-28 12:35:06 +02:00
Stefan Miklosovic 2ddb92091c
Prepare debian changelog for 4.1.12 2026-07-28 12:18:07 +02:00
Stefan Miklosovic dba6b7df80
Merge branch 'cassandra-6.0' into trunk 2026-07-28 11:53:35 +02:00
Stefan Miklosovic f8b887e4df
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-07-28 11:53:27 +02:00
Stefan Miklosovic d7da71a88a
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-07-28 11:53:14 +02:00
Stefan Miklosovic bde65f163e
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-07-28 11:53:03 +02:00
Stefan Miklosovic 172099f4a8
Prepare debian changelog for 4.0.21 2026-07-28 11:38:14 +02:00
Benedict Elliott Smith 1cffe9a8a0 Executor Fairness 2026-07-27 17:48:54 +01:00
Benedict Elliott Smith 13956ddf21 rename PreLoadContext to ExecutionContext, and SequentialAsyncExecutor -> ExclusiveAsyncExecutor 2026-07-27 17:48:54 +01:00
Benedict Elliott Smith bfcdf927f8 Fix SignalLock.incrementAsyncWork (wrong guard, can lead to ISE) 2026-07-27 17:48:54 +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
Maxim Muzafarov 5bf01cc7c0
Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Allow unreserved keywords as user and identity names in USER and IDENTITY statements
2026-07-27 16:10:11 +02:00
Maxim Muzafarov c4c3048b13
Allow unreserved keywords as user and identity names in USER and IDENTITY statements
patch by Maxim Muzafarov; reviewed by Dmitry Konstantinov for CASSANDRA-21510
2026-07-27 16:03:06 +02: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