Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

书中84页的“另一种情况是,多个节点以不同的term启动,选举超时后.....,此时仍旧会比较日志” #26

Open
regrlomon opened this issue Jan 15, 2022 · 1 comment

Comments

@regrlomon
Copy link

这里描述的不是term一致的情况吗,为什么多个节点以不同term启动,candidate角色发送消息到比自己term大的follower角色中,此时还会比较日志来决定是否投票?

@haveTryTwo
Copy link

作者这里应该是想表达收到的请求term是一致的一种场景:

  1. 多个节点以不同的term启动,本系统的设计中会将term保存到文件中,当节点再次启动会从文件读取,这样就会可能出不一致的term;
  2. 此外,candidate角色发送消息到比自己term大follower角色,这里是指当前状态,因为选举请求会将term+1,这样就可以follower角色的term一致,从而进入到term一致场景的投票判断

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants