简体   繁体   中英

Cassandra Read Consistency when write path fail

I am new to cassandra and trying to figure out how cassandra provides consistency in case of failed writes. Consider following scenario where CL is QUORUM, in which case 2 out of 3 replicas must respond. Write request will go to all 3 replica as usual, if write to 2 replica fails, and succeeds on 1 replica, cassandra will return Failed. Since cassandra does not rollback, the record will continue to exist on successful replica. Now, when the read come with CL=QUORUM,the read request will be forwarded to 2 replica node and if one of the replica node is the previously successful one then cassandra will return the new records as it will have latest timestamp. But from client perspective this record was not written at all as cassandra had returned failure during write. If this is the case then cassandra will never be consistent in this scenario. How to handle such scenario Please let me know if this understanding is correct.

Your understanding is correct. The client in this case should receive UnavailableException , but should understand that the write will eventually propagate to the other replicas (if the nodes are alive or come alive), and that this is not a failed write.

For more details see the following articles:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM