在“Designing Data-Intensive Applications - CHAPTER 5 Replication - Leaderless Replication - Limitations of Quorum Consistency”中,它说:
However, even with w + r > n, there are likely to be edge cases where stale values are returned. These depend on the implementation, but possible scenarios include:
- ...
- If a write succeeded on some replicas but failed on others (for example because the disks on some nodes are full), and overall succeeded on fewer than w replicas, it is not rolled back on the replicas where it succeeded. This means that if a write was reported as failed, subsequent reads may or may not return the value from that write.
- ...
它说后续的读可能会返回写入失败的值,是类似下面这样的情况吗?
假设 n 为 5,w 和 r 都是 3 。键 k 的初始化值为 1 。
client 1 执行 set k = k + 1 写,这个写只在两个副本( replica 1 和 replica 2 )成功,所以是失败的。
client 2 读取键 k 的值,它在 replica 1 和 replica 2 中读取到 2,而在 replica 3 读取到 1,所以 client 2 会被告知键 k 的值为 2 。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.