@@ -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
@@ -261,9 +261,9 @@ func (pr *Progress) MaybeDecrTo(rejected, matchHint uint64) bool {
261
261
func (pr * Progress ) IsPaused () bool {
262
262
switch pr .State {
263
263
case StateProbe :
264
- return pr .MsgAppFlowPaused
264
+ return pr .MsgAppProbesPaused
265
265
case StateReplicate :
266
- return pr .MsgAppFlowPaused && pr .Inflights .Full ()
266
+ return pr .MsgAppProbesPaused && pr .Inflights .Full ()
267
267
case StateSnapshot :
268
268
return true
269
269
default :
@@ -293,7 +293,7 @@ func (pr *Progress) IsPaused() bool {
293
293
func (pr * Progress ) ShouldSendMsgApp (last , commit uint64 ) bool {
294
294
switch pr .State {
295
295
case StateProbe :
296
- return ! pr .MsgAppFlowPaused
296
+ return ! pr .MsgAppProbesPaused
297
297
298
298
case StateReplicate :
299
299
// Send a MsgApp containing the latest commit index if:
@@ -307,14 +307,14 @@ func (pr *Progress) ShouldSendMsgApp(last, commit uint64) bool {
307
307
return false
308
308
}
309
309
// Don't send a MsgApp if we are in a throttled replication state, i.e.
310
- // pr.Inflights.Full() && pr.MsgAppFlowPaused .
310
+ // pr.Inflights.Full() && pr.MsgAppProbesPaused .
311
311
if pr .IsPaused () {
312
312
return false
313
313
}
314
314
// We are here if the follower's log is not up-to-date, and the flow is not
315
315
// paused. We can always send a MsgApp, except when everything is already
316
316
// in-flight, and the last MsgApp was recent.
317
- return pr .Next <= last || ! pr .MsgAppFlowPaused
317
+ return pr .Next <= last || ! pr .MsgAppProbesPaused
318
318
319
319
case StateSnapshot :
320
320
return false
0 commit comments