加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

卡桑德拉的原子性和“回滚”

发布时间:2020-12-13 13:29:32 所属栏目:百科 来源:网络整理
导读:Cassandra 2.0 documentation包含关于原子性的以下段落: 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
Cassandra 2.0 documentation包含关于原子性的以下段落:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读