-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix: setting maxEmptyBulkDelete, and maxScaleDownParallelism to be the same value #5890
fix: setting maxEmptyBulkDelete, and maxScaleDownParallelism to be the same value #5890
Conversation
/assign I think this will be problematic if someone explicitly sets one of the flags to be less than the default value. Instead of using Max, it seems safer to check which flag was provided (e.g. like this). |
We have 4 cases here.
In cases 1 and 2, the solution is easy, we just set the value equal to the value of the one we set. For 3, its an interesting case, because if I set max-empty-bulk-delete to 3, then max-scale-down-parallelism to 11, which should we respect? // cases we have 3, 1. Mebd was set, but msdp was not, 2 msdp was set, but mebd was not, 3. both were set
if isFlagPassed("max-empty-bulk-delete") && !isFlagPassed("max-scale-down-parallelism") {
// Set maxScaleDownParallelismFlag = maxEmptyBulkDeleteFlag to avoid inconsistent deletion thresholds for the legacy planner and the new actuator.
*maxScaleDownParallelismFlag = *maxEmptyBulkDeleteFlag
} else if !isFlagPassed("max-empty-bulk-delete") && isFlagPassed("max-scale-down-parallelism") {
// Set maxEmptyBulkDeleteFlag = maxScaleDownParallelismFlag to avoid inconsistent deletion thresholds for the legacy planner and the new actuator.
*maxEmptyBulkDeleteFlag = *maxScaleDownParallelismFlag
} else {
maxDeletionSize := int(math.Max(float64(*maxEmptyBulkDeleteFlag), float64(*maxScaleDownParallelismFlag)))
*maxEmptyBulkDeleteFlag = maxDeletionSize
*maxScaleDownParallelismFlag = maxDeletionSize
}
|
If both are set ideally we'd just exit the process, but that's can break people already using such setup, especially if this is meant to be cherrypicked. I think max is ok in that case, but I'd log the problem to limit confusion. |
6a1eb24
to
0163710
Compare
@x13n I am thinking we should merge this in to 1.25, 1.26 and 1.27, and maybe for 1.28(IE Master), but maybe we should have another followup PR that panics if both flags are set for 1.28 or 1.29. This panic can take two paths.
|
https://github.com/kubernetes/autoscaler/pull/5926/files something like this could be useful as well, after this pr we are on is merged. This way we only set the total number of nodes we plan on removing/deleting based on one flag. With the pr we are on, we will have that value set to the intended value always. I am thinking maybe either in 1.28 or 1.29, we enforce max-empty-bulk-delete should not be set. What is the best way to announce flag deprecations to the community? |
0163710
to
af1aab9
Compare
About the deprecation - I'd start with emitting a warning whenever the old flag is used. And then delete it after a version or two. It should be also a part of the release notes. |
59bb45d
to
c9f3f2e
Compare
…xEmptyBulkDelete, and maxScaleDownParallelism to be the larger of the two flags in the case both are set
c9f3f2e
to
1e45078
Compare
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.
LGTM, just one minor comment on wording. Putting on hold, but feel free to just cancel the hold if you disagree.
/lgtm
/approve
/hold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bryce-Soghigian, x13n 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 |
/hold cancel |
…specting-bulk-delete fix: setting maxEmptyBulkDelete, and maxScaleDownParallelism to be the same value
…specting-bulk-delete fix: setting maxEmptyBulkDelete, and maxScaleDownParallelism to be the same value
…specting-bulk-delete fix: setting maxEmptyBulkDelete, and maxScaleDownParallelism to be the same value
…ulk-delete cherry-pick: Merge pull request #5890 from Bryce-Soghigian/bsoghigian/respecting-bulk-delete
…e-1.27 Merge pull request #5890 from Bryce-Soghigian/bsoghigian/respecting-bulk-delete
…ulk-delete-1.26 cherry-pick: Merge pull request #5890 from Bryce-Soghigian/bsoghigian/respecting-bulk-delete
cause default value was set for max-scale-down-parallelism, maybe the function |
I have figure out, flag.Parse() is missing, so |
…specting-bulk-delete fix: setting maxEmptyBulkDelete, and maxScaleDownParallelism to be the same value
What type of PR is this?
/kind bug
What this PR does / why we need it:
Cluster Autoscaler is in a migrating state where we make two decisions to filter down deletion candidates. We filter candidates in the Planner using the legacy maxEmptyBulkDelete flag, and we also filter down nodes in the cropNodesForDeletion function in the actuator that uses the maxScaleDownParallelism value.
This leads to the following scenario
Which issue(s) this PR fixes:
Fixes #5870, #5618
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: