Commit Graph

31811 Commits

Author SHA1 Message Date
Michael Marshall 5172a0df3b Dynamically skip sharding L0 when SAI Vector index present
This is a partial solution to IllegalStateException thrown by VectorPostings. It works by using a single shard at L0 when a vector index is present. As noted in the jira ticket, there are edge cases that may still produce errors, notably the case where there are multiple data directories.
The key trade offs here are related to the time complexity for search. Since graph search is log(n), and searching m graphs is m * log(n), we see better search performance by building bigger graphs which is essentially log(m * n). We could pre-shard, which comes at a cost of increased search time complexity.

patch by Michael Marshall,Dmitry Konstantinov; reviewed by Caleb Rackliffe,Dmitry Konstantinov,Michael Semb Wever for CASSANDRA-19661

Co-authored-by: Michael Marshall <mmarshall@apache.org>
Co-authored-by: Dmitry Konstantinov <netudima@gmail.com>
2026-02-26 12:45:05 +00:00
Stefan Miklosovic 9303ca04de
Introduce a check for minimum time to pass to train or import a compression dictionary from the last one
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-21179
2026-02-26 09:43:40 +01:00
Stefan Miklosovic d41a4f7b70
Merge branch 'cassandra-5.0' into trunk 2026-02-25 09:16:50 +01:00
Stefan Miklosovic 53118ba9ef
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-02-25 09:16:02 +01:00
Stefan Miklosovic f5855cebe8
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-02-25 09:15:15 +01:00
Bernardo Botella Corbi 1461e754e8
Update maven-shade-plugin to version 3.6.1
patch by Bernardo Botella Corbi; reviewed by Shailaja Koppu, Stefan Miklosovic, Doug Rohrer for CASSANDRA-21176
2026-02-25 09:13:04 +01:00
Paulo Motta a9ee34b62d Add compaction strategy override via system properties
Introduce the ability to override compaction strategy for specific keyspaces
and tables at startup via two new system properties:
- cassandra.override_compaction.entities: comma-separated list of keyspaces
  and keyspace.table pairs (e.g. "ks1,ks2.tbl1,ks3.tbl2")
- cassandra.override_compaction.params: JSON compaction parameters to apply

Patch by Paulo Motta; Reviewed by Jaydeepkumar Chovatia for CASSANDRA-21169
2026-02-20 11:49:10 -05:00
Maxim Muzafarov b7eb323c5a
Fix nodetool sjk dropping all arguments after the first one
Patch by Maxim Muzafarov; reviewed by Dmitry Konstantinov for CASSANDRA-21009
2026-02-20 11:03:12 +01:00
Stefan Miklosovic 0be5ffa8c8
Introduce created_at column to system_distributed.compression_dictionaries
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-21178
2026-02-19 03:53:19 +01:00
Dmitry Konstantinov eee06be567 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Improve diagnostics for JUnit tests which crashed or timed out on Jenkins
2026-02-18 23:10:39 +00:00
Dmitry Konstantinov 8303257297 Improve diagnostics for JUnit tests which crashed or timed out on Jenkins
Add test container memory events printing to check if Linux OOM killer was active
Fix thread dump printing on junit test timeout
Process.pid() API is available since JDK9

patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-21172
2026-02-18 22:53:39 +00:00
Dmitry Konstantinov 52d3b23df2 junit fix: avoid creating of thousands of threads by MatcherResponse when many messages are handled using MockMessagingSpy
Too many threads can lead to OOM, so new Thread is replaced with an executor
spin wait is added to HintsServiceTest.testPageSeek to avoid flaky NPE (HintsStore is populated in an async way)

