Commit Graph

31845 Commits

Author SHA1 Message Date
Dmitry Konstantinov 0998495417 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Reduce memory allocations in row merge logic
2026-05-21 22:42:22 +01:00
Dmitry Konstantinov 71e8b7c213 Reduce memory allocations in row merge logic
org.apache.cassandra.utils.MergeIterator.Candidate - has Comparator field which is the same for all Candidates under an MergeIterator instance, we can move the field to MergeIterator level. Candidate is 4.8% of all allocations and we can save 20% (~1% of all allocations) of it for JDK 21 with compressed references on.

 switch from ArrayList to array in org.apache.cassandra.db.rows.Row.Merger
The ArrayList iterator costs 0.72% and BulkIterator.Adapter costs 0.35%. So, in total we can save here ~1% of total allocations.

patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21359
2026-05-21 22:28:59 +01:00
Stefan Miklosovic a656b7b556
Merge branch 'cassandra-6.0' into trunk 2026-05-21 22:04:44 +02:00
Stefan Miklosovic b3bc7c019f
Add get/setDataDiskUsageKeyspaceWideProtectionEnabled to GuardrailsConfig
This was forgotten in the original patch.

patch by Stefan Miklosovic; reviewed by Paulo Motta for CASSANDRA-21024
2026-05-21 22:03:41 +02:00
Dmitry Konstantinov e686ab81ca Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Reduce time to execute microbench-test
2026-05-21 20:52:31 +01:00
Dmitry Konstantinov 1f078c0daf Reduce time to execute microbench-test
Set 1 thread and 1 second for the measurement iteration (note: it is a smoke test only, we do not analyze results from such short measurements)
Exclude some options for heavy benchmarks by default
Shutdown all threads once JMH test is completed to avoid awaiting of a forked JVM till timeout at the end

patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-21388
2026-05-21 20:27:42 +01:00
Francisco Guerrero f77189325b Avoid using ObjectUtils.getFirstNonNull in Schema
Patch by Francisco Guerrero; reviewed by Dmitry Konstantinov for CASSANDRA-21394
2026-05-21 10:36:32 -07:00
Maxim Muzafarov 706b71e360
Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Bump checkstyle version up to 10.26.1
2026-05-21 16:48:47 +02:00
Maxim Muzafarov d1b76b6e9a
Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Bump checkstyle version up to 10.26.1
2026-05-21 16:47:09 +02:00
Dmitry Konstantinov 2ebc3be787 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Increase Xmx to 2Gb for Ant executed by check-code.sh to avoid OOM
2026-05-21 15:33:37 +01:00
Dmitry Konstantinov 48aebdac48 Increase Xmx to 2Gb for Ant executed by check-code.sh to avoid OOM
patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-21391
2026-05-21 15:32:11 +01:00
Maxim Muzafarov 16c0d1233e
Bump checkstyle version up to 10.26.1
patch by Maxim Muzafarov; reviewd by Dmitry Konstantinov for CASSANDRA-21395
2026-05-21 16:09:59 +02:00
Dmitry Konstantinov 6525296e67 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Print class histogram in case of ant failure in check-code.sh
2026-05-21 11:20:24 +01:00
Dmitry Konstantinov 9267874656 Print class histogram in case of ant failure in check-code.sh
patch by Dmitry Konstantinov; reviewed by Stefan Miklosovic,Maxim Muzafarov for CASSANDRA-21391
2026-05-21 11:18:29 +01:00
Sam Tunnicliffe 43a1f51d45 Merge branch 'cassandra-6.0' into trunk 2026-05-20 16:29:24 +01:00
Matt Byrd 7927ac4395 Bring back the ability to Optionally avoid hint transfer during decommission (CASSANDRA-17808)
lost due to merge of ae0842372f

patch by Matt Byrd; reviewed by Stefan Miklosovic and Sam Tunnicliffe for CASSANDRA-21341
2026-05-20 16:20:53 +01:00
Benedict Elliott Smith e28b9bd1f7 Merge branch 'cassandra-6.0' into trunk 2026-05-18 17:59:39 +01:00
Benedict Elliott Smith eabcce910a Accord: Slice PreLoadContext to owned keys in MapReduceCommandStores 2026-05-18 17:57:25 +01:00
Benedict Elliott Smith 8ac59e05a7 Accord: CoordinateTransaction should not abort if LocalExecute fails 2026-05-18 17:54:48 +01:00
Sam Tunnicliffe 254a3482ad Merge branch 'cassandra-6.0' into trunk 2026-05-18 14:33:18 +01:00
Sam Tunnicliffe 6e46e39df8 ninja: replace addtocmstool with cmsofflinetool in rpm/deb packages
Follow up to CASSANDRA-19151
2026-05-18 14:04:33 +01:00
Benedict Elliott Smith 5eba832793 Merge branch 'cassandra-6.0' into trunk 2026-05-18 13:25:59 +01:00
Benedict Elliott Smith 7623a59b31 Accord: Deterministic time integration
- now() functions must be deterministic (and derived from Accord timestamp)
 - tombstone GC and TTL evaluation must be deterministic and based on both Accord timestamp and Accord GC mechanisms (that guarantee completeness of execution)

patch by Benedict; reviewed by Alex Petrov and Ariel Weisberg for CASSANDRA-21376
2026-05-18 13:19:25 +01:00
Benedict Elliott Smith dc7935be80 Merge branch 'cassandra-6.0' into trunk 2026-05-16 21:15:27 +01:00
Benedict Elliott Smith a0dc6f857b Introduce AccordExecutorSignalLoop that aims to reduce lock contention:
- consumer and producer threads wait signal without acquiring the lock first
 - lock owners may prepare more work than they need, moving some dynamically-adjusted portion of the work from the prioritised lock-managed structures onto a non-blocking queue, so that other threads may consume work from there; the portion is continually micro-adjusted to target some available work whenever the lock is acquired.
 - adopts/supports some features of the SEPExecutor:
  - threads may auto-adjust the number of running threads based on how much time is collectively spent waiting, to minimise time spent signalling
  - consumers may (timed-sleep) poll rather than await a signal, reducing the number of kernel interactions needed; relying on the auto-adjustment to bound the time the scheduler spends waking threads with no work to do
Also Fix:
 - Client Result should not be persisted or included in Command object at any time

patch by Benedict; reviewed by Alex Petrov and Ariel Weisberg for CASSANDRA-21375
2026-05-16 21:12:49 +01:00
Sam Tunnicliffe 206485e820 Merge branch 'cassandra-6.0' into trunk 2026-05-15 14:49:01 +01:00
nvharikrishna c9d60a61e3 Offline tool for working with cluster metadata dump files
The following subcommands have been added:

* abortbootstrap        Cancel and undo an inflight bootstrap
* abortmove             Cancel and undo an inflight token move
* abortdecommission     Cancel and undo an inflight decommission
* assassinate           Remove a node from cluster metadata
* resetcms              Redefine the CMS membership
* move                  Modify a node's (single) owned token
* describe              Output a summary of the cluster metadata
* forcejoin             Force a registered or joining node into a JOINED state
* print                 Output a full rendering of cluster metadata
* printdirectory        Output a full rendering of the directory
* printdataplacements   Output the full data placements

Patch by Venkata Harikrishna Nukala; reviewed by Alex Petrov and Sam Tunnicliffe
for CASSANDRA-19151
2026-05-15 14:41:06 +01:00
Benedict Elliott Smith 5634d4e02a Merge branch 'cassandra-6.0' into trunk 2026-05-15 11:08:34 +01:00
Benedict Elliott Smith 4930ae0e6e CASSANDRA-21361 follow-up: recontact forbids self addressed messages and we ensure self-addressed messages send full information to avoid having multiple LocalDelivery contexts 2026-05-15 10:26:45 +01:00
Patrick McFadin 7ac5d93c8b CASSANDRA-21342: Retarget commands-toc.adoc xrefs to consolidated CQL anchors
Follow-up to the trunk PR #4807 forward-merge for cassandra-5.0. The
trunk R1 commit (8e0700a7cb on the chain leading to 32826fe563)
rewrote reference/cql-commands/commands-toc.adoc to retarget 38
broken xref:reference/cql-commands/<page>.adoc[...] entries to the
corresponding anchors in developing/cql/{ddl,dml,functions,mvs,
security,types}.adoc, kept 6 entries that still resolve under
cassandra:reference/cql-commands/, and dropped 4 DSE-only entries
(RESTRICT, RESTRICT ROWS, UNRESTRICT, UNRESTRICT ROWS).

The same transformation is applied here to cassandra-5.0. The trunk
commit was not cherry-pickable because 5.0's commands-toc.adoc had
diverged from trunk's pre-R1 version by ~9 lines (the DSE-only
entries plus an unrelated formatting drift); a direct edit replacing
the file with trunk's post-R1 content was the cleanest application.

One trunk-only entry is omitted: LIST SUPERUSERS (target
developing/cql/security.adoc#list-superusers-statement). That anchor
does not exist on cassandra-5.0; the LIST SUPERUSERS command was
added after 5.0.

All 29 retarget anchors plus the 6 cassandra:reference/cql-commands/
target pages verified to exist on upstream/cassandra-5.0.

 patch by Patrick McFadin; reviewed by TBD for CASSANDRA-21342
2026-05-14 14:13:06 -07:00
Patrick McFadin 9733058d1b CASSANDRA-21342: Fix broken Antora xref/anchor targets in cassandra docs
Forward-merge of the trunk fix (commit 32826fe563) to cassandra-5.0.
Restricted to the changes whose broken-target patterns exist on this
branch.

Two trunk commits intentionally omitted:
 - P1 (memtable.adoc retarget): the memtable sections containing the
   broken xref were added on trunk only and do not exist on 5.0.
 - R1 (commands-toc.adoc rewrite): commands-toc.adoc on 5.0 diverges
   from trunk by ~9 lines; the 38-row retarget mapping will be applied
   as a separate follow-up commit on this branch.

 patch by Patrick McFadin; reviewed by TBD for CASSANDRA-21342
2026-05-14 12:13:11 -07:00
Patrick McFadin 32826fe563 CASSANDRA-21342: Fix broken Antora xref/anchor targets in cassandra docs
Resolve broken cross-module xrefs and image/anchor targets across the
cassandra docs tree. Companion to apache/cassandra-website#319 (merged
2026-05-13) under the same JIRA umbrella.

 patch by Patrick McFadin; reviewed by Brandon Williams for CASSANDRA-21342
2026-05-14 10:29:29 -07:00
Dmitry Konstantinov a918f6c2a4 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  ninjia: add an accidentally removed newline in test/conf/cassandra.yaml
2026-05-14 14:47:05 +01:00
Dmitry Konstantinov 687fbf282f ninjia: add an accidentally removed newline in test/conf/cassandra.yaml 2026-05-14 14:43:21 +01:00
maoling 41239b07b4
Add AGENTS.md and CLAUDE.md
patch by Ling Mao; reviewed by David Capwell, Stefan Miklosovic for CASSANDRA-21301

Co-authored-by: David Capwell <dcapwell@gmail.com>
2026-05-14 12:49:47 +02:00
Benedict Elliott Smith 890ba2a364 Merge branch 'cassandra-6.0' into trunk 2026-05-13 15:16:04 +01:00
Benedict Elliott Smith 41cf61402c Improve Tail Latency
- TransactionStatement token aware routing
 - Mitigate convoy effect:
   - ExecuteTxnBacklog v1 can execute single key transaction backlogs and disseminate the result
     - Direct local execution possible for single key transactions
   - Use shardAppliedBefore instead of gcBefore to cleanup CFK faster
Also Improve:
 - Introduce distributed tracing
 - Combine RejectBefore and MaxConflicts
 - Self-addressed messages are delivered directly
 - Disable AccordSyncPropagator by default, as incompatible with large clusters
 - FastPathStrategy.SIMPLE should not modify fast path contents; FastPathStrategy.UP introduced to adopt this behaviour
 - Configurable queue prioritisation
 - ProtocolModifiers mostly final
 - Remove unnecessary condition check when serializing TxnUpdate
Also Fix:
 - SequentialExecutor ownership bug
 - BTree.XUpdater.reset()

patch by Benedict; reviewed by Alex Petrov and Ariel Weisberg for CASSANDRA-21361
2026-05-13 15:15:23 +01:00
Benedict Elliott Smith 8ad8e56378 Artificial Latency Injection
patch by Benedict; reviewed by Alex Petrov and Ariel Weisberg for CASSANDRA-17024
2026-05-13 14:20:56 +01:00
Dmitry Konstantinov b6f175bfc2 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Uncompressed size is being used for compressed tables in maintenance operations
2026-05-13 13:33:39 +01:00
Dmitry Konstantinov 51a58ef22e Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Uncompressed size is being used for compressed tables in maintenance operations
2026-05-13 13:23:16 +01:00
Matt Byrd af6930c986 Uncompressed size is being used for compressed tables in maintenance operations
use compression ratio to scale the amount of remaining disk usage
CompactionInfo::estimatedRemainingWriteBytes is uncompressed, causing compaction to be rejected due to size when it has space to complete

patch by Matt Byrd; reviewed by Dmitry Konstantinov, Marcus Eriksson for CASSANDRA-21245

Co-authored-by: Jon Meredith <jmeredithco@apple.com>
2026-05-13 13:15:46 +01:00
Josh McKenzie 0625a4d525 Merge branch 'cassandra-6.0' into trunk 2026-05-11 16:54:05 -04:00
Josh McKenzie 84016ab151 Quiet down the noisiness on empty array deref in post-checkout hook
Patch by Josh McKenzie; reviewed by David Capwell for CASSANDRA-21364

Follow-up patch
2026-05-11 16:53:45 -04:00
Josh McKenzie 8f192b6771 Merge branch 'cassandra-6.0' into trunk 2026-05-11 15:26:05 -04:00
Josh McKenzie f55c4d2a9b Add BUILD_OFFLINE capability to skip post-checkout submodule init
Patch by Josh McKenzie; reviewed by David Capwell for CASSANDRA-21364
2026-05-11 15:03:05 -04:00
Benedict Elliott Smith 3256650bb6 Merge branch 'cassandra-6.0' into trunk 2026-05-09 17:07:29 +01:00
Benedict Elliott Smith 8876ad4c03 Introduce:
- Clean Shutdown/Restart
 - Rebootstrap to allow nodes to rejoin consensus if they are out of sync, or did not shutdown cleanly
Improve:
 - Improve efficiency of BTreeReducingRangeMap
 - DurableBefore backed by BTreeReducingRangeMap
 - Soft reject new transactions when a replica has a backlog of work
 - system_accord_debug.command_store_ops supports starting journal replay
Fix:
 - Ensure SequentialExecutor.owner is unset only by the owner
 - Detect and avoid taking two AccordExecutor locks simultaneously
 - MaxConflicts serializer
 - tryToExecuteListening after replay, to handle invalidated dependencies
 - TxnNamedRead does not close a RowIterator, leading to native memory leaks
 - GetLatestDepsNack serialization
 - journal.readLast() did not read last
 - DefaultRemoteListeners not correctly synchronised
 - RangeTxnScanner cancellation assumes was already started
 - Start cfk compaction before replay
 - txn_graph should avoid visiting parents twice (possible if two different dependency chains connecting them in the graph)
 - Topology.cloneEquivalentWithEpoch should also share nodeLookup and ranges, especially to accelerate computeWaitForEpoch/computeScope
 - Do not invoke slowReplicaDelay or slowCoordinatorDelay during restore
 - Do not fail if slowReplicaDelay or slowCoordinatorDelay are invoked without knowing the transaction

patch by Benedict; reviewed by Alex Petrov and Ariel Weisberg for CASSANDRA-21355
2026-05-09 16:46:00 +01:00
Dmitry Konstantinov bf79036ae0 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Reduce memory allocations in SelectStatement.getQuery
2026-05-07 13:43:37 +01:00
Dmitry Konstantinov f06770f036 Reduce memory allocations in SelectStatement.getQuery
SinglePartitionReadCommand.Group#create - typical single partition select, use singletonList instead of ArrayList + Object[]
SelectStatement#getSliceCommands - remove unnessesary cloning of partition key, it is a part of a very old patch, now we copy all values from Netty buffers
SelectStatement#getSliceCommands - typical single partition select, use singletonList instead of ArrayList + Object[]
SinglePartitionReadQuery.Group#maybeValidateIndex, avoid iterators for restrictionSet if a full partition is selected

patch by Dmitry Konstantinov; reviewed by Francisco Guerrero, Stefan Miklosovic for CASSANDRA-21351
2026-05-07 13:31:09 +01:00
Dmitry Konstantinov 9394991853 Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0:
  Avoid allocation by getFunctions in SelectStatement.authorize
2026-05-06 13:14:15 +01:00