raftexample: New joined node have to start with RestartNode

This commit is contained in:
Shintaro Murakami 2021-02-17 16:18:16 +09:00
parent 8d1a8ce044
commit 1b1be43d65

View File

@ -298,14 +298,10 @@ func (rc *raftNode) startRaft() {
MaxUncommittedEntriesSize: 1 << 30,
}
if oldwal {
if oldwal || rc.join {
rc.node = raft.RestartNode(c)
} else {
startPeers := rpeers
if rc.join {
startPeers = nil
}
rc.node = raft.StartNode(c, startPeers)
rc.node = raft.StartNode(c, rpeers)
}
rc.transport = &rafthttp.Transport{