Memo
共 4 条顺序一致性与线性一致性
Zab 保证顺序一致性,Raft 通常提供线性一致性语义。顺序一致性不带真实时间约束,因此读操作在语义上可能返回旧值;线性一致性则要求结果符合现实中的先后顺序。
对于分布式协调服务,单客户端 FIFO 不等于所有客户端都能得到线性一致读。
ZooKeeper 的 sync + read 不保证严格线性一致读
理论上可通过 sync + read 获得线性一致读,但 ZooKeeper 的 sync 实现并未将其作为空写日志复制。leader 直接向 follower 返回 zxid,未像 Raft 的 ReadIndex 或 lease read 一样确认自己仍是 leader。
网络分区或脑裂的边界条件下,这可能返回旧数据。因此它不满足严格的线性一致读语义,尽管该场景罕见且实现上可以修复。
参考:ZooKeeper 论文阅读。
分布式共识资料
How Pipelining consensus writes speeds up distributed SQL transactions
Riemann aggregates events from your servers and applications with a powerful stream processing language
A Swiss Army knife for read-write quorum systems