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.
@@ -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:
