mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: document why reuse candidate's term for vote response in stepCandidate
"stepCandidate" should reuse candidate's own term, not term in Message, because pre-vote is requested with future term. Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
@@ -1148,6 +1148,8 @@ func stepCandidate(r *raft, m pb.Message) error {
|
||||
r.bcastAppend()
|
||||
}
|
||||
case len(r.votes) - gr:
|
||||
// pb.MsgPreVoteResp contains future term of pre-candidate
|
||||
// m.Term > r.Term; reuse r.Term
|
||||
r.becomeFollower(r.Term, None)
|
||||
}
|
||||
case pb.MsgTimeoutNow:
|
||||
|
||||
Reference in New Issue
Block a user