For example,if using a write consistency level of QUORUM with a replication factor of 3,Cassandra will replicate the write to all nodes in the cluster and wait for acknowledgement from two nodes. If the write fails on one of the nodes but succeeds on the other,Cassandra reports a failure to replicate the write on that node. However,the replicated write that succeeds on the other node is not automatically rolled back.
因此,写请求被发送到3个节点,我们正在等待2个ACK.假设我们只收到1个ACK(超时前).所以很清楚,如果我们以一致性ONE读取,我们可以读取该值,好的.
但以下哪一项陈述也属实:
>可能会发生写入已持久存储在第二个节点上,但节点的ACK丢失了? (注意:即使读取一致性QUORUM,也可能导致读取值!)
>可能会发生写入稍后会持续到第二个节点(例如由于提示切换)? (注意:即使读取一致性QUORUM,也可能导致读取值!)
>写入是否存在于第二个节点上是不可能的,写入的值最终将通过ReadRepair从节点中删除?
>不可能,写入持久存储在第二个节点上,但是有必要执行手动“撤消”操作吗?
解决方法
Cassandra唯一一次写入失败的原因是当协调器收到请求时,只有很少的副本存活,即它不能满足一致性级别.否则你的第二个陈述是正确的.它将暗示失败的节点(副本)将需要复制此行.
本文介绍了不同的故障情况.
http://www.datastax.com/dev/blog/how-cassandra-deals-with-replica-failure