知识卡片
日志新旧限制候选资格
跟随者投票时先比较最后日志项的任期,再在任期相同时比较末尾索引。候选人若落后便不会得到该票。结合多数交集以及提交规则,这把旧提交带入新领导日志,使切换后不必从追随者反向收集缺失的已提交记录。
参见 [[任期标明领导权世代]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 14. Consensus Raft 的日志与提交 · 查看原书依据
A leader can be elected only from the nodes holding all committed entries: if during the election, the follower’s log information is more up-to-date (in other words, has a higher term ID, or a longer log entry sequence, if terms are equal) than the candidate’s, its vote is
参考来源
- 位置:《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#idm46104528956184,段 226)
- 结论依据:本章说明候选日志的末尾任期和长度如何在选举中作比较,以及数据只由领导者复制给追随者。
- 原始内容:A leader can be elected only from the nodes holding all committed entries: if during the election, the follower’s log information is more up-to-date (in other words, has a higher term ID, or a longer log entry sequence, if terms are equal) than the candidate’s, its vote is