← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 10408.e.1.a.1.a · 生成模型:未记录

从共同前缀修复副本

理解等级:高级

新的领导者发送日志时附上前一条的索引和任期。追随者若不匹配就拒绝,领导反向寻找最近的共同前缀,再把未提交冲突尾部替换为自己日志中的条目。相同索引及任期对应相同命令和前缀。依靠这个条件,正常重发不该重复追加。

参见 [[当前任期推动提交前缀]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Database Internals》Chapter 14. Consensus(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch14.html#idm46104528955304,段 245) - 结论依据:故障例子用共同位置解释落后追随者丢弃未提交尾部,同时明确领导者只追加自己的日志。 - 原始内容:For failure detection, the leader has to send heartbeats to the followers. This way, the leader maintains its term. When one of the nodes notices that the current leader is down, it attempts to initiate the election. The newly elected leader has to restore the state of the