如何在cassandra集群上的数据是一致的 [英] How data will be consistent on cassandra cluster
问题描述
我有一个疑问,当我读datastax文件关于cassandra写一致性。我有一个关于cassandra如何在以下情况下保持一致状态的问题:
I have a doubt when i read datastax documentation about cassandra write consistency. I have a question on how cassandra will maintain consistent state on following scenario:
- 写一致性级别= Quorum
- 复制因素= 3
根据文档,当发生写入时,协调器节点将发送此写入请求到簇。如果一个副本成功并且其他副本失败,则协调器节点将向客户端发送错误响应,但节点1成功写入数据,并且不会回滚。
As per docs, When a write occurs coordinator node will send this write request to all replicas in a cluster. If one replica succeed and other fails then coordinator node will send error response back to the client but node-1 successfully written the data and that will not be rolled back.
这种情况下,
读取修复(或提示切换或nodetool修复)将不一致的数据从节点1复制到节点2和节点3?
Will read-repair (or hinted-handoff or nodetool repair) replicate the inconsistent data from node-1 to node-2 and node-3?
如果不是,cassandra会如何处理不能将不一致的数据复制到其他副本?
If not how will cassandra takes care of not replicating inconsistent data to other replicas?
我的问题
推荐答案
你完全正确,读修复或其他方法将更新node-2和node-3。
这意味着即使失败的写入也将最终更新其他节点(如果至少一个成功)。 Cassandra没有关系数据库具有的回滚功能。
You are completely right, the read repair or other methods will update the node-2 and node-3. This means even the failed write will eventually update other nodes (if at least one succeeded). Cassandra doesn't have anything like rollback that relational databases have.
这篇关于如何在cassandra集群上的数据是一致的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!