Replaces the fixed-retry commit loop with deadline-based exponential
backoff for long running CMS commit operations (cms_commit_timeout=1h, 5s-60s jitter)
to allow heavily contended CMS nodes time to commit transforms.
Patch by Jon Meredith and Sam Tunnicliffe; reviewed by Jon Meredith and
Sam Tunnicliffe for CASSANDRA-21453
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
- Introduced LocalCommand marker interface to identify commands that execute purely locally without a JMX connection.
- Updated History command to implement LocalCommand.
- Updated CassandraCliHelpLayout to check for LocalCommand instead of calling execution-flow methods, safely suppressing JMX options for offline commands.
patch by Arvind Kandpal; reviewed by Stefan Miklosovic, Maxim Muzafarov for CASSANDRA-20876
* Insert the actual PreInitialize entry in the distribute metadata log
table using a callback after the log is bootstrapped.
* Remove the implicit insert on subsequent commit, i.e. of the Initialize entry
* Enables the full specifics of PreInit to be encoded in the serialized form,
removing the special casing for the first CMS member and other nodes
* Correctly invalidate cached KeyspaceMetadata when in a pre-initialized state
* Update Host ids in the system.peers_v2 table directly following CMS initialization
* Initialise gossip/local host id after CMS initialization completes
* Clean up CMS initialization errors which occur after the PreInitialize stage
Co-authored-by: Alex Petrov <oleksandr.petrov@gmail.com>
Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Adds an opt-in O_DIRECT write path for background SSTable producers,
bypassing the OS page cache for data that is unlikely to be re-read
soon after being written. Memtable flushes remain buffered.
Enabled via two new YAML knobs:
- background_write_disk_access_mode: standard (default) | direct
- direct_write_buffer_size: 1MiB (default; aligned up to FS block
size, auto-grown to fit a worst-case compressed chunk)
The path is gated by config, table compression being enabled, and an
OperationType allowlist in DataComponent. The allowlist is exhaustive
over OperationType: any new value left unclassified fails static
initialization.
Operations on the DIO path: COMPACTION, MAJOR_COMPACTION,
TOMBSTONE_COMPACTION, ANTICOMPACTION, GARBAGE_COLLECT, CLEANUP,
UPGRADE_SSTABLES, WRITE, STREAM (chunked receiver only), RELOCATE,
UNKNOWN (offline sstablesplit).
Operations off the DIO path:
- FLUSH (policy: just-flushed data is hot, keep in page cache)
- SCRUB (correctness: tryAppend needs mark/resetAndTruncate)
- Zero-Copy Streaming (bypasses DataComponent.buildWriter)
- Uncompressed writers (only CompressedSequentialWriter has a DIO
subclass in this change)
StartupChecks fails fast if 'direct' is requested on a platform/FS
that does not support O_DIRECT.
patch by Sam Lightfoot; reviewed by Ariel Weisberg, Dmitry Konstantinov for CASSANDRA-21134
Adds missing @Test annotations to testPasswordUpdateRateLimiting and testPasswordUpdateRateLimitingDisabled.
Also fixes minor typos in comments and assertion strings.
Fix flaky CassandraRoleManagerTest by grouping per-role rate limit checks consecutively.
patch by Arvind Kandpal; reviewed by Stefan Miklosovic, Michael Semb Wever for CASSANDRA-21262
add SAN to certificates used by tests
add TLS_ECDHE_* to ciphers list in SSTableLoaderEncryptionOptionsTest
Patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-21441
When BTreeRow.merge reconciles an update into a row whose existing deletion
shadows the update's cells, it filtered the update (incoming) side of the merge
with Reconciler.retain, which records the removal via
PostReconciliationFunction.delete. On the memtable write path that subtracts the
shadowed cells' on-heap size from the allocator's ownership even though that
incoming data was never allocated to the memtable. Under overwrite/delete churn
that re-applies cells already covered by a newer row/partition deletion (e.g.
repair re-streaming), the allocator's "owns" counter drifts negative and the next
flush trips "AssertionError: Negative released" in MemtablePool$SubPool.released
via MemtableAllocator$SubAllocator.releaseAll during discard.
Filter the update (incoming) side with a non-recording variant,
Reconciler.removeShadowed, and keep retain() for the existing side,
whose data the memtable already owns. The filtered result is identical; only the
erroneous accounting notification is dropped. This mirrors the already-correct
complex-column path in ColumnData.merge.
patch by Stefan Miklosovic; reviewed by Dmitry Konstantinov for CASSANDRA-21469
Assisted-By: Claude Opus 4.8 <noreply@anthropic.com>
CommandChanges.shouldCleanup short-circuits to NO if there is no data, but this is incorrect as Cleanup.EXPUNGE may have dropped the data and the record must receive cleanup EXPUNGE and be reported as ERASED.
Also Fix:
- Populate CFK system table row markers so we can stop reading sstables as soon as we have data
- system_accord_debug.executors has wrong clustering type
- RemoteToLocalVirtualTable should lazily allocate the partition collector to avoid LIMIT clause filtering removing it before it's populated
- ActiveEpochs.withNewEpochs should handle transition from 0 -> more than 1
- RedundantBefore.minGcBefore should be NONE if empty
- Update RangesForEpoch directly, so that we cannot have race conditions where the ownership is unknown
- Avoid reentrancy on local callbacks
- Ensure ReadCoordinator callbacks are invoked on owning thread
- Avoid deadlock when notifying ComplexListener(s)
- Release IntrusivePriorityHeap memory from large capacity heaps when empty
- Prevent SynchronousRecoverAwait reentrancy when invoking onDone (by exposing and invoking invokeOnDone that first sets isDone)
- maybeExecute must invoke either notWaiting or notifyWaiting to ensure tryExecuteListening terminates
Also Improve:
- Configurable execute_waiting_on_start
patch by Benedict; reviewed by Alan Wang and Alex Petrov for CASSANDRA-21440
This commit fixes several issues found using the Cassandra
edge case explorer skill for the BTI feature.
patch by Francisco Guerrero; reviewed by Aleksey Yeschenko for CASSANDRA-21353