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

DPE-5178 Adopt admin-address throught out #516

Merged
merged 15 commits into from
Sep 11, 2024
Merged

Conversation

paulomach
Copy link
Contributor

@paulomach paulomach commented Sep 2, 2024

Issue

As part of cycle, we ought to utilize admin-address for charm usage.
The idea is to ensure that the charm can connect to mysqld
instances (local or remote unit) even when max_connections is saturated
by related application(s), since connections to admin-address are do not count against max_connections.

Solution

  • library code to render admin_address in configuration file.
  • use admin_address:admin_port for users with ADMIN_CONNECTION privilege.
  • s/clusteradmin/serverconfig due cluster admin not having (and not needing to have, since replication channels don't count against max_connection) ADMIN_CONNECTION privilege.
  • add integration test to saturate client connections
  • use new feature on mysql-test-app PR#37 to retrieve connection data, used in integration test

)
if conn.is_connected():
connections.append(conn)
sleep(0.5)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep added to slow down tests so I could validate connections in database. Left here for the same reason, since the test is fairly quick

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It smells to me, it is a workaround for https://warthogs.atlassian.net/browse/DPE-5340 (we should sent peer details when we ready to accept traffic only).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a workaround for that issue. Just to be able to observe the test while developing.
The error on the nightly tests seems a different issue to me, since the router is connecting to a standby cluster (and we have yet to change/discuss if the router should connect to database through router to pick leadership changes on async cases)

Copy link
Contributor

@shayancanonical shayancanonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, left a comment about asserting that the admin connection is possible even when max connections are saturated

create_db_connections(1, **credentials)

logger.info("Get cluster status while connections are saturated")
_ = await run_action(mysql_unit, "get-cluster-status")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add a check that the admin port is unaffected? or at least admin connections are active?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting the cluster status rely on the admin connection. So when client connections are saturated, the action passing does just that. If the action fails, run_action will raise an assertion error

Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM.
Q: do we still have usecases for clusteradmin OR we need to clean it one day in the future from Juju Secrets and Documentation?

)
if conn.is_connected():
connections.append(conn)
sleep(0.5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It smells to me, it is a workaround for https://warthogs.atlassian.net/browse/DPE-5340 (we should sent peer details when we ready to accept traffic only).

@paulomach
Copy link
Contributor Author

Thank you! LGTM. Q: do we still have usecases for clusteradmin OR we need to clean it one day in the future from Juju Secrets and Documentation?

clusteradmin it still in use, since it's the (less privileged) user used for group replication, just not for charm operation.

@paulomach paulomach merged commit f4c8d83 into main Sep 11, 2024
103 checks passed
@paulomach paulomach deleted the feature/dpe-5178-admin-port branch September 11, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants