etcdserver: leader should stepdown when lose quorum for v3

release-2.3
Xiang Li 2016-03-15 23:23:26 -07:00
parent a7f6dc6c0d
commit 2a28ac7ad4
1 changed files with 10 additions and 0 deletions

View File

@ -313,6 +313,11 @@ func startNode(cfg *ServerConfig, cl *cluster, ids []types.ID) (id types.ID, n r
MaxSizePerMsg: maxSizePerMsg,
MaxInflightMsgs: maxInflightMsgs,
}
if cfg.V3demo {
c.CheckQuorum = true
}
n = raft.StartNode(c, peers)
raftStatusMu.Lock()
raftStatus = n.Status
@ -345,6 +350,11 @@ func restartNode(cfg *ServerConfig, snapshot *raftpb.Snapshot) (types.ID, *clust
MaxSizePerMsg: maxSizePerMsg,
MaxInflightMsgs: maxInflightMsgs,
}
if cfg.V3demo {
c.CheckQuorum = true
}
n := raft.RestartNode(c)
raftStatusMu.Lock()
raftStatus = n.Status