int FloydImpl::ReplyRequestVote里面有bug么?
peacedog123 opened this issue · 2 comments
peacedog123 commented
注释和论文里面有写:
// if votedfor is null or candidateId, and candidated's log is at least as up-to-date
// as receiver's log, grant vote
但是这个rpc实现逻辑里面,好像完全没有去判断FloydContext内部的vote_for_ip和vote_for_port, 事实是如果一个follower变成candidate后,首先会把vote_for_ip和vote_for_port设置成自己;此时如果收到RequestVoteRPC请求过来,应该直接return false, 表明自己这一轮已经投过票了(投给自己)
不知道我理解的对不对?谢谢
peacedog123 commented
谢谢,pull了最新的代码后发现有了