Skip to content

Commit

Permalink
Fix bug the engine might choose a replica with a smaller head size to be
Browse files Browse the repository at this point in the history
the source of truth for auto-salvage

longhorn-8659

longhorn-8563

Signed-off-by: Phan Le <[email protected]>
  • Loading branch information
PhanLe1010 committed May 28, 2024
1 parent e39b7f0 commit 6419b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 6419b70

Please sign in to comment.