Commit Graph

31576 Commits

Author SHA1 Message Date
Benedict Elliott Smith 11b72f5331 Follow-up to CASSANDRA-21042: fix AccordResult.tryFailure/coordinationFailed.getMessage NPE 2025-11-27 14:45:02 +00:00
Benedict Elliott Smith 4defbb9b1c Make TopologyException a checked exception to ensure they are handled carefully, as they may occur at surprising times
Also Fix:
 - Restore MaxDecidedRX on replay
 - When catchup_on_start_exit_on_failure == false, should startup on any kind of failure, not only timeout
 - lazy vtable LIMIT clause regression
 - DurabilityService.onEpochRetired
 - Command.validate when uniqueHlc differs
 - Avoid unsafe publication of AccordExecutor to scheduledFastTasks
 - AccordCache hitRate metric names
 - use long for return type of DurationSpec.toNanoseconds
 - Repair without all replicas should not request all Accord replicas participate
 - ExecuteAtSerializer
 - SyncPoints should be coordinated in an epoch that contains the ranges
Also Improve:
 - Split Accord startup into local+distributed, ensure we
 - Add logging to FetchDurableBefore on startup
 - Add randomised testing of AbstractLazyVirtualTable
 - Add validation of lazy virtual table key ordering
 - Don't send requests to faulty replicas
 - shrinkOrEvict large objects without holding lock
 - Accord dtest shutdown

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-21042
2025-11-27 13:12:25 +00:00
Sam Tunnicliffe dbfcd52fd5 Fix schema diffs when comments or security labels are modified
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for
CASSANDRA-21045
2025-11-27 11:05:44 +00:00
Sam Tunnicliffe 209288cebe Reject PrepareJoin if tokens already assigned
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for CASSANDRA-21006
2025-11-25 17:44:57 +00:00
Sam Tunnicliffe 496959a8f2 Don't update registration status if node state for decommissioned peer is found with the same address
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for CASSANDRA-21005
2025-11-25 16:15:10 +00:00
Sam Tunnicliffe ec7794f20f Avoid NPE when meta keyspace placements are empty before CMS is initialized
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for CASSANDRA-21004
2025-11-25 16:13:42 +00:00
Sam Tunnicliffe 62bd9ab1ae Gossip entries for hibernating non-members don't block truncate
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for CASSANDRA-21003
2025-11-25 16:13:05 +00:00
Sam Tunnicliffe 856db2afa0 Retry without time limit calculates wait time correctly
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for CASSANDRA-21002
2025-11-25 16:10:36 +00:00
Sam Tunnicliffe 44f6a32718 AlterSchemaStatement with no effect locally isn't submitted to CMS
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for CASSANDRA-21001
2025-11-25 16:09:34 +00:00
Marcus Eriksson 2acc420e1c Avoid iterating all prepared statements when getting PreparedStatementsCacheSize metric
Patch by marcuse; reviewed by Dmitry Konstantinov for CASSANDRA-21038
2025-11-25 09:47:38 +01:00
Dmitry Konstantinov a0f97a91f2 Reduce performance impact of TableMetadataRef.get and KeyspaceMetadataRef.get
Move TableMetadataRef.get to init part of bulk operations (such as flush, compaction, scrab)
Cache TableMetadata value within TableMetadataRef to reduce overheads for write operations, same for KeyspaceMetadata

Patch by Dmitry Konstantinov; reviewed by Marcus Eriksson for CASSANDRA-20465
2025-11-22 13:56:38 +00:00
Dmitry Konstantinov 909ed8b949 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Fix cleanup of old incremental repair sessions in case of owned token range changes or a table deleting
2025-11-22 11:49:07 +00:00
Dmitry Konstantinov 1a12cbb349 Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Fix cleanup of old incremental repair sessions in case of owned token range changes or a table deleting
2025-11-22 11:35:37 +00:00
Dmitry Konstantinov 7f592803a4 Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Fix cleanup of old incremental repair sessions in case of owned token range changes or a table deleting
2025-11-22 11:23:21 +00:00
Dmitry Konstantinov 8d2c11ed2e Fix cleanup of old incremental repair sessions in case of owned token range changes or a table deleting
Patch by Dmitry Konstantinov; reviewed by Marcus Eriksson, Jaydeepkumar Chovatia for CASSANDRA-20877
2025-11-22 11:17:35 +00:00
Sam Tunnicliffe f05b27502f Improve CMS initialization
* Better handling of DOWN unupgraded nodes
* Test that aborted CMS initialization cleans up state properly
* Clean up orphaned PreInitialize entries in the log on bounce
* Unconditionally reset initiator during abort
* Ensure that metadata log entries aren't exchanged before CMS
  initialization is complete
* Precalculate common serialization version, excluding non-upgraded and
  LEFT nodes
* Decide if metadata-impacting upgrade is in progress using min common
  version
* Add metadata identifier to nodetool cms output

Patch by Sam Tunnicliffe and Marcus Eriksson; reviewed by Sam
Tunnicliffe and Marcus Eriksson for CASSANDRA-21036

Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2025-11-21 16:40:24 +00:00
jkonisa b11633be4f CASSANDRA-20943 Introducing comments and security labels for schema elements 2025-11-19 11:32:50 -08:00
Stefan Miklosovic dc89b8c802
Extend nodetool tablestats for dictionary memory usage
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-20940
2025-11-19 19:12:26 +01:00
Yuqi Yan e621d8a6c1 Introduce separate GCInspector thresholds for concurrent GC events.
For GC like ShenandoahGC/ZGC etc., there are GC events that do not have STW pauses (Concurrent phases).
Operator might find it reasonable to use lower thresholds for events require STW pauses and higher thresholds for concurrent phases.
gc_concurrent_phase_log_threshold and gc_concurrent_phase_warn_threshold configuration options are introduced in cassandra.yaml

Patch by Yuqi Yan; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-20980
Co-authored-by: Stefan Miklosovic
2025-11-16 21:29:00 +00:00
Dmitry Konstantinov 6b57acc7f4 Reduce contention in MemtableAllocator.allocate
- Estimate memory required to allocate for applying a partition update into a memtable and allocate this memory in one shot, then use it as a request-local SLAB
- Reduce contention by switching MemtableAllocator.SubAllocator#owns from updates via AtomicLongFieldUpdater to LongAdder usage. MemtableAllocator.SubAllocator#acquired(..) method updates "owns" value but does not use the updated result.
- Reduce contention by replacing of CAS loop in MemtablePool.SubPool#tryAllocate with allocatedUpdater.addAndGet(this, size)

Patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-20226
2025-11-15 15:33:02 +00:00
Dmitry Konstantinov 4cf684b464 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Fix memory leak in BufferPoolAllocator when a capacity needs to be extended
2025-11-14 17:53:46 +00:00
Dmitry Konstantinov 2fec119f09 Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Fix memory leak in BufferPoolAllocator when a capacity needs to be extended
2025-11-14 17:46:13 +00:00
Dmitry Konstantinov ed7d5840b7 Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Fix memory leak in BufferPoolAllocator when a capacity needs to be extended
2025-11-14 17:34:10 +00:00
Dmitry Konstantinov 3f079b2345 Fix memory leak in BufferPoolAllocator when a capacity needs to be extended
Before the fix during a capacity extension BufferPoolAllocator returned to BufferPool a sliced ByteBuffer wrapper object instead of the originally allocated one, so the ByteBuffer was not recycled by BufferPool
Adjust BufferPoolAllocatorTest to test the ByteBuf capacity extension with a real BufferPool behavior

Patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-20753
2025-11-14 17:11:25 +00:00
Stefan Miklosovic 99be618ec1
Merge branch 'cassandra-5.0' into trunk 2025-11-13 16:46:06 +01:00
shruti-p-s e2f74ed65b
Adding missing configs in system_views.settings to be backward compatible
patch by Sudipta Laha; reviewed by Stefan Miklosovic, Tiago L. Alves, Francisco Guerrero, Yifan Cai for CASSANDRA-20863
2025-11-13 16:42:38 +01:00
Stefan Miklosovic 136e5fd222
Add export, list, import sub-commands for nodetool compressiondictionary
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-20941
2025-11-13 15:38:42 +01:00
Benedict Elliott Smith 494c3c7bef Add AccordExecutorMetrics
Also Introduce:
 - Sharded/LogLinearDecayingHistogram
