raft/doc: clarify the case of out of date term

Clarify the doc.

Fixes #10491
This commit is contained in:
Sahdev P. Zala
2019-03-25 20:12:04 -04:00
committed by Sam Batschelet
parent 7a5acb4a43
commit 56f1bce161

View File

@@ -947,9 +947,9 @@ func (r *raft) Step(m pb.Message) error {
r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] cast %s for %x [logterm: %d, index: %d] at term %d",
r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), r.Vote, m.Type, m.From, m.LogTerm, m.Index, r.Term)
// When responding to Msg{Pre,}Vote messages we include the term
// from the message, not the local term. To see why consider the
// from the message, not the local term. To see why, consider the
// case where a single node was previously partitioned away and
// it's local term is now of date. If we include the local term
// it's local term is now out of date. If we include the local term
// (recall that for pre-votes we don't update the local term), the
// (pre-)campaigning node on the other end will proceed to ignore
// the message (it ignores all out of date messages).