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

Implement DEPRECATED mysql-shared interface #49

Merged
merged 28 commits into from
Jul 3, 2023

Conversation

carlcsaposs-canonical
Copy link
Contributor

@carlcsaposs-canonical carlcsaposs-canonical commented Jun 28, 2023

mysql-router from 8.0/stable (written by OpenStack Charmers) supports mysql-shared interface

Add support for mysql-shared interface

DPE-2035

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/./src/machine_charm.py", line 59, in <module>
    ops.main.main(MachineSubordinateRouterCharm)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/venv/ops/main.py", line 429, in main
    charm = charm_class(framework)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/./src/machine_charm.py", line 28, in __init__
    self._database_provides = relations.database_providers_wrapper.RelationEndpoint(self)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/src/relations/database_providers_wrapper.py", line 32, in __init__
    self._database_provides = relations.database_provides.RelationEndpoint(charm_)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/src/relations/database_provides.py", line 149, in __init__
    self._interface = data_interfaces.DatabaseProvides(charm_, relation_name=self._NAME)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 756, in __init__
    super().__init__(charm, relation_name)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 373, in __init__
    super().__init__(charm, relation_name)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/venv/ops/framework.py", line 412, in __init__
    self.framework._track(self)
  File "/var/lib/juju/agents/unit-mysqlrouter-0/charm/venv/ops/framework.py", line 661, in _track
    raise RuntimeError(
RuntimeError: two objects claiming to be MachineSubordinateRouterCharm/DatabaseProvides[database] have been created

from https://github.com/canonical/mysql-router-operator/actions/runs/5404925316/jobs/9819825535
peer relation not available in install event
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.

Nice, one question. otherwise LGTM.

metadata.yaml Outdated Show resolved Hide resolved
if isinstance(exception, exception_type):
return exception.status
if requested_users:
return ops.ActiveStatus("'mysql-shared' interface deprecated")
Copy link
Contributor

Choose a reason for hiding this comment

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

:-D

Copy link
Contributor

@paulomach paulomach left a comment

Choose a reason for hiding this comment

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

a minor one, otherwise lgtm

self._local_unit_databag["allowed_units"] = self._remote_unit_name
self._local_unit_databag["db_host"] = "127.0.0.1"
self._local_unit_databag["db_port"] = "3306"
self._local_unit_databag["wait_timeout"] = "3600"
Copy link
Contributor

Choose a reason for hiding this comment

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

So, this comes from mysql configuration

The legacy charm supports a config and default it to 3600, but since we are not supporting the config, we should reflect the sysvar default, i.e. 28800.
A task was added to mirror this on the vm charm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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!

@carlcsaposs-canonical carlcsaposs-canonical merged commit 03d433d into main Jul 3, 2023
5 of 6 checks passed
@carlcsaposs-canonical carlcsaposs-canonical deleted the legacy-interface branch July 3, 2023 16:54
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.

4 participants