Read Repair: repair during read path

When a read query encounters inconsistent results at a consistency level greater than ONE or LOCAL_ONE, DSE initiates a read repair. Such read repairs run in the foreground and block application operations until the repair process is complete.

Read queries with a consistency level of ONE or LOCAL_ONE do not block application operations since a data mismatch must exist to trigger the read repair, and, since only one replicas is queried, no comparison occurs, therefore no mismatch.

In more detail:

  1. The coordinator node asks one replica for data and the others for a digest of their data.

  2. If there is a mismatch in the data returned to the coordinator from the replicas, a read is requested from all replicas involved in the query (dictated by the consistency level) and the results are merged.

  3. If a single replica doesn’t have all of the latest data for each column, a new record is assembled by mixing and matching columns from different replicas.

  4. After determining the latest version, the record is written back to only the replicas involved in the request.

For example, in the case of a LOCAL_QUORUM read with a replication factor of three, two replicas are queried, so only those two replicas are repaired.

Read repair does not propagate expired tombstones, nor does it consider expired tombstones when actually repairing data. That means that if there is tombstoned data that has not been propagated to all replica nodes before gc_grace_seconds has expired, that data may continue to be returned as live data.

For a description of how the database handles inconsistency among replicas, see How are read requests accomplished?.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com