Skip to content

Commit

Permalink
tracker: remove unused OptimisticUpdate method
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kalinnikov <[email protected]>
  • Loading branch information
pav-kv committed Jan 26, 2024
1 parent cb2762d commit 3171824
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2900,8 +2900,8 @@ func TestRecvMsgUnreachable(t *testing.T) {
r.readMessages()
// set node 2 to state replicate
r.trk.Progress[2].Match = 3
r.trk.Progress[2].Next = 6
r.trk.Progress[2].BecomeReplicate()
r.trk.Progress[2].OptimisticUpdate(5)

r.Step(pb.Message{From: 2, To: 1, Type: pb.MsgUnreachable})

Expand Down
4 changes: 0 additions & 4 deletions tracker/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ func (pr *Progress) MaybeUpdate(n uint64) bool {
return updated
}

// OptimisticUpdate signals that appends all the way up to and including index n
// are in-flight. As a result, Next is increased to n+1.
func (pr *Progress) OptimisticUpdate(n uint64) { pr.Next = n + 1 }

// MaybeDecrTo adjusts the Progress to the receipt of a MsgApp rejection. The
// arguments are the index of the append message rejected by the follower, and
// the hint that we want to decrease to.
Expand Down

0 comments on commit 3171824

Please sign in to comment.