-
Notifications
You must be signed in to change notification settings - Fork 68
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 issue with rolling update when some existing replicas are unhealthy #488
base: main
Are you sure you want to change the base?
Conversation
The bug is as follows: * assume replicas readiness is [NOT_READY, READY] * update is triggered, with MaxUnavailable=1 * update starts updating the replica-1, causing complete downtime, while the desired behavior would be to wait for replica-0 to become ready The fix is to reduce partition less aggressively - taking into account pods that are not ready. Note that the fix was tested on a cluster with MaxUnavailableStatefulSet feature disabled (I don't have access to a cluster with this feature enabled, maybe the issue is less impactful there, however arguably still beneficial since the lws considers readiness of leader+workers and not only leader). Testing: * integration tests
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pierewoj The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @pierewoj! |
Hi @pierewoj. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-lws canceled.
|
/ok-to-test |
@pierewoj
|
Consider maxSurge=0, replicas=2, maxUnavail=1 and cluster with MaxUnavailableStatefulSet disabled. If replicas readiness is [NOT_READY, READY] then the rolling update would bring down the 2nd replica and cause complete unavailability. |
Got it. Rolling update will be blocked if the actual count of unavailable GE the maxUnavail. |
Yes:
|
Overall I agree with this change. If I understand correctly, the main issue is that our core logic doesn't take differentiate between a replica not being ready and a replica not being updated (essentially assumes that if the replica is not updated, it means that it must be running) here:
To simplify it, could add an extra count for
|
This was my original implementation actually but I think that it is insufficient. See the following scenario:
|
We can keep the proposed algorithm to calculate maxUnavailable, but instead of passing the states struct just pass the |
What type of PR is this?
/kind bug
What this PR does / why we need it
The bug is as follows:
The replica-0 might be unavailable for a variety of reasons like hardware issues, node patching etc.
The fix is to reduce partition less aggressively - taking into account pods that are not ready.
Note that the fix was tested on a cluster with MaxUnavailableStatefulSet feature disabled (I don't have access to a cluster with this feature enabled, maybe the issue is less impactful there, however arguably still beneficial since the lws considers readiness of leader+workers and not only leader).
Which issue(s) this PR fixes
I have not created a dedicated issue for this in github
Special notes for your reviewer
I also refactored the "iteratedReplicas" a bit into separate functions: a) reading the replica state and b) reading the state to get values used for rolling update params computation.
Does this PR introduce a user-facing change?
LWS user will see update progress less aggressively when not all replicas are healthy when update is triggered.