raft: rename makeP{RS,rogressTracker}

This commit is contained in:
Tobias Schottdorf 2019-06-03 14:23:04 +02:00
parent 3def2364e4
commit 0384c587eb
2 changed files with 3 additions and 3 deletions

View File

@ -301,7 +301,7 @@ type progressTracker struct {
matchBuf uint64Slice
}
func makePRS(maxInflight int) progressTracker {
func makeProgressTracker(maxInflight int) progressTracker {
p := progressTracker{
maxInflight: maxInflight,
prs: map[uint64]*Progress{},

View File

@ -343,7 +343,7 @@ func newRaft(c *Config) *raft {
raftLog: raftlog,
maxMsgSize: c.MaxSizePerMsg,
maxUncommittedSize: c.MaxUncommittedEntriesSize,
prs: makePRS(c.MaxInflightMsgs),
prs: makeProgressTracker(c.MaxInflightMsgs),
electionTimeout: c.ElectionTick,
heartbeatTimeout: c.HeartbeatTick,
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.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.Learners, true)
return true