Commit Graph

31740 Commits

Author SHA1 Message Date
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 154b6a38c9 ninja: fix ReplicationFactorTest 2026-06-20 14:55:24 -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
Blake Eggleston 129cbf3f75 CEP-45: Fix IN queries for mutation tracking
Patch by Blake Eggleston; Reviewed by Abe Ratnofsky for CASSANDRA-20375
2026-04-09 16:45:32 -07:00
Blake Eggleston 4d7815e2e8 CEP-45: Add support for unlogged batches
Patch by Blake Eggleston; Reviewed by Abe Ratnofsky for CASSANDRA-20957
2026-04-09 16:45:32 -07:00
Blake Eggleston e51c0d2346 Fix param type - from query forwarding I think 2026-04-09 16:45:32 -07:00
Blake Eggleston 19be8aeac2 CEP-45: Add mutation tracking support for secondary index reads
This patch enables mutation tracking for queries using secondary indexes (both
legacy 2i and SAI). Key changes include the addition of the MultiStepSearcher
interface, which allows existing index implementations to iterate over matches
and filter augmented data, proper Memtable snapshotting, and the integration of
these in PartialTrackedIndexRead.

patch by Blake Eggleston; reviewed by Aleksey Yeschenko and Caleb Rackliffe for CASSANDRA-20374

Co-authored-by: Blake Eggleston <blake@ultrablake.com>
Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Aleksey Yeschenko <aleksey@apache.org>
2026-04-09 16:45:32 -07:00
Caleb Rackliffe 5a94a5a0fd Enable range reads for MultiNodeTableWalkWithMutationTrackingTest and document failure modes for known problematic seeds
patch by Caleb Rackliffe; reviewed by Blake Eggleston for CASSANDRA-20898
2026-04-09 16:45:32 -07:00
Aleksey Yeschenko d34e758e4b Truncate mutation journal as logs get reconciled
patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-20710
2026-04-09 16:45:32 -07:00
Caleb Rackliffe def980e475 Disable mutation tracking by default in CassandraGenerators
patch by Caleb Rackliffe; reviewed by Blake Eggleston for CASSANDRA-20944
2026-04-09 16:45:32 -07:00
Blake Eggleston 4215cfd2aa CEP-45: Support host replacement with tracked keyspaces
Patch by Blake Eggleston; Reviewed by Abe Ratnofsky for CASSANDRA-20891
2026-04-09 16:45:32 -07:00
Alex Petrov a7b431d683 CEP-45: Integrate Mutation Journal with Memtable flush tracking
* Tracking of Memtable -> SSTable flushes in Mutation Journal segments
  * Replay of Mutation Journal segments that were not fully flushed to SSTables
  * Distinguish between CommitLog and MutationJournal offsets
  * Effectively adds support for node bounces

Patch by Alex Petrov; reviewed by Aleksey Yeschenko for CASSANDRA-20919
2026-04-09 16:45:32 -07:00
Ariel Weisberg 1e036cf620 Initial witness non-serial single partition read/write path
Patch by Ariel Weisberg; Reviewed by Abe Ratnosfky for CASSANDRA-20930
2026-04-09 16:45:32 -07:00
Aleksey Yeschenko 9d856f2c08 Implement Shard and CoordinatorLog metadata durability
patch by Aleksey Yeschenko; reviewed by Abe Ratnofsky for CASSANDRA-20882
2026-04-09 16:42:44 -07:00
Blake Eggleston 9dbafa812d Single-partition read fixes:
- filter augmenting mutations and add comment explaining why we don't exclude reconciled mutations when augmenting
- propagate exceptions during acknowledgeReconcile
- fix UnreconciledMutations handling of single key bounds
- fix single offset remove bug

patch by Blake Eggleston; reviewed by Caleb Rackliffe for CASSANDRA-20830
2026-04-09 16:42:44 -07:00
Caleb Rackliffe 416c1292e4 Enable single-partition AST fuzz tests w/ mutation tracking
patch by Caleb Rackliffe; reviewed by ? for CASSANDRA-20830
2026-04-09 16:42:44 -07:00
Aleksey Yeschenko 9676c0eaeb Implement unified log reconciliation
patch by Aleksey Yeschenko; reviewed by Blake Eggleston for
CASSANDRA-20729

