Cassandra Repairs
Anti-entropy repair, read repair and hinted handoff — the three mechanisms that converge replicas, and how to schedule the one that matters.
Replicas diverge: a node was down, a write timed out, a network blip dropped a message. Three mechanisms bring them back together, and only one of them is complete.
Hinted Handoff
When a coordinator cannot reach a replica, it stores a hint locally and replays it when the replica returns.
hinted_handoff_enabled: true
max_hint_window_in_ms: 10800000 # 3 hours
hinted_handoff_throttle_in_kb: 1024nodetool statushandoff
nodetool listendpointspendinghintsRead Repair
When a read contacts several replicas and they disagree, the coordinator returns the newest value and writes it back to the stale replicas.
ALTER TABLE shop.events_by_user WITH read_repair = 'BLOCKING';BLOCKING completes the repair before returning the result; NONE disables it. Note that read
repair only fixes data that is read — anything nobody queries stays divergent indefinitely.
Anti-entropy repair
The only mechanism that reconciles everything. Replicas build Merkle trees of their data, compare them, and stream the differing ranges.
# Primary-range repair on one node, one keyspace. Run on every node in turn.
nodetool repair -pr shop
# Full repair of a specific table.
nodetool repair -full shop events_by_user
# Incremental repair marks repaired SSTables so later runs skip them.
nodetool repair shopRepair cadence
For clusters of any size, use a scheduler rather than cron loops: Cassandra Reaper is the common choice, and it handles segmentation, retries, concurrency limits and progress tracking.
Which repair type
After a node replacement
A replaced node bootstraps its data from replicas, but any range where the replicas themselves disagree stays divergent. Run a full repair on the new node once bootstrap completes, and confirm it finished rather than assuming.