liveBook · Manning

Anti-entropy mechanism

As explained in ScyllaDB in Action

An anti-entropy mechanism is a distributed-database process that detects and reconciles differences among replicas.

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

How ScyllaDB in Action covers it

How deep it goes
Explains repair checksums, row streaming, read repair, hinted handoff, and tombstone timing, but not their internal algorithms.
Examples
Uses an offline node, row checksums, streamed updates, replayed writes, and tombstone compaction as concrete cases.
What it assumes
Assumes replica storage, consistency requirements, tombstones, and compaction are familiar enough to explain replica disagreement.
What you can do after
Operate/configure repairs and tombstone handling to reconcile replicas and reduce deletion-related data resurrection.
How it connects
Connects replicas, eventual consistency, tombstones, compaction, read repair, hinted handoff, and node recovery.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.