raft: support quorum check when raft is leader

If quorum check fails, the leader will step down to follower.
This commit is contained in:
Xiang Li
2015-11-23 21:59:25 -08:00
parent b31b946a08
commit a8cc1570d0
8 changed files with 134 additions and 25 deletions

View File

@ -47,7 +47,7 @@ func max(a, b uint64) uint64 {
}
func IsLocalMsg(m pb.Message) bool {
return m.Type == pb.MsgHup || m.Type == pb.MsgBeat || m.Type == pb.MsgUnreachable || m.Type == pb.MsgSnapStatus
return m.Type == pb.MsgHup || m.Type == pb.MsgBeat || m.Type == pb.MsgUnreachable || m.Type == pb.MsgSnapStatus || m.Type == pb.MsgCheckQuorum
}
func IsResponseMsg(m pb.Message) bool {