Failed to upgrade mysql-router from latest/stable to 8.0/stable

Bug #1979263 reported by Chi Wai CHAN
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Router Charm
Fix Committed
High
Felipe Reyes

Bug Description

When deploy a simple keystone charm with mysql-router charm and mysql-innodb-database charm, mysql-router is blocked by: Failed to connect to database due to '(2003, "Can't connect to MySQL server on '127.0.0.1:3306' (111)")'. This is a known bug from #1973177, and it has a fix on 8.0/stable. Therefore, I have attempted to upgrade the mysql-router charm to 8.0/stable, but the upgrade was not successful and it failed with the same error status: 2003.

Also see the attachment for the traceback of this error and how the model is deployed.

Furthermore, the problem can be solved by running:

- `juju run-action keystone-mysql-router pause`

- (`juju resolved keystone-mysql-router/0` might be required to put it into maintainance state)

- `juju run-action keystone-mysql-router resume`

Revision history for this message
Chi Wai CHAN (raychan96) wrote :
Revision history for this message
Felipe Reyes (freyes) wrote :

The issue here is that during the upgrade charm operation we don't restart the mysql-router service, the files are correctly rendered.

Changed in charm-mysql-router:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Felipe Reyes (freyes)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (master)
Changed in charm-mysql-router:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (master)

Change abandoned by "Felipe Reyes <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/848748

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-router (master)

Reviewed: https://review.opendev.org/c/openstack/charm-mysql-router/+/848673
Committed: https://opendev.org/openstack/charm-mysql-router/commit/6df798a939c9f5e167a73f6e8c145c6ec631ac6c
Submitter: "Zuul (22348)"
Branch: master

commit 6df798a939c9f5e167a73f6e8c145c6ec631ac6c
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:
    https://review.opendev.org/848748

    Co-Authored-By: Felipe Reyes <email address hidden>

    Closes-bug: #1980693
    Closes-bug: #1979263
    Related-bug: #1927981
    Change-Id: If9d71bdb839c9c0ee3f4b33e4d44a5c93bdd13de

Changed in charm-mysql-router:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-router (stable/jammy)

Fix proposed to branch: stable/jammy
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/851761

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-router (stable/jammy)

Reviewed: https://review.opendev.org/c/openstack/charm-mysql-router/+/851761
Committed: https://opendev.org/openstack/charm-mysql-router/commit/cfe6b2e3c0081fdc9c3aafec26a942e722de34a9
Submitter: "Zuul (22348)"
Branch: stable/jammy

commit cfe6b2e3c0081fdc9c3aafec26a942e722de34a9
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:
    https://review.opendev.org/848748

    Co-Authored-By: Felipe Reyes <email address hidden>

    Closes-bug: #1980693
    Closes-bug: #1979263
    Related-bug: #1927981
    Change-Id: If9d71bdb839c9c0ee3f4b33e4d44a5c93bdd13de
    (cherry picked from commit 6df798a939c9f5e167a73f6e8c145c6ec631ac6c)

tags: added: in-stable-jammy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.