Skip to content

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

Cassandra Repair Scheduling Guide

This page provides guidance on planning repair schedules to ensure completion within gc_grace_seconds, avoiding zombie data resurrection while minimizing operational impact.

Every repair schedule must satisfy one fundamental requirement: all nodes must complete repair within gc_grace_seconds.

gc_grace_seconds Timelinegc_grace_seconds TimelineSafe Zone (Day 1-7)Warning Zone (Day 8-9)Danger Zone (Day 10+)Repair shouldcomplete hereRisk increasingTombstonesGC eligibleDefault gc_grace_seconds = 10 days (864000 seconds)After this, tombstones can be garbage collected
Zombie Data Resurrection ScenarioZombie Data Resurrection ScenarioNode ANode BNode CNode ANode ANode BNode BNode C(DOWN)Node C(DOWN)T=0: DELETE row XCreate tombstoneReplicate tombstoneNode C is downT=10 days: gc_grace_seconds expiresGC tombstoneGC tombstoneNode C recoversStill has row X(no tombstone)ZOMBIE DATA!Row X was deleted butnow exists again on Node C

Prevention: Complete repair on all nodes before gc_grace_seconds expires. This propagates tombstones to all replicas before they’re garbage collected.


VariableDescriptionExample
NNumber of nodes12
TTime to repair one node4 hours
RFReplication factor3
Ggc_grace_seconds864000 (10 days)
BDesired buffer time2 days
Total repair cycle = N × T
Available time = G - B
Constraint: N × T ≤ G - B
Example:
- 12 nodes × 4 hours = 48 hours
- gc_grace = 10 days - 2 day buffer = 8 days available
- 48 hours << 8 days ✓ (plenty of margin)
Total repair cycle = (N ÷ RF) × T
Example:
- 12 nodes ÷ 3 RF = 4 rounds
- 4 rounds × 4 hours = 16 hours
- 4x faster than sequential
Repair Timeline for 100-Node ClusterRepair Timeline for 100-Node Clustergc_grace_seconds: 10 daysBuffer: 2 daysAvailable: 8 days100 nodes ÷ 8 days = 12.5 nodes/day required With 4 hours per node:- Sequential: 12.5 × 4 = 50 hours/day (IMPOSSIBLE)- Parallel (RF=3): 12.5 × 4 ÷ 3 = 16.7 hours/day- With 6 parallel groups: ~8 hours/day (FEASIBLE)

Before planning a schedule, measure the actual repair duration on a representative node:

Terminal window
nodetool repair -pr my_keyspace

Record the duration from start to completion. This varies significantly based on data volume, disk speed, and network bandwidth.

StrategyFormulaExample (12 nodes, 4 hrs/node, RF=3)
SequentialNodes × Time per node12 × 4 = 48 hours
Parallel(Nodes ÷ RF) × Time per node(12 ÷ 3) × 4 = 16 hours

Ensure the total cycle time plus a 2-day buffer fits within gc_grace_seconds.

Recommended repair schedules by cluster sizeRecommended repair schedules by cluster sizeSmall Cluster (3-6 nodes)Medium Cluster (6-20 nodes)Large Cluster (20-50 nodes)Very Large Cluster (50+ nodes)Strategy: SequentialFrequency: WeeklyDay: Sunday 02:00Duration: < 24 hoursStrategy: Parallel or SequentialFrequency: Every 3-5 daysDays: Rotate through weekDuration: 24-48 hoursStrategy: Parallel with segmentsFrequency: Every 2-3 daysDays: Continuous rotationDuration: 48-72 hoursStrategy: ContinuousFrequency: Always runningDays: 24/7 operationTool: AxonOps or Reaper

ScenarioRecommended gc_grace_seconds
Very large cluster, slow repairsIncrease (14-21 days)
Fast SSDs, quick repairsKeep default (10 days)
High delete rate, storage concernsDecrease (7 days) with faster repairs
Frequently offline nodesIncrease significantly
-- Check current value
SELECT gc_grace_seconds FROM system_schema.tables
WHERE keyspace_name = 'my_keyspace' AND table_name = 'my_table';
-- Modify per table
ALTER TABLE my_keyspace.my_table
WITH gc_grace_seconds = 1209600; -- 14 days
-- Verify change
DESCRIBE TABLE my_keyspace.my_table;

Warning: Reducing gc_grace_seconds requires faster repair cycles. Ensure repair can complete within the new window before making changes.


Traffic Pattern and Repair WindowsTraffic Pattern and Repair WindowsLow Traffic (22:00-06:00)Medium Traffic (06:00-09:00, 18:00-22:00)High Traffic (09:00-18:00)Ideal repair windowAvoid if possibleDo not run repairs

For manual scheduling, stagger repairs across the week so only one node repairs at a time:

NodeDayTime (UTC)
Node 1Sunday02:00
Node 2Monday02:00
Node 3Tuesday02:00
Node 4Wednesday02:00
Node 5Thursday02:00
Node 6Friday02:00

Use cron or systemd timers to automate execution. For clusters larger than 6 nodes, or where manual scheduling becomes error-prone, consider using AxonOps to automate repair scheduling with adaptive timing and failure handling.

Operations that should NOT run concurrently with repair:

OperationReason
Major compactionCompetes for disk I/O
BackupNetwork and disk contention
Schema changesCan interfere with repair validation
Node addition/removalTopology changes invalidate ranges
Bulk loadingHigh write load

Monitor repair completion using:

MethodCommand/Source
System logsSearch for “Repair completed” in system.log
Metricspercent_repaired metric per table
nodetoolnodetool tablestats my_keyspace shows percent repaired

Configure alerts based on time since last successful repair:

ThresholdConditionAction
Warning> 70% of gc_grace_secondsInvestigate, schedule makeup repair
Critical> 90% of gc_grace_secondsImmediate action required

AxonOps provides built-in repair compliance tracking with dashboards showing repair status across all nodes and automatic alerting when repairs fall behind schedule.


Repair failure response branching on remaining time before gc_grace_secondsRepair failure response branching on remaining time before gc_grace_secondsThis syntax is deprecated, you must add <<#FF6347>> at the end of the line, after the ';'Repair fails on node XTime to gc_grace < 2 days?yesnoCRITICAL - Immediate actionInvestigate and fix root causeRetry repair immediatelyRetry succeeds?yesnoResume normal scheduleEscalate - manual interventionConsider full repair (-full)Investigate failure causeTransient issue?yesnoWait for next scheduled slotMonitor closelyFix underlying issueSchedule makeup repair

When normal repair windows are unavailable:

  1. Calculate remaining time: Determine days until gc_grace_seconds deadline
  2. Identify alternative windows: Find off-peak periods even if non-standard
  3. Adjust parallelism: Use parallel strategy to compress timeline
  4. Communicate: Notify team of temporary schedule change
  5. Resume normal: Return to standard schedule once resolved

Manual repair scheduling becomes increasingly difficult as clusters grow. AxonOps Adaptive Repair offers two approaches to automated repair:

Configure repair to run at specific times with:

  • Automatic distribution across nodes
  • Configurable parallelism and throttling
  • Failure detection and retry
  • Compliance tracking against gc_grace_seconds

Continuously monitors cluster state and adjusts repair execution based on:

  • Current cluster load and latency
  • Time remaining until gc_grace_seconds deadline
  • Node health and availability
  • Repair progress across the cluster

Adaptive repair automatically throttles during high-traffic periods and accelerates when the cluster is idle, ensuring repairs complete on time without impacting production workloads.

AspectManualAxonOps
Schedule calculationManual spreadsheetsAutomatic
Failure handlingManual interventionAuto-retry
Load awarenessFixed schedulesDynamic throttling
Compliance trackingLog parsingBuilt-in dashboards
Multi-clusterPer-cluster setupCentralized management

NodesRF=3 SequentialRF=3 ParallelRecommendation
31x per week1x per weekWeekly
61x per week1x per weekWeekly
122x per week1x per weekEvery 3-4 days
243x per week2x per weekEvery 2-3 days
50Daily3x per weekEvery 2 days
100+ContinuousDailyContinuous
  • Current repair duration measured per node
  • Total cycle time calculated
  • Buffer time included (minimum 2 days)
  • Off-peak windows identified
  • Conflict operations scheduled around repair
  • Alerting configured for missed repairs
  • Runbook updated with new schedule