The linked bug occurred due to a new header for the config file being in
the upgraded charm, but not in the previous version of the charm. As
the config file is read, updated, and then written, new headings in the
INI file would crash the charm code with a KeyError.
This patch just sets the header and parameter if it is missing.
Closes-Bug: #1927981
Change-Id: I18a6a4143ee0a1144eade5caa50611b802cba28a
Ensure that a location in /run is used for the PID file for
the mysqlrouter instance - this ensures that in the event
of a power outage, the old PID file will not be present and
the daemon will correctly startup when the machine starts up.
Update systemd configuration to create /run/mysql and to use
the mysql user and group to execute the daemon.
Switch to 'forking' mode to ensure that the mysqlrouter process
gets tracked by systemd.
Closes-Bug: 1931095
Change-Id: Id3f7605ad1e9e4a6e4b0a1abe8000abd75b5b0fd
If for any reason the first attempt to add an instance to cluster fails,
subsequent attempts would fail with:
Error: It appears that a router instance named <name> has been
previously configured in this host. If that instance no longer exists,
use the --force option to overwrite it.
This change avoids this error by adding the --force switch on subsequent
attempts.
Closes-Bug: #1919560
Change-Id: Icb0b10d6a5e3fe902c7ea56dbcb2f04d1129cd5f
We were getting "Error: It appears that a router instance named '' has been
previously configured in this host. If that instance no longer exists, use the
--force option to overwrite it." when co-locating mysql-routers. Specify the
name of the mysql-router to allow co-location.
Closes-Bug: #1918726
Change-Id: I65c2730dcb5ffb240bf57c9e0b0cb1a1735a4525
LP Bug #1914649 saw an edge case where --report-host was necessary for
mysql-router bootstrap. Adding it to cover this edge case.
Change-Id: I0ea751aa4015ad6e569d9c3e9f8364cf36801c18
Closes-Bug: #1914649
When vault certificates are being used and passed to the mysql-router
via the db-router relation use client_ssl_mode = PASSTHROUGH. This
maintains the < 8.0.23 behavior terminating TLS at the
mysql-innodb-cluster nodes.
If not using vault certificates from the db-router relation use
client_ssl_mode = PREFERRED, 8.0.23's new behavior. This TLS encrypts
with self-signed certificates. This covers TLS for the deployment
process.
If ssl_ca is unset on the db-router relation, unset it on the shared-db
relation to guarantee the requestor uses the correct communication
method.
Closes-Bug: #1914299
Change-Id: I1e66aca79df83b41072bb5df2cfb1708c8259cb4
Co-authored-by: Aurelien Lourot <aurelien.lourot@canonical.com>
Disble the rest API to avoid a clash if multiple mysql router
subordinates are deployed on the same node.
Closes-Bug: #1911907
Change-Id: Id15744bcdb0cab5786d745e76e69223415a38ced
If the local mysql router fails to connect (or work) with the clustered
MySQL8 instance, then the MySQLHelper.connect() call will hang
indefinitely. Unfortunately, this happens during an update-status hook,
which is not visible (due to juju status not showing update-status hooks
executing). Although this has no impact on the running cloud, it does
mean that nothing else happens on the machine (update-status, upgrades,
hooks, config-changed, etc.). This allows the connect to fail and thus
for the charm to go into error so that the local mysql router instance
can be restarted.
Note that this depends on [1] landing in charm-helpers.
[1]: https://github.com/juju/charm-helpers/pull/550
Closes-bug: #1907250
Change-Id: I030d7caa8cc41aaf89ade25e5be196fb602d466c
Enable passing the certificate authority on the relation in order to
enable TLS communication to the MySQL DB.
Depends-On: I785afe7f64cb57caa857178d529e3cabdcf63517
Change-Id: I26d7ec4cf9a2e99d9d1cb573ad40f6f4e53f56b5
The connections from a client only come from inside the same machine
since the router works as a subordinate charm.
Change-Id: I636065bc02ab0fa5dde9c5a7d6a35003019982a4
Closes-Bug: #1880333
Handle departed and broken db-router relations elegantly.
Remove Eoan as a test target.
Closes-Bug: #1874479
Depends-On: Ibc87371f441318e2082ff4028d9f57ae6b796035
Change-Id: Ida5e8fef458abc38cc50ad8749f315eadcb499e0
Before this change it was not possible to run more than one
instantiation of mysql-router on a single unit. The Nova cells
deployments require nova-cloud-controller to be connected to two
different databases, therefore, requiring two instantiations of
mysql-router.
This change includes all the necessary steps to run multiple
instantiations of mysql-router on a single unit.
Review and merge charm-helpers PR:
https://github.com/juju/charm-helpers/pull/469
Closes-Bug: #1876188
Depends-On: Iafcc106fca44479e89b4b66a0a3988ffeee01f04
Change-Id: I76d1bfdccf9a551188c9f86c06ee0a22c07d47cf
Wait timeout is the non-interactive idle timeout setting. The default of
3600 is aligned to OpenStack's idle_timeout configuration default.
Proxy this value from the server to the client.
Depends-On: Ie2b2ad2856cbe1d830f1b7e674a2fb867d81de12
Change-Id: I0a40a65cdf1b618ec843bf872fe0b39866496e1c
Closes-Bug: #1841063