Also Improve:
 - Do not take a reference to CFK unless relevant
Also Fix:
 - Sharded/LogLinearHistogram
 - ExecuteFlags serialization bug in ReadData

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-21017
2025-11-13 14:36:15 +00:00
Arvind Kandpal cf8050393c ninja: fix typo in NoOpAuditLogger description 2025-11-13 15:44:44 +08:00
David Capwell f43d9d0f7f Add support in the binary protocol to allow transactions to have multiple conditions
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20883
2025-11-12 10:13:41 -08:00
Benedict Elliott Smith f6fd49566f Improve DurabilityQueue:
- All retries are appended to a delay queue so overlaps can be pruned
 - Quorum successes are not retried if there are superseding sync points covering the ranges
 - User-initiated requests are not purged unless the request has timed out or otherwise completed
 - Overlapping requests are queued up against the next to run
Alsp (C*):
 - Catch-up with quorums on restart
 - Manage an ordered set of keys in cache for faster range searches
Also (Accord):
 - Update copy of BTree and import IntervalBTree
 - Fix RedundantStatus WAS_OWNED_OVERRIDE_MASK
 - Add Catchup mechanism to reach parity with a quorum on restart

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-21013
2025-11-12 17:20:25 +00:00
Mick Semb Wever 4b7ef7c8f3
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  ninjafix – docker buildx build instructions in .jenkins/k8s/agent-build.docker
2025-11-12 16:36:37 +01:00
Mick Semb Wever 965eb1d223
ninjafix – docker buildx build instructions in .jenkins/k8s/agent-build.docker 2025-11-12 16:36:09 +01:00
David Capwell 9a534ba06f Merge branch 'cassandra-5.0' into trunk 2025-11-07 11:53:48 -08:00
David Capwell 4091613298 Merge branch 'cassandra-4.1' into cassandra-5.0 2025-11-07 11:52:14 -08:00
David Capwell e4ea61c1cc Merge branch 'cassandra-4.0' into cassandra-4.1 2025-11-07 11:46:57 -08:00
Nikhil Kumawat 61014f2ae7 Leveled Compaction doesn't validate maxBytesForLevel when the table is altered/created
patch by Nikhil Kumawat, Nikhil; reviewed by David Capwell, guo Maxwell for CASSANDRA-20570
2025-11-07 11:44:12 -08:00
Stefan Miklosovic f0cb7f1c1a
Merge branch 'cassandra-5.0' into trunk 2025-11-07 14:09:41 +01:00
Stefan Miklosovic 5ea935d6b8
Merge branch 'cassandra-4.1' into cassandra-5.0 2025-11-07 14:04:21 +01:00
Stefan Miklosovic 7b312d4329
Merge branch 'cassandra-4.0' into cassandra-4.1 2025-11-07 13:57:43 +01:00
Ruslan Fomkin 2d7e99f7b9
Document new table name length limit
CASSANDRA-20389 implemented limit on table name length of 222
characters. This commit updates the documentation to reflect this.

It also adds an assert in CreateTableValidationTest to ensure that the
documented limit matches the actual constant.

patch by Ruslan Fomkin; reviewed by Brad Schoening, Dmitry Konstantinov for CASSANDRA-20914
2025-11-07 13:54:03 +01:00
Benedict Elliott Smith aa5c3aba1d Improve Topology Management
Merge ConfigurationService with TopologyManager to remove cyclic dependency and duplicated work.
Also:
 - Improve visibility of work blocking topology processing
 - Ensure we cannot double-count peers when deciding an epoch's distributed readiness
 - Remove the possibility of distributed stalls, by processing new topologies as soon as a
   contiguous sequence is known locally, regardless of whether anyprior local epoch is ready to
   coordinate or has recorded this fact to peers. The notification of local readiness continues
   to be processed only once all prior epochs are ready, but we can begin using and readying
   later epochs immediately.

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20998
2025-11-06 14:38:01 +00:00
Stefan Miklosovic 1a96b8803a
Enable CQLSSTableWriter to create SSTables compressed with a dictionary
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-20938
2025-11-04 11:11:14 +01:00
Benedict Elliott Smith c9e31f297c Introduce "hardRemoved" concept for marking nodes permanently offline, to permit recovery from availability loss
Also fix:
 - Paxos should not update minHlc if AccordService is not setup
 - Remove EndpointMapper methods that require non-null, to ensure call-sites handle null case explicitly
 - AccordRepair should specify the Node Ids that must participate, but these should not affect the durability requirements for GC
 - Avoid erroneously marking UniversalOrInvalidated when only known to quorum
 - AccordSyncPropagator should not consult FailureDetector as it may throw UnknownEndpointException
 - Refuse ReplaceSameAddress if accord enabled
 - Reset Accord topologies on restart if no local command stores to ensure we can catch up (as intervening epochs may have otherwise been GC'd)
 - MaybeRecover should not abort if found durable if either: 1) prevProgressToken already witnessed durable; or 2) Home state has requested we recover anyway
 - Invariant in MaybeRecover is too strong now we permit recovering when known to be stable
 - ReadData must respond with InsufficientAndWaiting if not Stable to ensure Durability is inferred correctly by ExecuteTxn
 - Avoid StackOverflowException in NotifyWaitingOn
 - PreAccept should honour the REJECTED flag of any member of the latest topology if the vote would be relied upon for any prior epoch's quorum
 - Resume Accord bootstrap on restart
 - Fix burn test non-determinism
 - Reset Accord topologies on restart if no local command stores to ensure we can catch up (as intervening epochs may have otherwise been GC'd)
 - Exclude stale or removed ids from sync points
 - Terminate a failed DurabilityRequest if a required participant is now removed/hardRemoved
Also improve:
 - Introduce accord_debug_keyspace.{listeners_txn, listeners_local}
 - Filter and record faulty in AbstractCoordination
 - If we are the home shard, and our home progress status is done, we should not wait for the home shard to advance the waiting progress state
 - Introduce CommandStore.tryExecuteListening to try to execute all waiting transactions and their dependencies
 - ExecuteTxn on recovery should not wait, to avoid consuming progress log concurrency slots for transactions that cannot execute
 - HomeState should update its phase based on the command status to handle operator request to retry all states
 - Separate home/wait queue in DefaultProgressLog
 - Additional tracing
 - Do not call trySendMore from prerecordFailure
 - Force full recovery for sync points if we have lost quorum

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20921
2025-11-03 15:16:27 +00:00
Mick Semb Wever 0db9d4d926
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  ninja – fix CHANGES.txt (cassandra-4.1 still on 4.1.11)
2025-10-31 09:40:49 +01:00
Mick Semb Wever a3ad539c99
Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  ninja – fix CHANGES.txt (cassandra-4.1 still on 4.1.11)
2025-10-31 09:40:29 +01:00
Mick Semb Wever fca850c737
ninja – fix CHANGES.txt (cassandra-4.1 still on 4.1.11) 2025-10-31 09:12:20 +01:00
Yifan Cai 307603a4ad Support ZSTD dictionary compression
patch by Yifan Cai; reviewed by Jon Haddad, Stefan Miklosovic for CASSANDRA-17021
2025-10-30 16:18:37 -07:00
Stefan Miklosovic 9142d0c851
Fix ExceptionsTable when stacktrace has zero elements
patch by Stefan Miklosovic; reviewed by Brandon Williams, Dmitry Konstantinov for CASSANDRA-20992
2025-10-30 17:37:17 +01:00
Stefan Miklosovic 80938477ef
ninja: get rid of warning during compilation in AccordCQLTestBase.setComplexWithReferenceOnAnotherColumn test by casting stmt.bindsEncoded() value to Object[] to pass to var-arg method 2025-10-29 17:01:44 +01:00