node: Keep order for equal elements when sort priority metrics #1528

Merged
fyrchik merged 2 commits from acid-ant/frostfs-node:bugfix/priority-metrics into master 2024-12-02 11:35:06 +00:00
Showing only changes of commit edfa3f4825 - Show all commits

View file

@ -202,7 +202,7 @@ func sortVector(cfg *cfg, unsortedVector []netmap.NodeInfo) ([]netmap.NodeInfo,
metrics: m,
}
}
slices.SortFunc(nm, func(a, b nodeMetrics) int {
slices.SortStableFunc(nm, func(a, b nodeMetrics) int {
return slices.Compare(a.metrics, b.metrics)
})
sortedVector := make([]netmap.NodeInfo, len(unsortedVector))