Commit Graph

31590 Commits

Author SHA1 Message Date
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
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
Stefan Miklosovic 3885395752
Merge branch 'cassandra-5.0' into trunk 2026-01-20 15:30:22 +01:00
Stefan Miklosovic 039e8b6649
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-01-20 15:27:10 +01:00
Stefan Miklosovic 6a39d88bce
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-01-20 15:19:24 +01:00
omniCoder77 5101d76b21
Fix links in README
patch by Rishabh Saraswat; reviewed by Brad Schoening, Jyothsna Konisa, Stefan Miklosovic for CASSANDRA-21110
2026-01-20 15:14:12 +01:00
Dmitry Konstantinov 39d1149c74 Optimize memtable flush logic
add more flushing stats: partitions/rows, bytes rate, CPU and heap allocation for the flushing thread
avoid columns filtering overheads for unfilteredIterator
do not re-map colums in serializeRowBody if they haven't changed
reduce allocations during serialization of NativeClustering
add fast return for BTreeRow.hasComplexDeletion, avoid column.name.bytes.hashCode if not needed, avoid capturing lambda allocation in UnfilteredSerializer.serializeRowBody
check if Guardrails enabled at the beginning of writing, avoid hidden auto-boxing for logging of primitive parameters
split call sites for in Cell serialize logic, make isCounterCell cheaper (avoid megamorphic call + cache isCounterColumn)
invoke metadataCollector.updateClusteringValues only for first and last clustering key in a partition
enforce inlining for MinMaxIntTracker/MinMaxLongTracker

Patch by Dmitry Konstantinov; reviewed by Branimir Lambov for CASSANDRA-21083
2026-01-19 16:13:40 +00:00
Jaydeepkumar Chovatia aa4da838ec ninja: ant check after CASSANDRA-17401 landed 2026-01-18 21:12:35 -08:00
Jaydeepkumar Chovatia a06df099f4 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-01-18 20:11:35 -08:00
Alan Wang 8974fdb821 Include Level information for UnifiedCompactionStrategy in nodetool tablestats output
Patch by Alan Wang, reviewed by Jyothsna Konisa and marcuse for CASSANDRA-20820
2026-01-13 14:12:38 +01:00
Stefan Miklosovic a3c40f1a67
ninja: skip AsyncProfiler tests in CI when kernel parameters are not right
Based on the official documentation here (1), AsyncProfiler works best with these kernel parameters.
Not all CI environments have them set. That would fail the tests which run the startup check
if kernel parameters are not like that.

It might be empirically observed that some AsyncProfiler functionality works even without these
kernel parameters, it might be investigated in follow-up work if we should not relax these conditions a bit.

(1) https://github.com/async-profiler/async-profiler/blob/master/docs/GettingStarted.md#before-profiling
2026-01-13 12:26:47 +01:00
Yaman Ziadeh 7c3c3a1d86 Initial async-profiler Nodetool implementation
patch by Yaman Ziadeh, Bernardo Botella, Stefan Miklosovic; reviewed by Dmitry Konstantinov, Jyothsna Konisa for CASSANDRA-20854
2026-01-12 15:02:13 -08:00
Dmitry Konstantinov 3662d758c3 Minor perf optimizations around memtable put logic
Avoid BTree iterators allocation in ColumnsCollector.update
reduce amout of virtual calls for Cell.dataSize
avoid capturing lambda allocation in BTreeRow.clone
do not recalculate minLocalDeletionTime when BTreeRow is cloned
avoid CAS write if EncodingStats is not changed after merge

Patch by Dmitry Konstantinov; reviewed by Jyothsna Konisa, Michael Semb Wever for CASSANDRA-21088
2026-01-10 13:05:54 +03:00
Nivy Kani bc9773ea0a Fix non-determinism of repair fuzz tests by passing randomizer to RetryStrategy
patch by Nivy Kani; reviewed by David Capwell, Jyothsna Konisa for CASSANDRA-21087
2026-01-09 16:17:43 -08:00
David Capwell 86e024b416 NPE when trying to use CAS on local system tables
patch by David Capwell; reviewed by Ariel Weisberg for CASSANDRA-21112
2026-01-09 16:13:01 -08:00
David Capwell 8d11662d6d When level compaction validates its table properties, it used the wrong default value for sstable_size_in_mb which allowed properties that would later be rejected at runtime
patch by David Capwell; reviewed by Ariel Weisberg for CASSANDRA-20570
2026-01-09 12:30:38 -08:00
Nivy Kani 386183fce1 Fix off-by-one bug in exponential backoff for repair retry config
patch by Nivy Kani; reviewed by David Capwell, Jyothsna Konisa for CASSANDRA-21102
2026-01-09 10:15:09 -08:00
David Capwell c35c3181fa Fix flakey test org.apache.cassandra.utils.SimpleBitSetSerializersTest#any
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-21077
2026-01-07 16:00:10 -08:00
Stefan Miklosovic 98ec8970e1
Move training parameters for Zstd dictionary compression to CQL
It is also possible to override them via nodetool if necessary.

This patch also fixes the computation of sampling ratio to not lose the precision.

patch by Stefan Miklosovic; reviewed by Jyothsna Konisha, Yifan Cai for CASSANDRA-21078
2026-01-07 16:21:47 +01:00
Maxim Muzafarov 1737efb050
ninja: add a commit with the import order to ignore revs 2025-12-30 22:39:50 +01:00
Maxim Muzafarov 3dc33de6ea
Organize imports and standartize import order across entire codebase
Patch by Maxim Muzafarov; Reviewed by Michael Semb Wever for CASSANDRA-17925
2025-12-30 22:34:14 +01:00
Maxim Muzafarov 9a30a3469c
Add configuration for sorted imports in source files
Patch by Maxim Muzafarov; Reviewed by Michael Semb Wever for CASSANDRA-17925
2025-12-30 22:34:12 +01:00
Stefan Miklosovic 3c69bd2367
ninja: fix tests after CASSANDRA-21074 landed 2025-12-22 13:02:40 +01:00