raft: reset votes when becomePreCandidate

This commit is contained in:
gladiator 2017-08-01 22:42:09 +08:00
parent 2951faf770
commit 3740793b42

View File

@ -611,6 +611,7 @@ func (r *raft) becomePreCandidate() {
// but doesn't change anything else. In particular it does not increase
// r.Term or change r.Vote.
r.step = stepCandidate
r.votes = make(map[uint64]bool)
r.tick = r.tickElection
r.state = StatePreCandidate
r.logger.Infof("%x became pre-candidate at term %d", r.id, r.Term)