fix(shell): compare fractional evacuation destination ratios (#11752)

This commit is contained in:
Robin Tweedie authored and GitHub committed 2026-10-15 06:36:37 -07:00
1 parent 9e56651808
commit e12ec94747
2 files changed
+18 -1

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
package shell
import (
"cmp"
"flag"
"fmt"
"io"
@@ -273,7 +274,7 @@ func moveAwayOneNormalVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][
}
// most empty one is in the front
slices.SortFunc(otherNodes, func(a, b *Node) int {
return int(a.localVolumeRatio(maxVolumeCountFn) - b.localVolumeRatio(maxVolumeCountFn))
return cmp.Compare(a.localVolumeRatio(maxVolumeCountFn), b.localVolumeRatio(maxVolumeCountFn))
})
for i := 0; i < len(otherNodes); i++ {
emptyNode := otherNodes[i]