If not in bootstrap mode, clear the raft peerset

This commit is contained in:
Armon Dadgar 2014-02-21 15:21:27 -08:00
parent 5d8783148b
commit 5e790b02a9
1 changed files with 4 additions and 0 deletions

View File

@ -230,6 +230,10 @@ func (s *Server) setupRaft() error {
if !raft.PeerContained(peers, trans.LocalAddr()) {
s.raftPeers.SetPeers(raft.AddUniquePeer(peers, trans.LocalAddr()))
}
} else {
// If we are not in bootstrap mode, start with no peers, wait for the
// existing leader to replicate to us and set the peer set
s.raftPeers.SetPeers([]net.Addr{})
}
// Make sure we set the LogOutput