Commit Graph

25 Commits

Author SHA1 Message Date
Sam Tunnicliffe 1cfa689778 [CASSANDRA-20736] Add CMS membership directly to ClusterMetadata 2026-07-02 14:03:49 +01:00
Jon Meredith b1f30e94f5 Move long running TCM operations to a longer timout
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>
2026-07-01 14:36:28 +01:00
Sam Tunnicliffe 896d1d6415 Defer the creation of system_cluster_metadata keyspace until CMS initialization
* 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>
2026-06-29 18:09:42 +01:00
Benedict Elliott Smith 8876ad4c03 Introduce:
- Clean Shutdown/Restart
 - Rebootstrap to allow nodes to rejoin consensus if they are out of sync, or did not shutdown cleanly
Improve:
 - Improve efficiency of BTreeReducingRangeMap
 - DurableBefore backed by BTreeReducingRangeMap
 - Soft reject new transactions when a replica has a backlog of work
 - system_accord_debug.command_store_ops supports starting journal replay
Fix:
 - Ensure SequentialExecutor.owner is unset only by the owner
 - Detect and avoid taking two AccordExecutor locks simultaneously
 - MaxConflicts serializer
 - tryToExecuteListening after replay, to handle invalidated dependencies
 - TxnNamedRead does not close a RowIterator, leading to native memory leaks
 - GetLatestDepsNack serialization
 - journal.readLast() did not read last
 - DefaultRemoteListeners not correctly synchronised
 - RangeTxnScanner cancellation assumes was already started
 - Start cfk compaction before replay
 - txn_graph should avoid visiting parents twice (possible if two different dependency chains connecting them in the graph)
 - Topology.cloneEquivalentWithEpoch should also share nodeLookup and ranges, especially to accelerate computeWaitForEpoch/computeScope
 - Do not invoke slowReplicaDelay or slowCoordinatorDelay during restore
 - Do not fail if slowReplicaDelay or slowCoordinatorDelay are invoked without knowing the transaction

patch by Benedict; reviewed by Alex Petrov and Ariel Weisberg for CASSANDRA-21355
2026-05-09 16:46:00 +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
Marcus Eriksson 4ed54ecb2a Improve isGossipOnlyMember and location lookup performance
Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-21039
2025-12-01 10:39:07 +01:00
Alex Petrov ccf12ef845 Add accord journal standalone dump tool
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20738
2025-07-12 13:38:53 +02:00
Sam Tunnicliffe 693eab8776 Revert changes to serving FetchCMSLog/FetchPeerLog requests & remove ReconstructLogState
Patch by Sam Tunnicliffe; reviewed by Alex Petrov for CASSANDRA-20719

Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2025-06-23 14:54:04 +02:00
David Capwell 71aedb2851 Cleanup Accord diff to get it ready for merge
patch by David Capwell; reviewed by Ariel Weisberg for CASSANDRA-20548
2025-04-17 11:59:56 -07:00
Benedict Elliott Smith 430c55dbc4 Integrate RX with Cassandra Repair, so that repair safely flushes pending topology and other durability requirements.
Also improve:
 - Introduce DurabilityService
 - Retire SyncPoint, replace Barrier with Write and RX
 - MessageType -> enum, restore GetMaxConflict
 - Standardise backoff logic with WaitStrategy
 - improve TimeoutStrategy/RetryStrategy specification strings
 - Forbid KX, remove directKeyDeps
 - Introduce UniqueTimeService, permitting hlc reservations for sync points avoid delay when min TxnId is sufficiently in the past
 - Remove ListStore custom purge logic
Also fix:
 - RejectBefore should reject on both epoch and hlc
 - Do not record sync success for removed nodes
 - Support GlobalDurability detecting no command store to run on
 - Incorrect ballot constructor
 - Serializing 15-bit ballot flags incorrectly
 - TopologyManager.hasEpoch deadlock
 - Computing withOpenEpochs incorrectly, sometimes stopping one epoch short
 - PartitionKey serializer should not depend on schema information that can be erased

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20395
2025-04-17 11:59:55 -07:00
David Capwell 9fe1a977b5 Get Harry working on top of Accord and fix various issues found by TopologyMixupTestBase
patch by David Capwell; reviewed by Alex Petrov, David Capwell for CASSANDRA-20054
2025-04-17 11:59:53 -07:00
Alex Petrov d1af562705 Shut down scheduler with "now"
Fix NPE in MockJournal on null onFlush
Fix SavedCommandTest.
After the serialization change that serializes "changed" before "is null", null flag can no be written.
2025-04-17 11:59:53 -07:00
Alex Petrov 8f7b1c2351 Follow-up to CASSANDRA-19967 and CASSANDRA-19869
patch by Alex Petrov, Ariel Weisberg, Benedict Elliott Smith, Blake Eggleston and David Capwell
2025-04-17 11:59:52 -07:00
Alex Petrov c16297f862 Add an ability to reconstruct arbitrary epoch state from the log to TCM
Patch by Alex Petrov; reviewed by Marcus Eriksson for CASSANDRA-19790.
2025-04-17 11:59:51 -07:00
Marcus Eriksson 4318e74180 Various gossip to TCM upgrade fixes
patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-20483
2025-03-26 13:45:16 +01:00
Marcus Eriksson 417bb21d2e Avoid adding LEFT nodes to tokenMap on upgrade from gossip
Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-20344
2025-03-03 08:46:06 +01:00
Marcus Eriksson 415eaffb9c Reduce heap pressure when initializing CMS
Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-20267
2025-03-03 08:37:33 +01:00
Sam Tunnicliffe 48dcf5e092 Snitch re-implementation
Deprecate IEndpointSnitch entirely, to be replaced with new interfaces:
* Locator for endpoint -> location mapping
* InitialLocationProvider to supply the DC & rack for registration
* NodeProximity for sorting endpoints and replicas at query time

For migration/upgrade/deprecation, nodes can still be configured with
an IEndpointSnitch implementation via endpoint_snitch in config, but
we hide this with a facade and only present the new interfaces.

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

Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2024-12-16 11:25:39 +00:00
Marcus Eriksson 279c0527aa Allow CMS reconfiguration to work around DOWN nodes
Patch by Sam Tunnicliffe and marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19943

Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2024-09-27 08:45:40 +02:00
Marcus Eriksson 6dc9ca99fa Retry if node leaves CMS while committing a transformation
Patch by Marcus Eriksson; reviewed by David Capwell and Sam Tunnicliffe
for CASSANDRA-19872
2024-09-04 14:33:20 +01:00
Marcus Eriksson cbe07fd57e Reconfigure CMS after replacement, bootstrap and move operations
Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19705
2024-07-02 09:02:22 +02:00
Sam Tunnicliffe 728b9ec4c6 Revisit metadata log schema to remove period field
Patch by Sam Tunnicliffe and Marcus Eriksson; reviewed by Alex Petrov for CASSANDRA-19482

Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2024-04-11 09:06:36 +01:00
Marcus Eriksson 6ffd2677ee Remove sealed_periods and last_sealed_period tables
Patch by marcuse; reviewed by Sam Tunnicliffe and Alex Petrov for CASSANDRA-19189

Co-authored-by Sam Tunnicliffe <samt@apache.org>
2024-02-09 15:49:50 +01:00
Alex Petrov 6b3958f1d8 Improve setup and initialisation of LocalLog/LogSpec
Patch by Alex Petrov; reviewed by Sam Tunnicliffe and marcuse for CASSANDRA-19271
2024-02-09 15:49:42 +01:00
Sam Tunnicliffe ae0842372f Implementation of Transactional Cluster Metadata as described in CEP-21
An overview of the core components can be found in the included
TransactionalClusterMetadata.md

patch by Alex Petrov, Marcus Eriksson and Sam Tunnicliffe; reviewed by
Alex Petrov, Marcus Eriksson and Sam Tunnicliffe for CASSANDRA-18330

Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Co-authored-by: Alex Petrov <oleksandr.petrov@gmail.com>
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2023-11-24 10:26:08 +00:00