简体   繁体   中英

Cassandra writes consistency, what happens after “transaction” fails?

I didn't get from the documentation what happens after a node fails during writes. I got the idea of quorum but what happens after “the write transaction” fails? For example:

  1. I inserted the record and chose the level of consistency equal to QUORUM.
  2. Assume QUORUM = 3 nodes and 2 of 3, or just 1 of 3 nodes wrote the date but the rest didn't and failed.
  3. I got an error.

What happens with the record on the nodes which wrote it?

How can Casandra prevent propagating this row to other nodes through a replica synchronization?

Or if I get errors on writing it actually means that this row could appear within some time on each replica?

Cassandra doesn't have transactions (except light-weight transactions, that are also different kind of thing). When some node received & written the data, and other not - there is no rollback or something like this. This data is written. But coordinator node sees that consistency level couldn't be reached, and report error back to client application saying about it, so it could be retried if necessary. If it's not retried, then data could be propagated through the repair operations - either read repair, or through explicit repair. But because the data is on a single node, this means that this node mail fail before repair happens, and data could be lost.

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