Commit Graph

31771 Commits

Author SHA1 Message Date
Blake Eggleston f0caf85dcd
Merge 9409c1c544 into 119b71981b 2026-07-31 12:32:21 -07:00
Blake Eggleston 119b71981b CEP-58: Satellite replication quorums and failover states
Implements SatelliteReplicationStrategy read/write/paxos plans with
quorum-of-quorums semantics, built on a new CompositeTracker (replacing
PerDcResponseTracker) that requires N of M child quorums to succeed.

Adds SatelliteFailoverState, tracking per-range NORMAL / TRANSITION_ACK /
TRANSITION state so replica layout and consistency requirements can vary
by failover phase. Paxos runs within the primary DC but includes
satellite/secondary summary nodes on prepare and commit via
SatellitePaxosParticipants; PaxosCommitRemoteMutationVerbHandler rejects
remote paxos commit mutations during TRANSITION_ACK so stale commits
can't leak into the other DCs during failover.

Patch by Blake Eggleston; reviewed by Francisco Guerrero and Ariel Weisberg for CASSANDRA-21106
2026-07-31 12:32:10 -07:00
Blake Eggleston ab8fb8d9c2 CEP-58: Introduce ResponseTracker and CoordinationPlan
Extracts coordination completion logic out of the read/write response
handlers into a ResponseTracker abstraction (simple, write, per-DC), and
pairs it with the ReplicaPlan in a CoordinationPlan so replica selection
and quorum requirements are always produced together by the replication
strategy from a single view of state.

Replication strategies now own construction of both halves. Write/read
paths, paxos, batchlog, read repair, and range reads are converted to
consume CoordinationPlan; ReplicaPlanIterator/Merger are renamed
accordingly. Tests included for each tracker implementation.

Patch by Blake Eggleston; reviewed by Francisco Guerrero and Ariel Weisberg for CASSANDRA-21106
2026-07-31 12:32:06 -07:00
Blake Eggleston 550dd312fb CEP-58: Add property-based tests for response tracking
Randomized tests covering response/failure orderings and timeouts for
write response handlers, ReadCallback, paxos prepare/propose/commit, and
tracked read reconciliation. Adds the small test hooks needed to drive
them (isComplete, overridable isFromLocalDc, @VisibleForTesting ctors),
and fixes PaxosPrepare to set haveTrackedDataResponseIfNeeded in the
constructor rather than at start.

Patch by Blake Eggleston; reviewed by Francisco Guerrero and Ariel Weisberg for CASSANDRA-21106
2026-07-31 12:32:00 -07:00
Blake Eggleston 9409c1c544 SatelliteReplicationStrategy feedback 2026-07-10 15:17:38 -07:00
Blake Eggleston 58e96cec11 ResponseTracker feedback 2026-07-10 14:45:15 -07:00
Blake Eggleston ab05667ba8 addressing property test feedback 2026-07-10 10:18:09 -07:00
Blake Eggleston c211bf6075 fix CassandraRelevantProperties alphabetizing 2026-07-10 09:28:48 -07:00
Blake Eggleston ec5359002f add tests around paxos commit additional mutation callback 2026-07-10 09:28:18 -07:00
Blake Eggleston 3f714b2d52 fix natural count in SRS simple response tracker builder 2026-07-10 09:16:46 -07:00
Blake Eggleston 154b6a38c9 ninja: fix ReplicationFactorTest 2026-06-20 14:55:24 -07:00
Blake Eggleston a477736f6b add rejected paxos operations metric 2026-06-19 14:18:03 -07:00
Blake Eggleston 03bb81798b feedback 2026-06-19 14:10:30 -07:00
Blake Eggleston dfe4946b33 rename CoordinationPlanTestUtils to CoordinationPlans 2026-06-19 14:10:23 -07:00
Blake Eggleston 845408660d fix signalling race on AbstractWriteResponseHandler 2026-06-19 13:50:03 -07:00
Blake Eggleston 8fdb0c4391 feedback 2026-06-19 13:02:15 -07:00
Blake Eggleston 3320c37b32 remove reason from ResponseTracker#onFailure 2026-06-19 12:40:31 -07:00
Blake Eggleston cb34fc72b6 remove reason from ResponseTracker#onFailure 2026-06-19 12:38:02 -07:00
Blake Eggleston 424e6f0779 feedback 2026-06-19 12:35:58 -07:00
Blake Eggleston d63a48eb18 fix liveAndDown naming 2026-06-19 10:32:20 -07:00
Blake Eggleston 5c38e68dfd rename committed replicas -> natural 2026-06-19 10:03:12 -07:00
Blake Eggleston 219112a96f feedback 2026-06-19 09:43:56 -07:00
Blake Eggleston 11a0525656 rename committed replicas -> natural 2026-06-18 16:08:04 -07:00
Blake Eggleston 23e82455da feedback 2026-06-18 14:22:06 -07:00
Blake Eggleston 6dcf3e56c8 feedback 2026-06-18 14:19:27 -07:00
Blake Eggleston 9bd69f2fec feedback 2026-06-17 15:14:49 -07:00
Blake Eggleston f4d9c4c3a3 feedback 2026-06-17 15:05:22 -07:00
Blake Eggleston fca67544f4 feedback 2026-06-17 14:40:49 -07:00
Blake Eggleston 1c7c054d26 disable range read merging and single replica methods 2026-06-15 10:40:15 -07:00
Blake Eggleston adf1195d3d fix batchlog replay block for 2026-06-15 10:40:15 -07:00
Blake Eggleston 7b87193286 fix removed private IndexStatusManager ctor 2026-06-15 10:40:15 -07:00
Ariel Weisberg dab38af989 Style fixes 2026-06-11 13:20:37 -04:00
Blake Eggleston 051c3236e2 satellite replication quorums 2026-04-21 15:22:49 -07:00
Blake Eggleston 54bbf28b0b add and integrate response tracker and coordination plan 2026-04-21 15:22:49 -07:00
Blake Eggleston c5411887c7 property based response tracking tests 2026-04-21 15:15:18 -07:00
Blake Eggleston ab0b93f987 CEP-58: Add satellite replication strategy stub
Patch by Blake Eggleston; Reviewed by Caleb Rackliffe for CASSANDRA-21105
2026-04-21 15:10:51 -07:00
Aleksey Yeshchenko 9d336f67a3 Ninja-fix checkstyle import warnings 2026-04-21 15:16:18 +01:00
Aparna Naik a5116b93a6 CEP-45: Incremental Repair integration w/Mutation Tracking
Implement mutation tracking repair as a new repair task that replaces
Merkle tree validation and streaming for tracked keyspaces. Instead of
building hash trees and comparing data, MutationTrackingSyncCoordinator
sends MT_SYNC_REQ to all participants to collect their witnessed offsets,
then waits for background offset broadcasts to confirm all replicas have
reconciled to those target offsets.

Key changes:

- Add MutationTrackingIncrementalRepairTask that creates per-range
  MutationTrackingSyncCoordinator instances and blocks until all
  shards reach the target reconciled offsets or timeout.

- Add MT_SYNC_REQ/MT_SYNC_RSP verbs and MutationTrackingSyncRequest/
  MutationTrackingSyncResponse messages for the repair protocol to
  establish a happens-before relationship between repair start and
  offset collection.

- RepairCoordinator.create() factory method snapshots TCM state to
  decide whether to use mutation tracking repair and flips incremental
  to false (skipping anti-compaction) when MT is active without
  migration.

- Support mutation tracking migration: during untracked->tracked
  migration, run incremental repair first (for pre-migration data),
  then MT sync. KeyspaceMigrationInfo validates that repair ranges
  don't partially overlap pending migration ranges and routes
  streaming/SSTable finalization through the correct tracked vs
  untracked path.

- Temporarily route read repair mutations through the untracked write
  path during migration by adding isReadRepair flag to Mutation and
  bypassing migration routing checks in ReadRepairVerbHandler and
  CassandraKeyspaceWriteHandler. This is a stopgap; CASSANDRA-21252
  will roll back this approach and handle read repair properly.

- Add offset collection APIs to CoordinatorLog, Node2OffsetsMap, and
  Shard for computing union and intersection of witnessed offsets
  scoped to specific participant host IDs (supporting --force with
  dead node exclusion).

- Add configurable mutation_tracking_sync_timeout (default 2m) with
  JMX get/set on StorageServiceMBean.

- Fix ActiveRepairService to use tryFailure() instead of setFailure()
  to avoid double-completion exceptions during concurrent repair
  failures.

Co-Authored-By: Ariel Weisberg <aweisberg@apple.com>
2026-04-14 12:00:26 -07:00
Blake Eggleston 7ef7c675d6 rebase - fix secondary index double free bug 2026-04-13 15:05:21 -07:00
Blake Eggleston e7524acfec rebase - fix CEP-45: Support host replacement with tracked keyspaces 2026-04-13 10:43:50 -07:00
Blake Eggleston 5ab65fbc68 rebase - fix Mutation tracking journal integration, read, and write path 2026-04-13 10:12:12 -07:00
Blake Eggleston f01cbb1dd7 rebase - fix Mutation tracking journal integration, read, and write path 2026-04-13 10:09:43 -07:00
Blake Eggleston 1c10de236f CEP-45: Add feature flag for Mutation Tracking
patch by Caleb Rackliffe; reviewed by Blake Eggleston and Sam Tunnicliffe for CASSANDRA-20926

Co-authored-by: Blake Eggleston <blake@ultrablake.com>
Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
2026-04-09 16:46:57 -07:00
Ariel Weisberg b11122f23b SERIAL read/write support for Witnesses and Mutation Tracking
Patch by Ariel Weisberg; Reviewed by Aleksey Yeschenko for CASSANDRA-20953
2026-04-09 16:46:57 -07:00
Abe Ratnofsky 06e7dee9f8 CEP-45: Full Repair Support for Tracked Keyspaces
Tracked keyspaces cannot accept new data without first registering it in
the log. Any unreconciled data that isn't present in the log will break
read monotonicity, since mutation tracking uses a single data read and
can only read reconcile mutation IDs that are present in the log.

Full repair sync tasks also deliver data to replicas, and require
integration with the log just like imports do. The general design of this
integration is to give repair SyncTasks the same two-phase commit as
import transfers, where we stream SSTables to a pending directory, then
once sufficient streams complete successfully, we "activate" those
streams and move them out of the pending directory and into the live set.

patch by Caleb Rackliffe; reviewed by Abe Ratnofsky for CASSANDRA-21066

Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Abe Ratnofsky <abe@aber.io>
2026-04-09 16:46:37 -07:00
Aparna Naik 861b4e82a9 Add support for counters to mutation tracking
patch by Aparna Naik; reviewed by Aleksey Yeschenko for CASSANDRA-20959
2026-04-09 16:46:37 -07:00
Blake Eggleston d5b5fd7f77 CEP-45: Replication type migration
Patch by Blake Eggleston; Reviewed by Ariel Weisberg for CASSANDRA-20388
2026-04-09 16:46:37 -07:00
Aparna Naik 5b3784031f CEP-45: Add virtual tables for Mutation Tracking
patch by Aparna Naik; reviewed by Abe Ratnofsky and Blake Eggleston for CASSANDRA-20987
2026-04-09 16:45:32 -07:00
Aparna Naik 5854400649 CEP-45: Add metrics for Mutation Tracking
patch by Aparna Naik; reviewed by Abe Ratnofsky and Blake Eggleston for CASSANDRA-20986
2026-04-09 16:45:32 -07:00
Abe Ratnofsky 407e19021b CEP-45: Bulk transfer
patch by Abe Ratnofsky; reviewed by Caleb Rackliffe and Blake Eggleston for CASSANDRA-20383
2026-04-09 16:45:32 -07:00