Upgrade-charm code needs to make various adjustments to
the config files and restart the mysql-router service,
but the code is currently running config-changed and
getting stuck in a restart loop before upgrade-charm
is able to run to make the config adjustments and
invoke a successful restart.
This change adds a condition to skip the execution of
config_changed function when upgrade-charm hook runs,
so upgrade_charm code takes care of the adjustments.
Also, now upgrade-charm hook is guaranteed to restart the
mysql-router service whenever any change to the config
file is made as part of its execution, whereas before
it wasn't doing so when making the adjustments of the
custom upgrade_charm function, resulting in the possibility
of no restarts after a charm upgrade.
Reviewed: https:/ /review. opendev. org/c/openstack /charm- mysql-router/ +/851761 /opendev. org/openstack/ charm-mysql- router/ commit/ cfe6b2e3c0081fd c9c3aafec26a942 e722de34a9
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/jammy
commit cfe6b2e3c0081fd c9c3aafec26a942 e722de34a9
Author: Rodrigo Barbieri <email address hidden>
Date: Mon Jul 4 17:22:02 2022 -0300
Fix restarts during upgrade-charm hook
Upgrade-charm code needs to make various adjustments to
the config files and restart the mysql-router service,
but the code is currently running config-changed and
getting stuck in a restart loop before upgrade-charm
is able to run to make the config adjustments and
invoke a successful restart.
This change adds a condition to skip the execution of
config_changed function when upgrade-charm hook runs,
so upgrade_charm code takes care of the adjustments.
Also, now upgrade-charm hook is guaranteed to restart the
mysql-router service whenever any change to the config
file is made as part of its execution, whereas before
it wasn't doing so when making the adjustments of the
custom upgrade_charm function, resulting in the possibility
of no restarts after a charm upgrade.
This change includes the now-abandoned change: /review. opendev. org/848748
https:/
Co-Authored-By: Felipe Reyes <email address hidden>
Closes-bug: #1980693 0ee3f4b33e4d44a 5c93bdd13de 167a73f6e8c145c 6ec631ac6c)
Closes-bug: #1979263
Related-bug: #1927981
Change-Id: If9d71bdb839c9c
(cherry picked from commit 6df798a939c9f5e