From 3171824c069e379cdc7ec8f1c646a6b55061aaa7 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Fri, 26 Jan 2024 15:33:50 +0000 Subject: [PATCH] tracker: remove unused OptimisticUpdate method Signed-off-by: Pavel Kalinnikov --- raft_test.go | 2 +- tracker/progress.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/raft_test.go b/raft_test.go index 5bc6d52e..8d6c5966 100644 --- a/raft_test.go +++ b/raft_test.go @@ -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}) diff --git a/tracker/progress.go b/tracker/progress.go index 7de1ff2d..3e5753ba 100644 --- a/tracker/progress.go +++ b/tracker/progress.go @@ -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.