rm set NoSnapshotRestoreOnStart

This commit is contained in:
Konstantin Lebedev 2022-04-05 18:28:42 +05:00
parent 68f11b9687
commit 0e796a5582

View file

@ -93,7 +93,6 @@ func NewHashicorpRaftServer(option *RaftServerOption) (*RaftServer, error) {
c := raft.DefaultConfig() c := raft.DefaultConfig()
c.LocalID = raft.ServerID(s.serverAddr) // TODO maybee the IP:port address will change c.LocalID = raft.ServerID(s.serverAddr) // TODO maybee the IP:port address will change
c.NoSnapshotRestoreOnStart = option.RaftResumeState
c.HeartbeatTimeout = time.Duration(float64(option.HeartbeatInterval) * (rand.Float64()*0.25 + 1)) c.HeartbeatTimeout = time.Duration(float64(option.HeartbeatInterval) * (rand.Float64()*0.25 + 1))
c.ElectionTimeout = option.ElectionTimeout c.ElectionTimeout = option.ElectionTimeout
if c.LeaderLeaseTimeout > c.HeartbeatTimeout { if c.LeaderLeaseTimeout > c.HeartbeatTimeout {