-
Notifications
You must be signed in to change notification settings - Fork 7k
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: improve logging & safety of statefulSetReady #10622
fix: improve logging & safety of statefulSetReady #10622
Conversation
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.
This fix works perfectly. Waiting for StatefulSet rollout to finish now works as it should.
Hey, any update on this getting merged? |
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.
@dnwe Would it be possible to provide a unit test to replicate the issue?
@mattfarina @marckhouzam Looking at the backwards compatibility HIP, there doesn't seem any rule that new messages can't be added as is the case in this PR. There is a mention alright in Open Issues. Are these message backward compatible to you? |
187162b
to
8bd623e
Compare
Sure, rebased on latest main and added a couple of scenarios to the existing readiness test that failed with the old code and pass with the new statefulSetReady func |
8bd623e
to
d997fdf
Compare
@mattfarina / @marckhouzam any thoughts on Martin's question above? It would be great if we could get this fix into a release |
Thanks @mattfarina — @hickeyma this should be ready for re-review |
Confirm that the current and updated revision numbers also match as part of the readiness check. Add coverage for readiness scenarios where StatefulSet status does not reflect the most recent generation of the StatefulSet yet. Also add additional logging around the sts transitions from non-ready to ready. Fixes: helm#10163 Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
d997fdf
to
7c74f1d
Compare
Rebased and updated log line as requested by @mattfarina |
Because this is a medium in size it needs a second approval from a maintainer |
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.
This code looks great, good tests, and works well! 👏
Beyond automated testing, did manual test. For future ref, here's what I did:
kind create cluster
helm install my-mariadb bitnami/mariadb --version 11.0.0
- Why this version? Looked on artifact hub for a good chart containing StatefulSet template (bitnami/mariadb). Used artifacthub template browser to check which version had a change in that resource. 11.0.0 -> current does, so just doing that
- Test the upgrade
# Checkout PR branch and build (ya know) $ gh pr checkout 10622 $ make $ export MARIADB_ROOT_PASSWORD=$(kubectl get secret --namespace "default" my-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 -d) $ ./bin/helm upgrade --namespace default my-mariadb bitnami/mariadb --set auth.rootPassword=$ROOT_PASSWORD
- Note this charts output says we need a specific
--set
command on upgrade - Since we don't pass
--version
helm chooses the most recent,11.0.13
- Note this charts output says we need a specific
- output is as expected:
upgrade.go:394: [debug] waiting for release my-mariadb resources (created: 0 updated: 5 deleted: 0) wait.go:48: [debug] beginning wait for 5 resources with timeout of 5m0s ready.go:362: [debug] StatefulSet is not ready: default/my-mariadb. update has not yet been observed ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:393: [debug] StatefulSet is not ready: default/my-mariadb. 0 out of 1 expected pods are ready ready.go:402: [debug] StatefulSet is ready: default/my-mariadb. 1 out of 1 expected pods are ready upgrade.go:157: [debug] updating status for upgraded release for my-mariadb Release "my-mariadb" has been upgraded. Happy Helming!
Thanks team! |
Fix released in Helm v3.9.1 |
What this PR does / why we need it:
Confirm that the current and updated revision numbers also match as part of the readiness check.
Also add additional logging around the sts transitions from non-ready to ready.
Fixes: #10163
Special notes for your reviewer:
If applicable: