Commit Graph

31839 Commits

Author SHA1 Message Date
Maxim Muzafarov 22eb0f9fb7
Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Remove golang dependency in gen-doc and replace with python implementation
2026-06-08 21:54:28 +02:00
Maxim Muzafarov 8c992cb6a5
Remove golang dependency in gen-doc and replace with python implementation
patch by Maxim Muzafarov; reviewed by Dmitry Konstantinov for CASSANDRA-21432
2026-06-08 21:47:08 +02:00
Alan Wang be4ddab9dd Safely regain ranges and delete retired command stores
patch by Alan Wang; reviewed by Benedict for CASSANDRA-21212
2026-06-08 14:28:46 +01:00
Stefan Miklosovic 57ecd4c101
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-06-08 11:12:52 +02:00
Stefan Miklosovic 1c19e860d7
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-06-08 10:56:40 +02:00
Stefan Miklosovic 2bf3bc2925
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-06-08 10:52:20 +02:00
Cameron Zemek 8aa71cea52
Remove inFlightEcho entry on ECHO_REQ failure
patch by Cameron Zemek; reviewed by Stefan Miklosovic, Caleb Rackliffe for CASSANDRA-21428
2026-06-08 10:47:24 +02:00
mck f33c11341e
Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Fix ci-cassandra.a.o agent workspaces for Cassandra-5.0 (and above) not being cleaned
2026-06-07 11:53:30 +02:00
mck 26bdaa5ae5
Fix ci-cassandra.a.o agent workspaces for Cassandra-5.0 (and above) not being cleaned
The build+test cells run in `ws("workspace/${JOB_NAME}/${BUILD_NUMBER}/${cell.step}/${cell.arch}/jdk-${cell.jdk}/python-${cell.python}")`, so every build writes a new per-build directory.
The `cleanWs()` only cleans the current cell's leaf, and it sat as the last statement in the `ws` block — so any cell hitting error() (failed/timed-out/aborted) exits before reaching it and leaves the full cell's workspace build behind.

 patch by Mick Semb Wever; reviewed by Dmitry Konstantinov for CASSANDRA-20436
2026-06-07 11:48:17 +02:00
mck 14ace18ae4
Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  Preload dependencies in build docker images to reduce downloading at build/test/ci runtime
2026-06-05 21:04:09 +02:00
mck b78f654fff
Preload dependencies in build docker images to reduce downloading at build/test/ci runtime
Additional fixes
 - upgrade ubuntu-test.docker to ubuntu 22.04 (and some small fixes brought forward from CASSANDRA-20997)
 - (.jenkins/k8s) changes gke's small node pool from n2-highcpu-8 to e2-highcpu-8 (gke's own pod resources reqs increased)
 - (.jenkins/k8s) limit one agent pod per node (when jenkins is deployed in k8s using our helm)
 - (.jenkins/k8s) add the cassandra-6.0 job
 - pass maven.repo.local sys prop, if set, into accord's gradle build
 - check and fail on maven dependencies checksums when downloading
 - when on-the-fly building docker images add `--load` (podman compatbility)
 - newer python versions can use venv instead of virtualenv
 - rename ubuntu2004_test.docker to ubuntu-test.docker (in 5.0)
 - (Jenkinsfile) fix retries (which was no longer working when agents/nodes died, since CASSANDRA-20833)
 - (Jenkinsfile) @NonCPS where (now) needed
 - (Jenkinsfile) fix default value for the branch parameter (after a new helm deploy)
 - (.build/run-ci) fix missing parameters on jobs also at helm deploy time
 - (.build/run-ci) .git suffixes on repo urls are optional

 patch by Mick Semb Wever; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-21403
2026-06-05 21:01:30 +02:00
Dmitry Konstantinov 64e041788a Reduce memory allocations in miscellaneous places along read path
org.apache.cassandra.db.rows.RangeTombstoneMarker.Merger is allocated on demand
Optional usage in org.apache.cassandra.db.rows.UnfilteredRowIteratorWithLowerBound is replaced with a boolean field
Double in org.apache.cassandra.io.util.CompressedChunkReader#getCrcCheckChance - specialized supplier is used to avoid boxing
Stack - adjust default from 5 to 6 to avoid extra resizings in org.apache.cassandra.db.transform.Stack#resize
EnumSet for CL guardrail in SelectStatement - add a condition to allocate it only if the guardrail is enabled
EnumSet in ResultMetadata - replace it with plain int flags

patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21360
2026-06-05 12:34:35 +01:00
Dmitry Konstantinov 0d2160631a Avoid ByteBuffer wrapping in cql3.selection.Selector.InputRow to reduce memory allocation rate
Current ReadCommand logic returns ArrayCell values, so when we retrieve a cell value as a ByteBuffer we allocate ByteBuffer instances

patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21362
2026-06-04 19:19:36 +01:00
Stefan Miklosovic 62a3797ce3
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-06-04 10:41:44 +02:00
Stefan Miklosovic 2a219ed873
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-06-04 10:37:40 +02:00
Stefan Miklosovic eacc60fa37
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-06-04 10:22:23 +02:00
Stefan Miklosovic 1362ac6f69
Validate snapshot names
The validation of snapshot names is turned off by default.
It is controlled by system property cassandra.snapshot.validation which is by default
set to false except 7.0 branch.

When the validation is turned on, the allowed characters are AWS safe characters together
with "+" character. A user can not specify any path separators in snapshot names even if
the validation as such is turned off.

patch by Stefan Miklosovic; reviewed by Francisco Guerrero, Matt Byrd for CASSANDRA-21389
2026-06-04 10:18:27 +02:00
Dmitry Konstantinov 6c31b04ec0 Reduce cost to calculate BTreeRow.minDeletionTime
patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21414
2026-06-02 21:41:54 +01:00
Dmitry Konstantinov 72d53e3919 Implement custom CassandraThread to keep direct references to frequently used thread local objects
patch by Dmitry Konstantinov; reviewed by Benedict Elliott Smith, Stefan Miklosovic for CASSANDRA-21020
2026-06-02 13:56:59 +01:00
Benedict Elliott Smith e278f0cbbc Merge branch 'cassandra-5.0' into cassandra-6.0 2026-06-02 13:48:31 +01:00
Benedict Elliott Smith 1656a9cb01 Merge branch 'cassandra-4.1' into cassandra-5.0 2026-06-02 13:46:18 +01:00
Benedict Elliott Smith 37b85a35b4 Merge branch 'cassandra-4.0' into cassandra-4.1 2026-06-02 13:45:58 +01:00
abeckruiz 863cb651e7 BTree.FastBuilder.reset() fails to clear savedBuffer and savedNextKey, causing ClassCastException and SSTable header corruption during schema disagreement
patch by Andrés Beck-Ruiz, Runtian Liu; reviewed by Zhao Yang, Benedict Elliott Smith for CASSANDRA-21216

Co-authored-by: Runtian Liu <runtian@uber.com>
2026-06-02 10:14:26 +01:00
Dmitry Konstantinov c0999f04d1 Avoid megamorphic call overhead at RandomAccessReader#current
patch by Dmitry Konstantinov; reviewed by Stefan Miklosovic, Francisco Guerrero for CASSANDRA-21399
2026-06-01 12:10:26 +01:00
Dmitry Konstantinov e2dae5e7a0 Enable async GC logging for JDK versions which support it to avoid potential hiccups caused by GC log file I/O blocking
patch by Dmitry Konstantinov; reviewed by Stefan Miklosovic for CASSANDRA-21372
2026-05-31 12:58:27 +01:00
walcp1 bbff4f8d18
Add rowsMutatedPerWriteHistogram metric to track rows mutated per write request
patch by Piotrek Walczak; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-21320
2026-05-31 11:26:02 +02:00
Dmitry Konstantinov ae447445b3 Merge branch 'cassandra-5.0' into cassandra-6.0
* cassandra-5.0:
  A test emitting both a failure and error element in the same JUnit XML testcase crashes CI summary generation
2026-05-30 16:45:06 +01:00
Dmitry Konstantinov ffe7f761b8 A test emitting both a failure and error element in the same JUnit XML testcase crashes CI summary generation
patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-21396
2026-05-30 16:23:50 +01:00
pwalczak 03450cdea6
Add TotalRowsRead and TotalRowsMutated counters to TableMetrics for accurate per-table row throughput tracking
patch by Piotrek Walczak; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-21321
2026-05-29 16:20:38 +02:00
Stefan Miklosovic e21461e4e8
Move exception handling of SPI startup checks when iterating over them
patch by Stefan Miklosovic; reviewed by Caleb Rackliffe for CASSANDRA-21409
2026-05-29 09:35:52 +02:00
Dmitry Konstantinov 9198058986 Avoid type lookup in SerializationHeader#getType if schema and SSTable are aligned
patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21402
2026-05-28 15:11:03 +01:00
Dmitry Konstantinov 454f62d45a Replace LongAdder in metric-like logic with ThreadLocalCounter
patch by Dmitry Konstantinov; reviewed by Stefan Miklosovic for CASSANDRA-21400
2026-05-28 14:22:47 +01:00
David Capwell bc6e4a2b63 Fix flaky test DropAccordTableTest
patch by David Capwell; reviewed by Caleb Rackliffe for CASSANDRA-21397
2026-05-27 15:21:07 -07:00
Dmitry Konstantinov bf711a0fc1 BTreeRow.hasLiveData: avoid Cell iteration if there are no cell tombstones
patch by Dmitry Konstantinov; reviewed by Francisco Guerrero for CASSANDRA-21363
2026-05-26 15:33:28 +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 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 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
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 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 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
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 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 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 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 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
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 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