Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

tarunsundriyal2_179698 avatar image
tarunsundriyal2_179698 asked ·

Why does read-repair always occur when consistency level is ALL?

Sorry for very basic question however in DS201v6 Read Repair Quiz mentions that read repair always occurs when consistency level is set to ALL, If consistency level is set to All then wouldn't all replicas will have latest value of data ?

academyds201quiz
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

@tarunsundriyal2_179698 When performing a read request with consistency level ALL, Cassandra compares the data on all the replicas. If a replica does not have the data, Cassandra writes the most recent version to the replica before returning the result to the client (app/driver).

You are probably thinking of write requests with a CL of ALL. If a write with CL of ALL is marked as successful, it does mean that all replicas are consistent. However, read-repair is an operation which only takes place for read requests, not write requests.

If you're interested, there's further information in Read Repair: repair during read path. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.