db-router incomplete when relation to mysql-innodb-cluster is removed and readded

Bug #1972883 reported by Liam Young
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Router Charm
Fix Committed
Undecided
Seyeong Kim
charm-interface-mysql-router
Fix Released
High
Liam Young

Bug Description

When the relation to mysql-innodb-cluster is removed and then added back, mysql-router reports:

"'db-router' incomplete, Waiting for proxied DB creation from cluster"

This appears to be because the prefixes key is not cleared from the local db when the relation is removed. When the relation is added back the charm looks for a password from mysql-innodb-cluster relating to each of the prefixes it knows about *1. However db-router has not sent a request for the MRUP prefix yet but the interface is waiting on a response.

Removing the relation, deleting the prefix key from the db and adding the relation back fixes the issue:

delete from kv where key like '%prefix%';

*1 https://github.com/openstack/charm-interface-mysql-router/blob/master/requires.py#L133

Liam Young (gnuoy)
Changed in charm-interface-mysql-router:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Liam Young (gnuoy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-interface-mysql-router (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-interface-mysql-router (master)

Reviewed: https://review.opendev.org/c/openstack/charm-interface-mysql-router/+/841581
Committed: https://opendev.org/openstack/charm-interface-mysql-router/commit/77dc778e6060a9bcdc49490c3e782b2204ba7454
Submitter: "Zuul (22348)"
Branch: master

commit 77dc778e6060a9bcdc49490c3e782b2204ba7454
Author: Liam Young <email address hidden>
Date: Thu May 12 12:11:05 2022 +0000

    Wipe 'prefixes' key on relation departed

    The prefix key is used to track requests that have been proxied
    to mysql-innodb-cluster. When a request for a username and password
    is made the prefix used is stored locally in a list *1. This list
    of prefixes is also used to check that requests are complete *2
    However the list presists after a relation is removed. If
    the relation is added back the charm reads the old list of
    prefixes and will not raise the db-router.available flag
    because it thinks there is an oustanding request *3.

    *1 https://opendev.org/openstack/charm-interface-mysql-router/src/branch/master/requires.py#L61
    *2 https://opendev.org/openstack/charm-interface-mysql-router/src/branch/master/requires.py#L151
    *3 https://opendev.org/openstack/charm-interface-mysql-router/src/branch/master/requires.py#L20

    Closes-Bug: #1972883
    Change-Id: I8ce022a44db37ab83c03442c5f97a843521286d2

Changed in charm-interface-mysql-router:
status: In Progress → Fix Released
Seyeong Kim (seyeongkim)
tags: added: sts
Changed in charm-mysql-router:
assignee: nobody → Seyeong Kim (seyeongkim)
status: New → In Progress
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/+/914571

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-mysql-router (stable/21.10)

Change abandoned by "Seyeong Kim <email address hidden>" on branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-mysql-router/+/914572

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/+/914571
Committed: https://opendev.org/openstack/charm-mysql-router/commit/740cae9841bc34ae9ede97132e966ad6853a52bf
Submitter: "Zuul (22348)"
Branch: stable/jammy

commit 740cae9841bc34ae9ede97132e966ad6853a52bf
Author: Seyeong Kim <email address hidden>
Date: Thu Mar 28 12:20:54 2024 +0900

    Update interface-mysql-router

    fix prefix issue when remove&add relation

    Closes-Bug: #1972883
    Change-Id: Ica6e5af2dc2d6adf0d6e6dc4be0ad4a6eab7b4d0

tags: added: in-stable-jammy
Changed in charm-mysql-router:
status: In Progress → Fix Committed
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.