From 6419b70ffe076e261526fdde5da6279fe9591be6 Mon Sep 17 00:00:00 2001 From: Phan Le Date: Tue, 28 May 2024 15:23:08 -0700 Subject: [PATCH] Fix bug the engine might choose a replica with a smaller head size to be the source of truth for auto-salvage longhorn-8659 longhorn-8563 Signed-off-by: Phan Le --- pkg/controller/control.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/control.go b/pkg/controller/control.go index 0e0a6d1ef..e60c11590 100644 --- a/pkg/controller/control.go +++ b/pkg/controller/control.go @@ -646,8 +646,9 @@ func (c *Controller) salvageRevisionCounterDisabledReplicas() error { // Any replica within 5 seconds before lastModifyTime // can be good replica. if t.Add(lastModifyCheckPeriod).After(lastTime) { - if salvageReplica.HeadFileSize >= largestSize { + if salvageReplica.HeadFileSize > largestSize { bestCandidate = r + largestSize = salvageReplica.HeadFileSize } } }