Hi everybody! I'm trying to implement raft for a Distributed System project, and I find
AMAZING the
Raft Paper: it's clear, it's simple, and there that fantastic condensed summary about the Raft algorithm which is extremely useful for a Raft implementation!
However, I think that there could be an error in Figure 2 (the condensed summary indeed) in Request Vote RPC part, in particular:
Receiver implementation:
1. Reply false if term < currentTerm (§5.1)
2. 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)
I think that this is wrong, since if the currentTerm was updated (so term>currentTerm) the follower will grant its vote, even if he voted previously for a different candidate. I simulated it through
Raft Visualization and I could have seen that I'm right.
Do you think that am I missing something or I am actually right?
Thanks so much and thanks for your replies!