On k8s, for a rollback case, the leader unit will have the recovery state, rendering the cluster_state with the recovery value.
This will defer the on_upgrade_changed handler indefinitely because of this test.
The defer makes sense for VM cases, where on charm refresh, all units will set it state to ready on the upgrade-charm handler.
On K8s, only the upgrading unit will receive the upgrade-charm event, and if the leader unit is not the upgrading unit, the cluster_state will remain in the recovery state.
Deferring the on_upgrade_changed indefinitely will prevent the upgrade_stack being popped, and a subsequent resume-upgrade will set the wrong partition value, staling the rollback process.
On k8s, for a rollback case, the leader unit will have the
recovery
state, rendering thecluster_state
with therecovery
value.This will defer the
on_upgrade_changed
handler indefinitely because of this test.The defer makes sense for VM cases, where on charm refresh, all units will set it state to
ready
on theupgrade-charm
handler. On K8s, only the upgrading unit will receive theupgrade-charm
event, and if the leader unit is not the upgrading unit, thecluster_state
will remain in the recovery state.Deferring the
on_upgrade_changed
indefinitely will prevent theupgrade_stack
being popped, and a subsequentresume-upgrade
will set the wrong partition value, staling the rollback process.