patch by Dmitry Konstantinov; reviewed by Brandon Williams for CASSANDRA-21166
2026-02-18 22:34:03 +00:00
Caleb Rackliffe 7532be5cbb Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Optionally force IndexStatusManager to use the optimized index status format
2026-02-17 14:15:33 -06:00
Caleb Rackliffe 32154eebcd Optionally force IndexStatusManager to use the optimized index status format
patch by Caleb Rackliffe; reviewed by Jon Meredith for CASSANDRA-21132
2026-02-17 14:00:57 -06:00
Stefan Miklosovic 56c3d72fe8
Merge branch 'cassandra-5.0' into trunk 2026-02-17 11:46:44 +11:00
Stefan Miklosovic 60c7f05138
Cleanup of dependency-check-suppressions.xml, suppressing CVE-2025-67735
patch by Stefan Miklosovic; reviewed by Michael Semb Wever for CASSANDRA-21159
2026-02-17 11:40:01 +11:00
Stefan Miklosovic 3fc830a19c
Be able to detect and remove orphaned compression dictionaries
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-21157
2026-02-17 11:07:49 +11:00
Maxim Muzafarov 2ed4c25753
Move the code style configuration from the .idea/codeStyles to the ide/idea folder
Patch by Maxim Muzafarov; reviewed by Stefan Miklosovic for CASSANDRA-21124
2026-02-15 17:47:54 +01:00
samlightfoot a3a834ad31 Reduce memory footprint of IndexSummaryTest large summary tests
The runtime overflow guard test (testLargeIndexSummary) required ~2 GiB of
off-heap memory to trigger the Integer.MAX_VALUE boundary in
IndexSummaryBuilder.maybeAddEntry. SafeMemoryWriter's 50% buffer growth
strategy caused ~5 GiB peak memory during reallocation (old + new buffer),
exceeding CI medium node limits (3.5-5 GB).

Extract the hardcoded Integer.MAX_VALUE threshold in IndexSummaryBuilder
into a @VisibleForTesting field (maxEntriesSize), allowing the test to
exercise the same guard logic with a 2 MB threshold instead. Rename both
large summary tests to reflect their distinct code paths: runtime truncation
vs constructor-initiated downsampling.

patch by Sam Lightfoot; reviewed by Brandon Williams,Dmitry Konstantinov,Michael Semb Wever for CASSANDRA-20599
2026-02-13 13:05:50 +00:00
samlightfoot ee124d2658 Fix flaky test2DeleteRangeWithOverlapingBoundAndSameTimestampCompaction
The two deletes use the same CQL timestamp, so compaction should merge
their overlapping range tombstones into a single open/close pair (no
boundary markers). However, DeletionTime also includes local_delete_time
(wall-clock seconds), which may differ between deletes if a second
boundary is crossed during the flush. Differing local_delete_time causes
the merger to treat them as distinct deletions, producing boundary
markers instead. Using executeInternalWithNowInSec with a fixed nowInSec
ensures both deletes get identical DeletionTime values.

patch by Sam Lightfoot; reviewed by Dmitry Konstantinov,Brandon Williams for CASSANDRA-21163
2026-02-12 18:06:15 +00:00
arvindksi274-ksolves 817f0b8713 Fix BigTableVerifier to only read a data file during extended verification
It restores the original approach when data files are read only in an extended mode, as it takes more time
It fixes sstable.VerifyTest.testVerifyCorruptRowCorrectDigest test failure

patch by Arvind Kandpal; reviewed by Dmitry Konstantinov,Brandon Williams for CASSANDRA-21150
2026-02-11 09:40:33 +00:00
Jaydeepkumar Chovatia 4ada37e940 No need to evict already prepared statements, as it creates a race condition between multiple threads
patch by Jaydeepkumar Chovatia; reviewed by Alex Petrov for CASSANDRA-17401
2026-02-10 17:07:22 -08:00
jaydeepkumar1984 077b7ebe22 No need to evict already prepared statements, as it creates a race condition between multiple threads
patch by Jaydeepkumar Chovatia; reviewed by Alex Petrov for CASSANDRA-17401
2026-02-10 16:53:19 -08:00
Jaydeepkumar Chovatia 4a2bf29a34 ninja: ant check after CASSANDRA-17401 landed 2026-02-08 11:07:51 -08:00
Jaydeepkumar Chovatia d90fe76c8e No need to evict already prepared statements, as it creates a race condition between multiple threads
patch by Jaydeepkumar Chovatia; reviewed by Alex Petrov for CASSANDRA-17401
2026-02-08 10:49:16 -08:00
Stefan Miklosovic 816524a077
Merge branch 'cassandra-5.0' into trunk 2026-02-06 13:28:49 +11:00
MichaelMorris 8b6195a975
Upgrade logback version to 1.5.18 and slf4j dependencies to 2.0.17
Dropback of CASSANDRA-20429 to cassandra-5.0

patch by Michael Morris; reviewed by Stefan Miklosovic, Brandon Williams for CASSANDRA-21137
2026-02-06 13:28:03 +11:00
Caleb Rackliffe 4412ce29e4 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Update docs to reflect supported query operators in SAI
2026-02-05 17:58:22 -06:00
Suhel0328 30a200c39f Update docs to reflect supported query operators in SAI
patch by Suhel Mohammad; reviewed by Caleb Rackliffe for CASSANDRA-19829
2026-02-05 17:57:53 -06:00
Dmitry Konstantinov 00bf5380fe Reduce memory allocation during transformation of BatchStatement to Mutation
avoid ClusteringIndexSliceFilter allocation if a write does not required a read (plain usual write), avoid iterator allocation, use array instead of ArrayList for perStatementOptions which does not grow dynamically
BatchStatement: check if many similar rows for the same table are written unconditionally, in this case we can avoid columns info merging and builders allocation
add fast path in nonTokenRestrictionValues logic, when we specify a single partition key (a single row) to modify, optimize also the case if a partition or clustering key is a single column
add fast path in valuesAsClustering logic, when we specify a single clustering key (a single row) to modify
UpdateParameters: allocate DeletionTime on demand (it is not needed if we do insert/updates)
serializedRowBodySize: avoid capturing lamda allocation per cell by moving capturing arguments to SerializationHelper (same optimization as it was done in serializeRowBody)
force hash3_x64_128 inlining to help JIT with escape analysis and long[] heap allocation elimination

patch by Dmitry Konstantinov; reviewed by Chris Lohfink for CASSANDRA-21141
2026-02-05 18:46:55 +00:00
Stefan Miklosovic 3dd460bf34
Remove traces of sampling and auto training for Zstd dictionary compression
This is unnecessary code as the current implementation of CEP-54 is not implemeting / exercising these features.

patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-21154
2026-02-05 22:27:18 +11:00
samlightfoot 6f5fe8c06d Add Direct IO support for compaction reads
This change adds support for using O_DIRECT (direct I/O) when reading SSTables
during compaction. Direct I/O bypasses the OS page cache, which can be beneficial
for compaction workloads where data is typically read once and not accessed again
soon after.

Key changes:
- Add DiskAccessMode.direct option for scan operations
- Introduce DirectThreadLocalByteBufferHolder and DirectThreadLocalReadAheadBuffer
  for aligned buffer management required by O_DIRECT
- Add ByteBufferHolder interface to abstract buffer management
- Modify FileHandle to support building direct I/O readers via toBuilder()
- Add startup check to verify Direct IO support on configured data directories
- Enable read-ahead for uncompressed data in Direct CompressedChunkReader
- Move direct IO support logic into FileHandle (from SSTableReader)
- Add comprehensive tests for direct I/O chunk readers and buffer holders

patch by Sam Lightfoot; reviewed by Ariel Weisberg and Maxwell Guo for CASSANDRA-19987
2026-02-04 12:40:42 -05:00
Josh McKenzie 940739a488 Add JDK21 support
Patch by Josh McKenzie; reviewed by Mick Semb Wever and Ekaterina Dimitrova for CASSANDRA-18831

