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

领导人选举以及投票环节的小疑问 #44

Open
jingjun-xiao opened this issue Sep 14, 2021 · 0 comments
Open

领导人选举以及投票环节的小疑问 #44

jingjun-xiao opened this issue Sep 14, 2021 · 0 comments

Comments

@jingjun-xiao
Copy link

刚学共识的小白,看了你的代码收益颇丰。不过还有些疑问,望解答:
1.为什么代码要使用pre-vote/vote二阶段实现?为什么这样就可以保证节点断网后,不会不断增加term发起投票?因为我看论文里好像并不需要两阶段,直接最先超时节点就成为了Candidate就可以开始邀票了。
2.如果两个候选人同时超时,那传入PreVoteResponseCallback的response到底应该是那个候选人呢?代码里如何解决两个候选人同时超时的问题呢?
3.Follower节点进行投票,不是应该只能为Term比自己大的,或者索引值比自己长的投票,那具体这个投票规则(索引值比自己长的投票),在代码的哪里实现了呢?

小low low十分疑惑,还望作者解答~

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

1 participant