From 368321e40594d821fbf74fb0b696660990172962 Mon Sep 17 00:00:00 2001 From: Tobias Schottdorf Date: Mon, 3 Jun 2019 14:23:04 +0200 Subject: [PATCH] raft: rename makeP{RS,rogressTracker} --- raft/progress.go | 2 +- raft/raft.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/raft/progress.go b/raft/progress.go index fc4afb2bb0ae..b0bd817a9c95 100644 --- a/raft/progress.go +++ b/raft/progress.go @@ -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{}, diff --git a/raft/raft.go b/raft/raft.go index 4619a53d06f5..3372134ae992 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -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, @@ -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