Skip to content

Commit

Permalink
Fixed a case in progress.go maybe_decr_to that could cause the next v…
Browse files Browse the repository at this point in the history
…alue to be less than or equal to the match value in the probe state

Signed-off-by: wego1236 <844740374@qq.com>
  • Loading branch information
wego1236 committed Nov 14, 2024
1 parent 63aec46 commit d856547
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tracker/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ impl Progress {
// Do not decrease next index if it's requesting snapshot.
if request_snapshot == INVALID_INDEX {
self.next_idx = cmp::min(rejected, match_hint + 1);
if self.next_idx < 1 {
self.next_idx = 1;
if self.next_idx < self.matched + 1 {
self.next_idx = self.matched + 1;
}
} else if self.pending_request_snapshot == INVALID_INDEX {
// Allow requesting snapshot even if it's not Replicate.
Expand Down

0 comments on commit d856547

Please sign in to comment.