Comment 9 for bug 1927981

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/+/834359
Committed: https://opendev.org/openstack/charm-mysql-router/commit/5a2da1800272af2875064a295b8ba7044cf7bcea
Submitter: "Zuul (22348)"
Branch: master

commit 5a2da1800272af2875064a295b8ba7044cf7bcea
Author: Billy Olsen <email address hidden>
Date: Fri Mar 18 15:11:42 2022 -0700

    Configure mysqlrouter.conf sections based on wildcards

    Upon bootstrap, the mysqlrouter will create a mysqlrouter.conf file for
    the cluster it is connecting to. This creates sections such as
    metadata_cache:<cluster_name>, routing:<cluster_name>_rw,
    routing:<cluster_name>_ro, etc. The cluster name is not provided on the
    mysql-router interface so this information is not available in
    determining the correct section name. Since the mysql-router is designed
    to work with a single cluster, the need to update the interface which in
    turn requires the user to update a number of deployed charms in the
    environment, an approach is taken to allow regular expressions to be
    used when matching the section name.

    There is some risk to this in that it requires that future edits
    carefully consider the possible section names when future sections are
    added. However, this developer cost is traded off in order to ease the
    burden of operators.

    For the upgrade scenario, this patch also checks to see if the file
    rendered on disk contains multiple 'metadata_cache' sections, and if so
    rewrites the mysqlrouter.conf file with the hardcoded
    metadata_cache:jujuCluster section removed.

    Closes-Bug: #1927981
    Change-Id: Iad44744ad01c0b6429fbafb041e6fc11887dbfb9