Closed cjmld5 closed 3 years ago
I don't think so. It's been a while, but I just opened the Raft paper to check and I think your proposed change doesn't correctly follow the algorithm.
You can refer to Figure 2 in the paper for a summary of the RequestVote receiver implementation, or read §5.2 for more context.
Receiver implementation:
- Reply false if term < currentTerm (§5.1)
- If votedFor is null or candidateId, and candidate’s log is at least as up-to-date as receiver’s log, grant vote (§5.2, §5.4)
in RequestVote method,should we compare with term > CurrentTerm and vote true?