|
@@ -343,7 +343,7 @@ func newRaft(c *Config) *raft {
|
|
|
raftLog: raftlog,
|
|
raftLog: raftlog,
|
|
|
maxMsgSize: c.MaxSizePerMsg,
|
|
maxMsgSize: c.MaxSizePerMsg,
|
|
|
maxUncommittedSize: c.MaxUncommittedEntriesSize,
|
|
maxUncommittedSize: c.MaxUncommittedEntriesSize,
|
|
|
- prs: makePRS(c.MaxInflightMsgs),
|
|
|
|
|
|
|
+ prs: makeProgressTracker(c.MaxInflightMsgs),
|
|
|
electionTimeout: c.ElectionTick,
|
|
electionTimeout: c.ElectionTick,
|
|
|
heartbeatTimeout: c.HeartbeatTick,
|
|
heartbeatTimeout: c.HeartbeatTick,
|
|
|
logger: c.Logger,
|
|
logger: c.Logger,
|
|
@@ -1346,7 +1346,7 @@ func (r *raft) restore(s pb.Snapshot) bool {
|
|
|
r.id, r.raftLog.committed, r.raftLog.lastIndex(), r.raftLog.lastTerm(), s.Metadata.Index, s.Metadata.Term)
|
|
r.id, r.raftLog.committed, r.raftLog.lastIndex(), r.raftLog.lastTerm(), s.Metadata.Index, s.Metadata.Term)
|
|
|
|
|
|
|
|
r.raftLog.restore(s)
|
|
r.raftLog.restore(s)
|
|
|
- r.prs = makePRS(r.prs.maxInflight)
|
|
|
|
|
|
|
+ r.prs = makeProgressTracker(r.prs.maxInflight)
|
|
|
r.restoreNode(s.Metadata.ConfState.Nodes, false)
|
|
r.restoreNode(s.Metadata.ConfState.Nodes, false)
|
|
|
r.restoreNode(s.Metadata.ConfState.Learners, true)
|
|
r.restoreNode(s.Metadata.ConfState.Learners, true)
|
|
|
return true
|
|
return true
|