From be28acef068cafb3da2d86248ec3093eac82cbd8 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Fri, 15 Nov 2024 11:09:12 -0800 Subject: [PATCH] Reset backoff in replicate stream attempts only after an ack --- server/follower_cursor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/follower_cursor.go b/server/follower_cursor.go index b6b970fd..7d276428 100644 --- a/server/follower_cursor.go +++ b/server/follower_cursor.go @@ -355,9 +355,6 @@ func (fc *followerCursor) streamEntriesLoop(ctx context.Context, reader wal.Read fc.lastPushed.Store(le.Offset) currentOffset = le.Offset - - // Since we've made progress, we can reset the backoff to initial setting - fc.backoff.Reset() } } @@ -430,5 +427,8 @@ func (fc *followerCursor) receiveAcks(cancel context.CancelFunc, stream proto.Ox fc.cursorAcker.Ack(res.Offset) fc.ackOffset.Store(res.Offset) + + // Since we've made progress, we can reset the backoff to initial setting + fc.backoff.Reset() } }