Co-authored-by: Aleksey Yeschenko <aleksey@apache.org>
Co-authored-by: Blake Eggleston <blake@ultrablake.com>
2026-04-09 16:35:32 -07:00
Caleb Rackliffe c1bb86ab60 Initial round of post-rebase (mostly Accord-related) fixes 2026-04-09 16:34:18 -07:00
Caleb Rackliffe 6c26813c2a Separate TestParams by use-case (Accord vs. Mutation Journal) 2026-04-09 16:34:18 -07:00
Blake Eggleston 14a743f8f7 CEP-45: Fix ALLOW FILTERING queries for mutation tracking
Patch by Blake Eggleston; Reviewed by Aleksey Yeschenko for CASSANDRA-20555
2026-04-09 16:34:18 -07:00
Abe Ratnofsky 65caf3f58b Fully reconciled SSTable promotion
patch by Abe Ratnofsky; reviewed by Ariel Weisberg, Blake Eggleston for CASSANDRA-20381
2026-04-09 16:34:18 -07:00
Abe Ratnofsky 51e63f0ff3 Add mutation tracking summary to SSTables
Patch by Abe Ratnofsky; reviewed by Ariel Weisberg, Blake Eggleston for CASSANDRA-20336
2026-04-09 16:34:18 -07:00
Aleksey Yeschenko fa017c6334 Implement coordinator log offset broadcasting
patch by Aleksey Yeschenko; reviewed by Blake Eggleston for CASSANDRA-20576
2026-04-09 16:34:18 -07:00
Abe Ratnofsky c18ca7afc5 CEP-45: Query forwarding
Patch by Abe Ratnofsky; Reviewed by Blake Eggleston for CASSANDRA-20309
2026-04-09 16:34:18 -07:00
Blake Eggleston c71f976955 Mutation tracking journal integration, read, and write path
Patch by Blake Eggleston & Aleksey Yeshchenko
Reviewed by Blake Eggleston, Aleksey Yeshchenko, & Abe Ratnofsky
 for CASSANDRA-20304, CASSANDRA-20305, & CASSANDRA-20308, CASSANDRA-20373

Co-authored-by: Blake Eggleston <blake@ultrablake.com>
Co-authored-by: Aleksey Yeschenko <aleksey@apache.org>
2026-04-09 16:34:18 -07:00
Aleksey Yeschenko b824304867 Introduce MutationJournal for coordinator logs
patch by Aleksey Yeschenko; reviewed by Blake Eggleston for
CASSANDRA-20353
2026-04-08 09:30:40 -07:00
Paulo Motta 73063437b6 Merge branch 'cassandra-5.0' into trunk 2026-04-08 11:17:44 -04:00
Paulo Motta 9500eb129b Backport Automated Repair Inside Cassandra (CEP-37)
Includes bug fixes and features:
- Improved observability in AutoRepair (CASSANDRA-20581)
- Stop repair scheduler if two major versions detected (CASSANDRA-20048)
- Safeguard Full repair against disk protection (CASSANDRA-20045)
- Stop AutoRepair monitoring thread upon shutdown (CASSANDRA-20623)
- Fix race condition in auto-repair scheduler (CASSANDRA-20265)
- Minimum repair task duration setting (CASSANDRA-20160)
- Preview_repaired auto-repair type (CASSANDRA-20046)
- Gate auto-repair behind cassandra.autorepair.enable JVM property
- Add cassandra.autorepair.check_min_version to gate minimum version enforcement
- Prevent auto-repair from running if any node is below 5.0.7
- Make system_distributed auto-repair schema conditional on feature being enabled
- Add user-friendly errors for disabled auto-repair and schema incompatibility

patch by Paulo Motta; reviewed by Andy Tolbert, Jaydeepkumar Chovatia for CASSANDRA-21138

Co-Authored-By: Andy Tolbert <andy_tolbert@apple.com>
Co-Authored-By: Chris Lohfink <clohfink@netflix.com>
Co-Authored-By: Francisco Guerrero <frankgh@apache.org>
Co-Authored-By: Himanshu Jindal <himanshj@amazon.com>
Co-Authored-By: Jaydeepkumar Chovatia <jchovati@uber.com>
Co-Authored-By: Kristijonas Zalys <kzalys@uber.com>
Co-Authored-By: jaydeepkumar1984 <chovatia.jaydeep@gmail.com>
2026-04-08 10:53:41 -04:00
mck d2bdb2ffa8
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Autogenerate the doc antora.yml
2026-04-08 15:24:07 +02:00
mck 0807210572
Autogenerate the doc antora.yml
patch by Mick Semb Wever; reviewed by Anthony Grasso for CASSANDRA-17375
2026-04-08 15:19:40 +02:00
mck 300c216aa6
ninja trunk patch for CASSANDRA-21202
this diff was supposed to be included in 5f9de8ca13

Rate limit password changes
Introduces property cassandra.role_password_update_interval_in_ms, with default value of 5000.
Logging added when passwords on roles are changed or are rate-limited.

 patch by Mick Semb Wever; reviewed by Doug Rohrer, Jeremiah Jordan for CASSANDRA-21202
2026-04-08 15:09:58 +02:00
Stefan Miklosovic 11c858b99f
revert changelog for CASSANDRA-21007 from 6.0-alpha2 as it was delivered in 6.0-alpha1 2026-04-07 15:43:26 +02:00
Mick Semb Wever 88e3fcfe8b
Increment version to 6.0-alpha2 2026-04-04 00:15:39 +02:00
Stefan Miklosovic 0679fea4cb
Merge branch 'cassandra-5.0' into trunk
This merge contains the forgotten entry in 6.0-alpha1 list of changes in CHANGES.txt for CASSANDRA-21007
2026-04-02 17:01:13 +02:00