Database / Apache Cassandra Intermediate and Advanced interview questions
What is read repair in Cassandra?
Read repair fixes inconsistent replicas as a side effect of normal read traffic, rather than waiting for a scheduled repair job.
- When a coordinator queries multiple replicas to satisfy the consistency level, it compares the responses.
- If the replicas disagree, the coordinator identifies the most recent value (by timestamp) and sends it to the out-of-date replicas.
- Modern Cassandra performs this automatically for any read that touches more than one replica, correcting divergence discovered along the way.
There is also full read repair, historically tunable via a per-table read_repair_chance, which queried additional replicas beyond what the consistency level required purely to catch inconsistencies at a low background probability. That knob has been deprecated/removed in newer versions in favor of always reconciling whatever replicas were already contacted.
Read repair is a helpful complement to scheduled anti-entropy repair, but it's opportunistic: it only fixes divergence for rows that are actually read. Cold data that's rarely queried can still drift and needs periodic nodetool repair to stay in sync.
More Related questions...