@@ -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,7 +122,7 @@ 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
128
pr .PauseMsgAppProbes (false )
@@ -179,7 +179,7 @@ func (pr *Progress) SentEntries(entries int, bytes uint64) {
179
179
// PauseMsgAppProbes pauses or unpauses empty MsgApp messages flow, depending on
180
180
// the passed-in bool.
181
181
func (pr * Progress ) PauseMsgAppProbes (pause bool ) {
182
- pr .MsgAppFlowPaused = pause
182
+ pr .MsgAppProbesPaused = pause
183
183
}
184
184
185
185
// CanSendEntries returns true if the flow control state allows sending at least
@@ -267,9 +267,9 @@ func (pr *Progress) MaybeDecrTo(rejected, matchHint uint64) bool {
267
267
func (pr * Progress ) IsPaused () bool {
268
268
switch pr .State {
269
269
case StateProbe :
270
- return pr .MsgAppFlowPaused
270
+ return pr .MsgAppProbesPaused
271
271
case StateReplicate :
272
- return pr .MsgAppFlowPaused && pr .Inflights .Full ()
272
+ return pr .MsgAppProbesPaused && pr .Inflights .Full ()
273
273
case StateSnapshot :
274
274
return true
275
275
default :
@@ -299,7 +299,7 @@ func (pr *Progress) IsPaused() bool {
299
299
func (pr * Progress ) ShouldSendMsgApp (last , commit uint64 ) bool {
300
300
switch pr .State {
301
301
case StateProbe :
302
- return ! pr .MsgAppFlowPaused
302
+ return ! pr .MsgAppProbesPaused
303
303
case StateReplicate :
304
304
// Send a MsgApp containing the latest commit index if:
305
305
// - our commit index exceeds the in-flight commit index, and
@@ -312,14 +312,14 @@ func (pr *Progress) ShouldSendMsgApp(last, commit uint64) bool {
312
312
return false
313
313
}
314
314
// Don't send a MsgApp if we are in a throttled replication state, i.e.
315
- // pr.Inflights.Full() && pr.MsgAppFlowPaused .
315
+ // pr.Inflights.Full() && pr.MsgAppProbesPaused .
316
316
if pr .IsPaused () {
317
317
return false
318
318
}
319
319
// We are here if the follower's log is not up-to-date, and the flow is not
320
320
// paused We can always send a MsgApp, except when everything is already
321
321
// in-flight, and the last MsgApp was recent.
322
- return pr .Next <= last || ! pr .MsgAppFlowPaused
322
+ return pr .Next <= last || ! pr .MsgAppProbesPaused
323
323
324
324
case StateSnapshot :
325
325
return false
0 commit comments