mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix(scheduler): wrong sort order of instance group selection (#22668)
This commit is contained in:
@@ -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] {
|
||||
|
||||
Reference in New Issue
Block a user