Assume I have a 2 node cluster with Replication Factor of 2
- A write is initiated with Consistency 2
- One node completes the write and another node fails just before completing the write.
- Client receives failed response as consistency level cannot be met
- Another client reads the same row with consistency 2
- One node has latest data (failed record) and other node has old data so read repair is initiated
Q1. During read repair, will Cassandra discard the failed write even though it has the latest timestamp or will it propagate the value written during failed write at step 2 above as it is the value with latest timestamp?
Q2. what is outcome during read repair, if we replace the steps 1 to 3 with a write of consistency 1 and successful write? How read repair differentiates this from the partially failed write?
The text below is from datastax documention
https://docs.datastax.com/en/ddac/doc/datastax_enterprise/dbInternals/dbIntTransactionsDiffer.html
For example, if using a write consistency level of QUORUM with a replication factor of three, the database replicates the write to all nodes in the cluster and waits for acknowledgement from two nodes. If the write fails on one node but succeeds on another node, Cassandra reports a failure to replicate the write on that node, but the replicated write that succeeds on the other node is not automatically rolled back.
Cassandra uses client-side timestamps to determine the most recent update to a column. The latest timestamp always wins when requesting data, so if multiple client sessions update the same columns in a row concurrently, the most recent update is the one seen by readers