There is no rollback in Cassandra, then how does Cassandra remove failed writes?
Asked Answered
S

1

6

Suppose I have a 2 node cluster with Replication Factor(RF) = 2. I fire an insert with Consistency 2. Cassandra starts to write to these 2 nodes while client is waiting for a response. In between one node fails and could not complete the write, while write on other node succeeded. Client will not get a success message as consistency cannot be met. There is no rollback in Cassandra. So how and when does Cassandra remove the inserted record from that one node or mark it as 'not to be used'?

Related Question: Does Cassandra write to a node(which is up) even if Consistency cannot be met?

Some answered 30/5, 2015 at 8:49 Comment(0)
M
6

It doesn't. Cassandra will try to replicate the data on each write operation and your application will be notified if the consistency level couldn't be met. But Cassandra doesn't rollback writes.

What you probably want to do in such cases is to use a higher CL for your reads as well. E.g. using CL QUORUM will read the data from both nodes and will automatically repair data in case its missing on one of the nodes.

Magnesite answered 1/6, 2015 at 9:46 Comment(2)
While writing, since CL cannot be met, client was informed that the write was not successful. Now client is not expecting that data to be there.Some
In this condition , the client get failed response while the data written successfully ?Epigeous

© 2022 - 2024 — McMap. All rights reserved.