mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: rename makeP{RS,rogressTracker}
This commit is contained in:
parent
3def2364e4
commit
0384c587eb
@ -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{},
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user