Co-authored-by: Aleksey Yeschenko
Co-authored-by: Achilles Benetopoulos
Co-authored-by: Mick Semb Wever
2026-02-02 12:39:05 -05:00
arvindksi274-ksolves 4184e759de Fix CompactionHistorySystemTableUpgradeTest test expectation for legacy compaction history
patch by Arvind Kandpal; reviewed by Dmitry Konstantinov, Maxwell Guo for CASSANDRA-21151
2026-02-02 08:40:55 +00:00
arvindksi274-ksolves d1b4ddc32a
Fix JMXFeatureTest failure due to disabled AsyncProfiler
patch by Arvind Kandpal; reviewed by Jyothsna Konisa, Stefan Miklosovic for CASSANDRA-21135
2026-02-02 16:51:27 +11:00
nickbar01234 585f89bb42
Support custom StartupCheck implementations via SPI
patch by Nick Bar; reviewed by Stefan Miklosovic, Jyothsna Konisa for CASSANDRA-21093

Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
2026-02-02 10:12:37 +11:00
Dmitry Konstantinov 1f220921dc Fix flakiness of AuditLoggerAuthTest and CQLUserAuditTest by awaiting of default superuser role creation
patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-19165
2026-02-01 17:57:30 +00:00
arvindksi274-ksolves 350c83dc15 Fix CI regression in CompactionHistoryTest by enforcing STCS
patch by Arvind Kandpal; reviewed by Dmitry Konstantinov, Maxwell Guo for CASSANDRA-21145
2026-01-31 16:01:12 +00:00
Stefan Miklosovic 6bf598dcde
Make sstableexpiredblockers support human-readable output with SSTable sizes
patch by Stefan Miklosovic; reviewed by Brad Schoening, Rishabh Saraswat for CASSANDRA-20448
2026-01-31 20:57:23 +11:00
Mick Semb Wever cd707ba67d
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Implement microbench test target type
2026-01-27 20:22:38 +01:00
David Capwell 0fa26aa75d Fix flakey tests due to tests updating SSTable format dynamically
patch by David Capwell; reviewed by Jyothsna Konisa, Nitsan Wakart for CASSANDRA-21130
2026-01-27 09:55:21 -08:00
Maxwell Guo aa3451c55b ninja: add missing CHANGES.txt for CASSANDRA-20081 2026-01-27 19:26:36 +08:00
Mick Semb Wever b3ee9713f8
Implement microbench test target type
Add microbench-test target for quick test run
 Unify declaration and add assertions on target types
 Fix dirname usages for macos
 Parameter for docker_timeout
 Add more jmh class ignores (that are broken)
 Add disableResume() and better host debug to Jenkinsfile

 patch by Mick Semb Wever; reviewed by Dmitry Konstantinov for CASSANDRA-18873
2026-01-27 11:31:17 +01:00
Maxwell Guo 21c4726b57 ninja: fix import check style problem for CASSANDRA-20081 2026-01-26 20:00:09 +08:00
Maxwell Guo 6d60102422 Enhance nodetool compactionhistory to report compaction type and strategy
patch by Arvind Kandpal; reviewed by Maxwell Guo and Jyothsna Konisa for CASSANDRA-20081
2026-01-26 18:39:40 +08:00
Paulo Motta afa55123c8 Fix initial auto-repairs skipped by too soon check
patch by Paulo Motta; reviewed by Jaydeepkumar Chovatia for CASSANDRA-21115
2026-01-23 11:32:25 -05:00
Paulo Motta 099f376635 Merge branch 'cassandra-5.0' into trunk 2026-01-22 14:19:32 -05:00
Paulo Motta 45afd18a13 Automatically disable zero-copy streaming for legacy sstables
Legacy Cassandra 3.x sstables use an old bloom filter format that is
incompatible with zero-copy streaming in Cassandra 5.0+. This patch
automatically detects sstables with the old bloom filter format
(pre-4.0) and disables zero-copy streaming for them, allowing legacy
sstables to be loaded via sstableloader without requiring manual flags.

The fix adds a version check in CassandraOutgoingFile.computeShouldStreamEntireSSTables()
that calls descriptor.version.hasOldBfFormat() to detect legacy sstables.

patch by Paulo Motta; reviewed by Stefan Miklosovic for CASSANDRA-21092
2026-01-22 14:16:16 -05:00
ireath 7fe688b000 CASSANDRA-21024: Add configuration to disk usage guardrails to stop writes across all replicas of a keyspace when any node replicating that keyspace exceeds the disk usage failure threshold.
This commit adds a new configuration, data_disk_usage_keyspace_wide_protection_enabled, which ensures that if any node which replicates a given keyspace is full, all writes to that keyspace are blocked.

patch by Isaac Reath; reviewed by Stefan Miklosovic, Paulo Motta for CASSANDRA-20124

Closes #4547
2026-01-21 16:53:54 -05:00
Arvind Kandpal bad0a10343 BETWEEN where token(Y) > token(Z) returns wrong answer
patch by Arvind Kandpal; reviewed by Caleb Rackliffe, David Capwell for CASSANDRA-20154
2026-01-21 09:33:27 -08:00