Skip to content

Commit

Permalink
raft: rename makeP{RS,rogressTracker}
Browse files Browse the repository at this point in the history
  • Loading branch information
tbg committed Jun 7, 2019
1 parent 5a7772d commit 368321e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion raft/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
4 changes: 2 additions & 2 deletions raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1335,7 +1335,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
Expand Down

0 comments on commit 368321e

Please sign in to comment.