Closed shayancanonical closed 2 months ago
Added integration test in 58f42cd38c6d6f19d2de0eb177ddc11622ebad82
Thank you the test, LGTM. Please create a backlog to add COS full test (installing cos-lite bundle in parallel model and make sure grafana-agent is active and metrics/logs sent there.
Issue
If a relation with the metrics endpoint is created before the charm is allocated, it is possible that the
metrics-endpoint-created
event runs before theleader-elected
hook. Themetrics-endpoint-created
handler needs to use mysql which relies on values set in theleader-elected
handler. This results in the charm going into an error state from which it can never recover (the charm continually re-runs themetrics-endpoint-created
handler until it exits successfully)Fixes: https://github.com/canonical/mysql-k8s-operator/issues/504
Solution
Add a check to ensure that the values in the app peer databag are set (ensuring
leader-elected
is run first)Testing
Deployed COS + kubeflow locally, ensured the issue was reproducible. Added a hotfix in this PR, and ensured that the unit comes up successfully