Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Cassandra Repair Options Reference

This page provides detailed explanations of all repair command options, including visual diagrams showing how each option affects repair behavior.

Terminal window
nodetool repair [options] [keyspace [table ...]]

Repairs only the token ranges for which this node is the primary owner.

Primary Range Repair (-pr)Primary Range Repair (-pr)4-Node Cluster (RF=3)Repair WITHOUT -pr on Node 1Repair WITH -pr on Node 1Node 1 (tokens 0-25)Node 2 (tokens 25-50)Node 3 (tokens 50-75)Node 4 (tokens 75-100)Range 0-25Range 75-100Range 50-75Range 0-25Range 75-100Range 50-75Repairs ALL ranges Node 1 holds(primary + replicas) = 3x work per nodeRepairs ONLY primary rangeOther nodes repair their primaries1x work per node

Usage:

Terminal window
# Recommended for routine maintenance
nodetool repair -pr my_keyspace

When to use:

  • Regular scheduled repairs
  • Running repair on every node in sequence
  • Minimizing redundant work

When NOT to use:

  • Single-node recovery scenarios
  • Verifying specific replica consistency

Forces full repair instead of incremental repair, validating all data regardless of repair status.

Full Repair vs Incremental (Default)Full Repair vs Incremental (Default)Incremental Repair (Default)Full Repair (-full)Repaired SSTable 1(repairedAt: timestamp)Repaired SSTable 2(repairedAt: timestamp)Unrepaired SSTable 3(repairedAt: 0)Unrepaired SSTable 4(repairedAt: 0)SSTable 1SSTable 2SSTable 3SSTable 4Only unrepaired SSTablesare validated (green)ALL SSTables validatedregardless of repair status

Usage:

Terminal window
# Full repair of all data
nodetool repair -full my_keyspace
# Combine with -pr for full primary-range repair
nodetool repair -full -pr my_keyspace

When to use:

  • After node replacement or rebuild
  • After data corruption recovery
  • When incremental repair state is suspect
  • Before major version upgrades

Repairs only a specific token range, enabling parallel repair operations or targeted recovery.

Subrange Repair (-st, -et)Subrange Repair (-st, -et)Full Token RangeSubrange Repair ExampleParallel Subrange Strategy-922337203685477580809223372036854775807Start TokenEnd TokenRange 1Range 2Range 3Range 4Only the specified range is repaired-st -9223372036854775808 -et -3074457345618258603Split into N subrangesRepair each in parallelon different threads/nodes

Usage:

Terminal window
# Repair specific token range
nodetool repair -st -9223372036854775808 -et -3074457345618258603 my_keyspace
# Get token ranges for a node
nodetool describering my_keyspace

Use cases:

  • Parallel repair across multiple sessions
  • Targeted repair of specific token ranges
  • Recovery of specific data segments

Controls whether replicas validate data simultaneously or one at a time. Parallel is the default in Cassandra 4.0+. There is no --parallel flag; parallel mode is the default behavior.

Sequential Repair (-seq)Sequential Repair (-seq)Replica AReplica BReplica CReplica A(Repair Coordinator)Replica A(Repair Coordinator)Replica BReplica BReplica CReplica CValidateValidateCompleteValidateCompleteOne replica at a timeLower resource usageLonger total duration
Parallel Repair (--parallel)Parallel Repair (--parallel)Replica AReplica BReplica CReplica A(Repair Coordinator)Replica A(Repair Coordinator)Replica BReplica BReplica CReplica CValidateValidateValidateCompleteCompleteAll replicas simultaneouslyHigher resource usageShorter total duration

Usage:

Terminal window
# Sequential (lower impact, slower)
nodetool repair -pr -seq my_keyspace
# Parallel (default - faster, higher resource usage)
nodetool repair -pr my_keyspace
AspectSequential (-seq)Parallel (default)
Default (4.0+)NoYes
DurationLongerShorter
Resource usageLowerHigher
Network impactDistributed over timeConcentrated
Production safetyHigherLower
Recommended forProduction hoursOff-peak maintenance

A middle ground between fully sequential and fully parallel repair.

The problem -dcpar solves:

  • -seq (sequential): Safe but slow—only one replica builds its Merkle tree at a time across the entire cluster
  • --parallel: Fast but resource-intensive—all replicas build Merkle trees simultaneously, which can overwhelm nodes if many ranges are repairing at once
  • -dcpar: Balances both—allows parallelism across datacenters while limiting load within each datacenter

How it works:

During Merkle tree validation, each replica must read its data to build the tree. This is I/O and CPU intensive. With -dcpar:

  1. Within each datacenter, only one replica validates at a time (sequential)
  2. Across datacenters, validation happens in parallel

This means if a token range has replicas in DC1 and DC2, both datacenters can validate simultaneously, but each DC only has one replica active at a time.

Example: 2 DCs, RF=2 per DC (4 replicas total for each range)

