Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for router removed from cluster set can lead to false positive #118

Open
paulomach opened this issue Apr 4, 2024 · 5 comments
Open
Labels
bug Something isn't working

Comments

@paulomach
Copy link
Contributor

Steps to reproduce

  1. Deploy mysql and mysql-router and a client app on vsphere/maas cloud
  2. Relate all
  3. edit mysql machine to remove line 127.0.1.1 from /etc/hosts file (workaround mysql-operator#433)

Expected behavior

Router should be able to connect to mysql

Actual behavior

Router fail with Router was manually removed from MySQL ClusterSet. Remove & re-deploy unit

Versions

mysql 8.0/edge
mysql-router dpe/edge

Juju CLI: 3.4.1

Additional context

The test is_router_in_cluster_set@src/workload.py fails due the router_id being different on cluster set metadata and router_id property.
On the cluster:

MySQL localhost:33060+ ssl Py> dba.get_cluster_set().list_routers()
{
    "domainName": "cluster-set-9e88628bbd1e5acae8de7e1021f36315", 
    "routers": {
        "juju-355e18-0.maas::system": 
...

on the router machine:

>>> socket.getfqdn()
'juju-355e18-0'

@paulomach paulomach added the bug Something isn't working label Apr 4, 2024
Copy link
Contributor

github-actions bot commented Apr 4, 2024

@carlcsaposs-canonical
Copy link
Contributor

3. edit mysql machine to remove line 127.0.1.1 from /etc/hosts file (workaround mysql-operator#433)

@paulomach is mysql router on the same machine as mysql? I'm wondering how editing /etc/hosts on mysql machine affects the router's id

@jamesbeedy
Copy link

jamesbeedy commented Apr 5, 2024

@carlcsaposs-canonical , thanks for chiming in. I can confirm that removing the 127.0.1.1 line from /etc/hosts on the machine the router runs on is not a workaroud for this bug.

When the 127.0.1.1 line is removed from the router machine, socket.getfqdn() returns 192-168-7-122.maas :(

(Edited)

@jamesbeedy
Copy link

jamesbeedy commented Apr 5, 2024

It is interesting to note that on the mysql host (also without the 127.0.1.1 line in /etc/hosts) that socket.getfqdn() returns juju-0fe1c3-0.maas 😕

@carlcsaposs-canonical
Copy link
Contributor

@jamesbeedy what does socket.getfqdn() return on the router machine if /etc/hosts is unmodified? can you compare this to dba.get_cluster_set().list_routers()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants