-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Sort machines deterministically before scaling down #512
Sort machines deterministically before scaling down #512
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ingvagabund If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
// Which may result in deletion of more machines than requested (followed | ||
// by recreation of new machines). Given each machine represents a node, | ||
// deleting more nodes than expected can be very disruptive. | ||
sort.Strings(machineNames) |
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.
So far the machines were listed randomly. Given a machine name is generated randomly, the original deletion policy (deleting first machines in a list) is preserved.
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.
Given a machine name is generated randomly, the original deletion policy (deleting first machines in a list) is preserved.
How does the final sort preserve the original deletion policy?
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.
The original deletion policy takes first items from a list where whose order is generated randomly. Reordering the items based on a name that is generated randomly as well changes order if items from one random sequence to another one.
Why is it called multiple times? It gets called once for the change of WTR to the issue that too many machines may be deleted: Wouldn't just filtering out machines in The only possible issue I see here is a racecondition in scaling down when a Does that make sense or did I get something wrong? |
Closing as per #558 (comment). /close |
@roberthbailey: Closing this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Update CAPV to CAPI v1alpha2
What this PR does / why we need it:
Sort the machines deterministically to delete machines in the same order. In general the machines are sequenced randomly depending on Machines().List() result. When number of replicas goes down, the reconcilication loop is called multiple times, each time taking a different subset of machines to be deleted. Which may result in deletion of more machines than requested (followed by recreation of new machines). Given each machine represents a node, deleting more nodes than expected can be very disruptive.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: