diff --git a/raft/progress.go b/raft/progress.go index b06834585..8a1fd9527 100644 --- a/raft/progress.go +++ b/raft/progress.go @@ -59,7 +59,7 @@ type Progress struct { // recentActive is true if the progress is recently active. Receiving any messages // from the corresponding follower indicates the progress is active. // recentActive can be reset to false after an election timeout. - recentActive bool + RecentActive bool // inflights is a sliding window for the inflight messages. // When inflights is full, no more message should be sent. @@ -73,7 +73,7 @@ type Progress struct { func (pr *Progress) resetState(state ProgressStateType) { pr.Paused = false - pr.recentActive = false + pr.RecentActive = false pr.PendingSnapshot = 0 pr.State = state pr.ins.reset() diff --git a/raft/raft.go b/raft/raft.go index a16725915..0fc874be4 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -600,7 +600,7 @@ func stepLeader(r *raft, m pb.Message) { } switch m.Type { case pb.MsgAppResp: - pr.recentActive = true + pr.RecentActive = true if m.Reject { r.logger.Debugf("%x received msgApp rejection(lastindex: %d) from %x for index %d", @@ -635,7 +635,7 @@ func stepLeader(r *raft, m pb.Message) { } } case pb.MsgHeartbeatResp: - pr.recentActive = true + pr.RecentActive = true // free one slot for the full inflights window to allow progress. if pr.State == ProgressStateReplicate && pr.ins.full() { @@ -867,11 +867,11 @@ func (r *raft) checkQuorumActive() bool { continue } - if r.prs[id].recentActive { + if r.prs[id].RecentActive { act += 1 } - r.prs[id].recentActive = false + r.prs[id].RecentActive = false } return act >= r.q()