Get allowed hosts ignores prefix

Bug #1904610 reported by David Ames
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
High
Unassigned
MySQL InnoDB Cluster Charm
Fix Released
High
Unassigned
MySQL Router Charm
New
Undecided
Unassigned

Bug Description

The current implementation of get_allowed_hosts [0] is prefix unaware and assumes the database name as the prefix:

            # First check for setting with prefix, then without
            for attr in ["%s_hostname" % (database), 'hostname']:
                hosts = settings.get(attr, None)
                if hosts:
                    break

This can lead to missing allowed_hosts if the prefix is not the database name and the address is different than private-address. i.e. potentially in IPv6 scenarios.

TRIAGE:
Make get_allowed_hosts prefix aware.
Bonus: Make mysql-router set private-address to match.
Bonus bonus: Make mysql-router send *all* potential addresses that the client might use. This can be a json encoded list.

[0] https://github.com/juju/charm-helpers/blob/master/charmhelpers/contrib/database/mysql.py#L431

Revision history for this message
David Ames (thedac) wrote :
Changed in charm-helpers:
status: New → Triaged
importance: Undecided → High
assignee: nobody → David Ames (thedac)
David Ames (thedac)
Changed in charm-mysql-innodb-cluster:
status: New → Triaged
importance: Undecided → High
assignee: nobody → David Ames (thedac)
milestone: none → 21.01
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-innodb-cluster (master)

Fix proposed to branch: master
Review: https://review.opendev.org/763075

Changed in charm-mysql-innodb-cluster:
status: Triaged → In Progress
David Ames (thedac)
Changed in charm-helpers:
status: Triaged → In Progress
David Ames (thedac)
Changed in charm-mysql-innodb-cluster:
milestone: 21.01 → none
Revision history for this message
David Ames (thedac) wrote :
Changed in charm-helpers:
status: In Progress → Fix Released
Changed in charm-mysql-innodb-cluster:
status: In Progress → Fix Released
Changed in charm-helpers:
assignee: David Ames (thedac) → nobody
Changed in charm-mysql-innodb-cluster:
assignee: David Ames (thedac) → nobody
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.