I am reading this paper “In Search of an Understandable Consensus Algorithm
(Extended Version)” https://raft.github.io/raft.pdf. In section 5.2 it states that
"While waiting for votes, a candidate may receive an
AppendEntries RPC from another server claiming to be
leader. If the leader’s term (included in its RPC) is at least
as large as the candidate’s current term, then the candidate
recognizes the leader as legitimate and returns to follower
state. If the term in the RPC is smaller than the candidate’s
current term, then the candidate rejects the RPC and continues in candidate state."
So with that in mind, for this three server S1, S2, S3 timeline example:
- All Servers are at Term 1, S1 is the Leader
- S2 becomes intermittently disconnected for sometime
- S2 becomes Candidate for Term 2, attempts to sends RequestVotes (which is not being recieved by others yet)
- While waiting as Candidate for RequestVotes, connectivity is restored.
- S2 gets AppendEntries from S1 which is at Term 1
Questions:
- Does S2 reject AppendEntries from S1 (leader) because it is at older term ?
- Does S1 step down from leader because of AppendEntries got rejected ?
- How does S3 react, does it vote for S2?