-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change scheduler logic from random to round-robin #22430
Conversation
Labelling this PR as size/S |
0389ead
to
38e5c7b
Compare
I'm thinking if we shouldn't sort the priority list alphabetically. |
We definitely should do some sorting, because for maps which we are processing in the meantime, we have exaclty no guarantees... |
Yeah I think this only works if (BTW I didn't understand @wojtek-t 's comment about "maps we are processing in the meantime") |
Sorry - I meant that in the meantime we have maps, and iterating over a map (to generate a slice) is random, so the order is also random. But yeah - the underlying comment is what @davidopp wrote right above, which is currently not true, but adding sorting will solve this issue. |
Labelling this PR as size/M |
idx = append(idx, i) | ||
} | ||
} | ||
lastMaxScoreIndes := sort.Search(len(priorityList), func(i int) bool { return priorityList[i].Score < maxScore }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear, it's not "lastMaxScoreIndex", but "firstNonMaxScoreIndex"
we should be explicit about this
One comment from me - other than that LGTM |
GCE e2e build/test passed for commit 052886161e095dbb63358c96f9aca5fcdf37f016. |
GCE e2e build/test passed for commit 413673f6213b579f9fbc0660f0b51cfa2f59adbf. |
LGTM @davidopp - can you please take a look? |
@@ -165,7 +165,7 @@ func (h HostPriorityList) Less(i, j int) bool { | |||
if h[i].Score == h[j].Score { | |||
return h[i].Host < h[j].Host | |||
} | |||
return h[i].Score < h[j].Score | |||
return h[i].Score > h[j].Score |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the more standard way to do this is to leave it as < and then do the sort using
sort.Sort(sort.Reverse(priorityList))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@davidopp PTAL |
GCE e2e build/test passed for commit 2c52e62. |
LGTM |
GCE e2e build/test passed for commit 2c52e62. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
@gmarek - ok I will check it tomorrow and apply the label if that's the case. |
@gmarek could you please /cc the scheduling sigs on these changes.. this effects us too. |
/cc @kubernetes/sig-scheduling @kubernetes/sig-scalability |
I've just check our test - and the high density test didn't failed since this PR was merged (which is last 20 runs). We should definitely cherrypick it to 1.2. |
@timothysc - sorry, I thought that this is cosmetic enough change, that I don't need to inform anyone about it. |
Honest question: is there a way in github to set up certain fields that are required before you can open an issue? For example, a drop-down picker for "groups to cc" or "tags to add". Github as a issue reporting/ticketing system is just brutal. |
Add the v1.2 milestone. Starting later today cherrypick-candidate will be removed from any PR that doesn't set the milestone. |
@jeremyeder Github just recently added issue and PR templates, if you'd like to investigate how to help us set it up. |
@gmarek Please write a good release note for this and put it in the PR description. |
@bgrant0607 - I'll do this, but this is really just a workaround for broken go 1.4.2 random number generator. |
Auto commit by PR queue bot
Auto commit by PR queue bot
Auto commit by PR queue bot
To reduce the probability of multiple Pods being schedule on the same node.
cc @hongchaodeng @wojtek-t