@@ -96,13 +96,13 @@ type Progress struct {
96
96
// This is always true on the leader.
97
97
RecentActive bool
98
98
99
- // MsgAppFlowPaused is used when the MsgApp flow to a node is throttled. This
99
+ // MsgAppProbesPaused is used when the MsgApp flow to a node is throttled. This
100
100
// happens in StateProbe, or StateReplicate with saturated Inflights. In both
101
101
// cases, we need to continue sending MsgApp once in a while to guarantee
102
- // progress, but we only do so when MsgAppFlowPaused is false (it is reset on
102
+ // progress, but we only do so when MsgAppProbesPaused is false (it is reset on
103
103
// receiving a heartbeat response), to not overflow the receiver. See
104
- // IsPaused().
105
- MsgAppFlowPaused bool
104
+ // IsPaused() and ShouldSendMsgApp() .
105
+ MsgAppProbesPaused bool
106
106
107
107
// Inflights is a sliding window for the inflight messages.
108
108
// Each inflight message contains one or more log entries.
@@ -122,10 +122,10 @@ type Progress struct {
122
122
IsLearner bool
123
123
}
124
124
125
- // ResetState moves the Progress into the specified State, resetting MsgAppFlowPaused ,
125
+ // ResetState moves the Progress into the specified State, resetting MsgAppProbesPaused ,
126
126
// PendingSnapshot, and Inflights.
127
127
func (pr * Progress ) ResetState (state StateType ) {
128
- pr .MsgAppFlowPaused = false
128
+ pr .MsgAppProbesPaused = false
129
129
pr .PendingSnapshot = 0
130
130
pr .State = state
131
131
pr .Inflights .reset ()
@@ -173,7 +173,7 @@ func (pr *Progress) SentEntries(entries int, bytes uint64) {
173
173
pr .Next += uint64 (entries )
174
174
pr .Inflights .Add (pr .Next - 1 , bytes )
175
175
}
176
- pr .MsgAppFlowPaused = true
176
+ pr .MsgAppProbesPaused = true
177
177
}
178
178
179
179
// CanSendEntries returns true if the flow control state allows sending at least
@@ -248,7 +248,7 @@ func (pr *Progress) MaybeDecrTo(rejected, matchHint uint64) bool {
248
248
pr .Next = max (min (rejected , matchHint + 1 ), pr .Match + 1 )
249
249
// Regress the sentCommit since it unlikely has been applied.
250
250
pr .sentCommit = min (pr .sentCommit , pr .Next - 1 )
251
- pr .MsgAppFlowPaused = false
251
+ pr .MsgAppProbesPaused = false
252
252
return true
253
253
}
254
254
@@ -264,9 +264,9 @@ func (pr *Progress) MaybeDecrTo(rejected, matchHint uint64) bool {
264
264
func (pr * Progress ) IsPaused () bool {
265
265
switch pr .State {
266
266
case StateProbe :
267
- return pr .MsgAppFlowPaused
267
+ return pr .MsgAppProbesPaused
268
268
case StateReplicate :
269
- return pr .MsgAppFlowPaused && pr .Inflights .Full ()
269
+ return pr .MsgAppProbesPaused && pr .Inflights .Full ()
270
270
case StateSnapshot :
271
271
return true
272
272
default :
@@ -296,7 +296,7 @@ func (pr *Progress) IsPaused() bool {
296
296
func (pr * Progress ) ShouldSendMsgApp (last , commit uint64 ) bool {
297
297
switch pr .State {
298
298
case StateProbe :
299
- return ! pr .MsgAppFlowPaused
299
+ return ! pr .MsgAppProbesPaused
300
300
301
301
case StateReplicate :
302
302
// If the in-flight limits are not saturated, and there are pending entries
@@ -309,9 +309,9 @@ func (pr *Progress) ShouldSendMsgApp(last, commit uint64) bool {
309
309
// follower eventually will reply with an ack or reject.
310
310
//
311
311
// If the follower's log is outdated, and we haven't recently sent a MsgApp
312
- // (according to the MsgAppFlowPaused flag), send one now. This is going to
313
- // be an empty "probe" MsgApp.
314
- if pr .Match < last && ! pr .MsgAppFlowPaused {
312
+ // (according to the MsgAppProbesPaused flag), send one now. This is going
313
+ // to be an empty "probe" MsgApp.
314
+ if pr .Match < last && ! pr .MsgAppProbesPaused {
315
315
return true
316
316
}
317
317
// Send an empty MsgApp containing the latest commit index if:
0 commit comments