fix(scheduler): wrong sort order of instance group selection (#22668)

This commit is contained in:
Zexi Li
2025-06-04 14:27:51 +08:00
committed by GitHub
parent 4731240d25
commit 1829838939
+2 -1
View File
@@ -107,7 +107,8 @@ func sortHosts(hosts []*sSchedResultItem, guestInfo *sGuestInfo, isBackup *bool)
}
sortIndexi[1], sortIndexj[1] = hosts[i].Count, hosts[j].Count
sortIndexi[2], sortIndexj[2] = -(hosts[i].minInstanceGroupCapacity(guestInfo.instanceGroupsDetail)), -(hosts[j].minInstanceGroupCapacity(guestInfo.instanceGroupsDetail))
sortIndexi[3], sortIndexj[3] = scoreNormalization(hosts[i].Score, hosts[j].Score)
iScore, jScore := scoreNormalization(hosts[i].Score, hosts[j].Score)
sortIndexi[3], sortIndexj[3] = -iScore, -jScore
sortIndexi[4], sortIndexj[4] = -(hosts[i].Capacity), -(hosts[j].Capacity)
for i := 0; i < 5; i++ {
if sortIndexi[i] == sortIndexj[i] {