Comparison: -seq vs -dcpar vs --parallelComparison: -seq vs -dcpar vs --parallelDC1. Replica ADC1. Replica BDC2. Replica CDC2. Replica DDC1: Replica ADC1: Replica ADC1: Replica BDC1: Replica BDC2: Replica CDC2: Replica CDC2: Replica DDC2: Replica D-seq (fully sequential)ValidateValidateValidateValidate4 steps totalSlowest, lowest impact-dcpar (DC parallel)ValidateValidateDC1 sequentialValidateDC2 in parallel with DC1Validate2 steps totalBalanced--parallel (fully parallel)ValidateValidateValidateValidate1 step totalFastest, highest impact
OptionReplicas validating simultaneouslyUse case
-seq1Minimize impact during peak hours
-dcpar1 per DCBalance speed and safety in multi-DC clusters
(default)AllFastest repair during maintenance windows

Usage:

Terminal window
nodetool repair -pr -dcpar my_keyspace

Controls how many tables are repaired simultaneously on the node.

Parallel Jobs (-j) for Table RepairParallel Jobs (-j) for Table RepairDefault: -j 1 (Sequential Tables)With -j 4 (Parallel Tables)Table ATable BTable CTable DTable ATable BTable CTable DTables repaired one at a timeLonger total durationLower resource usage4 tables repaired simultaneouslyShorter total durationHigher CPU/memory/network usagewaitwaitwait

Usage:

Terminal window
# Repair 2 tables in parallel
nodetool repair -pr -j 2 my_keyspace
# Repair 4 tables in parallel
nodetool repair -pr -j 4 my_keyspace

Guidelines for -j value:

FactorLower -j (1-2)Higher -j (4+)
CPU cores< 8 cores16+ cores
Memory< 16 GB heap32+ GB heap
Disk I/OHDD or saturatedFast SSD with headroom
NetworkLimited bandwidthHigh bandwidth
Table countFew large tablesMany small tables

Memory impact:

Memory per repair session ≈ repair_session_space_in_mb × number of concurrent tables
With -j 4 and 256 MB per session = ~1 GB additional memory

Restricts repair to nodes within a specific datacenter.

Datacenter-Specific Repair (-dc)Datacenter-Specific Repair (-dc)dc1 (US-East)dc2 (US-West)dc3 (EU)dc1-node1dc1-node2dc1-node3dc2-node1dc2-node2dc2-node3dc3-node1dc3-node2dc3-node3nodetool repair -dc dc1 my_keyspaceOnly dc1 nodes participate in repairCross-DC network traffic avoided

Usage:

Terminal window
# Repair only within dc1
nodetool repair -pr -dc dc1 my_keyspace

Use cases:

  • Minimize cross-datacenter network traffic
  • Repair after DC-specific outage
  • Staged rollout of repairs

Repairs only with replicas in the same datacenter as the coordinator node.

Terminal window
# Repair within local DC only (run from node in target DC)
nodetool repair -pr -local my_keyspace

Limits repair to specific hosts, useful for targeted recovery.

Host-Specific Repair (-hosts)Host-Specific Repair (-hosts)Clusternode110.0.0.1node210.0.0.2node310.0.0.3node410.0.0.4node510.0.0.5nodetool repair -hosts 10.0.0.1,10.0.0.2 my_keyspaceOnly specified hosts participateUseful for targeted recoveryRepair onlybetween these hosts

Usage:

Terminal window
# Repair only between specific nodes
nodetool repair -pr -hosts 10.0.0.1,10.0.0.2,10.0.0.3 my_keyspace

Estimates repair work without executing, useful for planning.

Terminal window
nodetool repair -pr --preview my_keyspace

Output example:

Previewing repair for keyspace my_keyspace
Ranges to repair: 256
Estimated data to stream: 12.5 GiB
Mismatched ranges: 12 (4.7%)
Estimated duration: 45 minutes

Enables detailed tracing for repair sessions, useful for debugging.

Terminal window
nodetool repair -pr --trace my_keyspace

Trace output appears in system_traces keyspace and system logs.

Optimizes streaming by calculating minimal data transfer paths.

Stream Optimization (-os)Stream Optimization (-os)Without OptimizationWith --optimise-streamsNode ANode BNode CNode ANode BNode CTotal: 280MB transferredRedundant data sentTotal: 180MB transferredOptimized transfer pathsStream 100MBStream 100MBStream 80MBStream 100MBForward 80MB

Usage:

Terminal window
nodetool repair -pr -os my_keyspace

Proceeds with repair even if some replicas are unavailable. Use with caution.

Terminal window
# Force repair with unavailable replicas
nodetool repair -pr --force my_keyspace

Warning: This can lead to inconsistent repair state. Only use when:

  • A replica is permanently gone and being replaced
  • Repair must proceed despite temporary unavailability
  • Understanding that full consistency is not guaranteed

Skips keyspaces with replication factor of 1.

Terminal window
nodetool repair --ignore-unreplicated-keyspaces

ScenarioCommandDescription
Daily maintenancenodetool repair -pr my_keyspaceIncremental, primary range only
Weekly full checknodetool repair -pr -full my_keyspaceFull repair, primary range
Fast maintenancenodetool repair -pr -j 2 my_keyspaceParallel (default) with 2 table threads
Conservative repairnodetool repair -pr -seq my_keyspaceSequential, minimal impact
Multi-DC clusternodetool repair -pr -dcpar my_keyspaceDC-parallel mode
Single DC repairnodetool repair -pr -dc dc1 my_keyspaceLimit to specific DC
After node recoverynodetool repair -full my_keyspaceFull repair, all ranges
Option-pr-full-seq-dcpar-j-dc--paxos-only--skip-paxos
-pr-
-full-
-seq-
-dcpar-
-j-
-dc-
--paxos-only-
--skip-paxos-

No --parallel Flag

Parallel repair is the default in Cassandra 4.0+. There is no explicit --parallel flag; to use sequential mode, specify -seq. To use datacenter-parallel mode, specify -dcpar.


Repairs only the Paxos state used by lightweight transactions (LWTs), without repairing user table data.

Terminal window
# Repair Paxos state for all keyspaces
nodetool repair --paxos-only
# Repair Paxos state for a specific keyspace
nodetool repair --paxos-only my_keyspace

How it works:

This command runs a coordinated Paxos repair that synchronizes Paxos state stored in system.paxos across replicas. Unlike the automatic background Paxos repair (which only completes uncommitted transactions), --paxos-only also advances the Paxos repair low bound by writing to system.paxos_repair_history. This low bound is what enables garbage collection of old system.paxos data when using paxos_state_purging: repaired.

When to use:

  • Clusters using paxos_state_purging: repaired: Operators MUST run --paxos-only repairs regularly (typically hourly) or ensure regular full repairs include the Paxos step. The automatic background repair does NOT advance the low bound, so without coordinated repairs, system.paxos grows unboundedly.
  • Pre-4.1 clusters: Operators MUST schedule --paxos-only repairs manually since the automatic background repair is not available.
  • Before topology changes: Run on all nodes before bootstrap, decommission, replace, or move operations to reduce the risk of Paxos cleanup timeouts.
  • After disabling automatic Paxos repairs: If paxos_repair_enabled is set to false, coordinated Paxos repairs SHOULD be scheduled regularly for clusters using LWTs.
  • Troubleshooting LWT issues: When LWTs are timing out or behaving unexpectedly.

Relationship to automatic background Paxos repair (Cassandra 4.1+):

Cassandra 4.1+ includes an automatic background Paxos repair that runs every 5 minutes (controlled by paxos_repair_enabled). This background repair completes uncommitted transactions but does NOT replace the need for coordinated --paxos-only repairs. See Understanding the Two Paxos Repair Mechanisms for the full distinction.

Operational guidance:

  • Running without a keyspace argument repairs Paxos state for all keyspaces. This is often RECOMMENDED because operators frequently do not know which keyspaces developers are using for LWTs.
  • Paxos repairs are lightweight compared to full data repairs and complete quickly.

For more details on Paxos repair strategy and configuration, see Paxos Repairs in the Repair Strategies guide.

Skips the Paxos repair step during regular repairs, allowing data repair to proceed without checking Paxos state consistency.

Terminal window
# Skip Paxos repair, repair table data only
nodetool repair --skip-paxos my_keyspace

How it relates to --paxos-only:

OptionTable DataPaxos State
(no flag)✓ Repaired✓ Repaired
--paxos-only✗ Skipped✓ Repaired
--skip-paxos✓ Repaired✗ Skipped

When to use:

  • Emergency topology changes: When Paxos cleanup is failing (timing out, CANCELLED) during bootstrap/decommission, you MAY skip Paxos repair temporarily to allow the topology change to proceed
  • Pre-4.1 clusters with manual Paxos repair: If running separate --paxos-only repairs on a schedule, you MAY skip Paxos during regular data repairs to avoid redundant work
  • Troubleshooting: To isolate whether issues are data-related or Paxos-related

Important caveat:

If you use --skip-paxos, Paxos state MUST be reconciled separately via --paxos-only repairs. Skipping Paxos repair without a replacement schedule WILL lead to LWT inconsistencies.

Terminal window
# Data repair only, skip Paxos (use when Paxos repairs are failing)
nodetool repair --skip-paxos my_keyspace
# Then run Paxos repairs separately once cluster is healthy
nodetool repair --paxos-only my_keyspace

Automated Alternative

Managing these options manually across large clusters is error-prone. AxonOps Adaptive Repair automates repair scheduling with intelligent defaults, eliminating the need to manually tune parallelism, scope, and timing options.