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 30, 2024
1 parent 40a19f1 commit c55352f
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 @@ -2901,7 +2901,7 @@ func TestRecvMsgUnreachable(t *testing.T) {
// set node 2 to state replicate
r.trk.Progress[2].Match = 3
r.trk.Progress[2].BecomeReplicate()
r.trk.Progress[2].OptimisticUpdate(5)
r.trk.Progress[2].Next = 6

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 @@ -190,10 +190,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 c55352f

Please sign in to comment.