An anti-entropy mechanism detects and reconciles differences among replicas in a distributed database. ScyllaDB uses these mechanisms to move the cluster toward eventual consistency after replicas disagree. section 8.4.2 section 8.5
ScyllaDB uses three related mechanisms:
- Repair runs on a node, optionally limited by keyspace, table, or token range. It checksums rows against other replicas and streams updated data when checksums differ. section 8.4.2
- Read repair occurs when a coordinator detects a replica mismatch while serving a read. section 8.5
- Hinted handoff stores copies of writes for an offline node and replays them when that node recovers. section 8.5
An offline replica
Suppose one node goes offline while a write succeeds on other replicas. The offline node misses the write, creating disagreement. A later repair compares row checksums and streams the updated data to the repairing node; hinted handoff can also replay the missed write after recovery. section 8.4.2 section 8.5
Repairs are especially important for deleted rows. If a tombstone is compacted before reaching every replica, the deleted row can be resurrected. Run repairs at least once within gc_grace_seconds, unless the table uses tombstone_gc mode repair, which makes tombstones eligible after repair completes for the row. section 8.4.2
ALTER TABLE ... WITH tombstone_gc = {'mode':'repair'};
Configure tombstone handling so compaction eligibility follows completed repairs rather than the usual gc_grace_seconds timing. section 8.4.2
