Merge pull request #1419 from xiangli-cmu/raft_log_test

raft: add test for findConflict
This commit is contained in:
Xiang Li
2014-10-27 14:30:36 -07:00
3 changed files with 93 additions and 10 deletions

View File

@ -349,8 +349,7 @@ func (r *raft) campaign() {
if i == r.id {
continue
}
lasti := r.raftLog.lastIndex()
r.send(pb.Message{To: i, Type: pb.MsgVote, Index: lasti, LogTerm: r.raftLog.term(lasti)})
r.send(pb.Message{To: i, Type: pb.MsgVote, Index: r.raftLog.lastIndex(), LogTerm: r.raftLog.lastTerm()})
}
}