Upon bootstrap, the mysqlrouter will create a mysqlrouter.conf file for
the cluster it is connecting to. This creates sections such as
metadata_cache:<cluster_name>, routing:<cluster_name>_rw,
routing:<cluster_name>_ro, etc. The cluster name is not provided on the
mysql-router interface so this information is not available in
determining the correct section name. Since the mysql-router is designed
to work with a single cluster, the need to update the interface which in
turn requires the user to update a number of deployed charms in the
environment, an approach is taken to allow regular expressions to be
used when matching the section name.
There is some risk to this in that it requires that future edits
carefully consider the possible section names when future sections are
added. However, this developer cost is traded off in order to ease the
burden of operators.
For the upgrade scenario, this patch also checks to see if the file
rendered on disk contains multiple 'metadata_cache' sections, and if so
rewrites the mysqlrouter.conf file with the hardcoded
metadata_cache:jujuCluster section removed.
Closes-Bug: #1927981
Change-Id: Iad44744ad01c0b6429fbafb041e6fc11887dbfb9
There are no logrotate configurations for the mysql router logs.
This PR introduces a template rendered upon installation of the charm.
A maximum of 10 log files (10M each) are retained.
Change-Id: I18376228af4ca809c10a1b138ceb96459686daa4
Closes-Bug: #1880083
Due to a build problem with the reactive plugin, this change falls back
on overriding the steps and doing a manual build, but it also ensures
the CI system builds the charm using charmcraft. Changes:
- add a build-requirements.txt
- modify charmcraft.yaml
- modify osci.yaml
-> indicate build with charmcraft
- modify tox.ini
-> tox -e build does charmcraft build/rename
-> tox -e build-reactive does the reactive build
- modify bundles to use the <charm>.charm artifact in tests.
and fix deprecation warning re: prefix
- tox inception to enable tox -e func-test in the CI
Change-Id: Ie422d578412fd3131814c2fe402fd9890b1f2232
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.
Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: If49888ab570c44f69edc4420d2c5ab680a20d436
Allow the user to change the number of connections to the database
cluster units to their needs.
The default value is the same as without the configuration option.
Closes-Bug: #1929826
Change-Id: I10556e9d373cd8505c4e2e96d2b6031fe4ee9166
* charm-helpers sync for classic charms
* sync from release-tools
* switch to release-specific zosci functional tests
* run focal-ussuri as smoke tests
* remove trusty, xenial, and groovy metadata/tests
* drop py35 and add py39
Change-Id: Ia2e35ead4afa35df7a19869b96ee41c6ec6c4d65
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
Having the zaza test configuration charm_name = mysql-router adds
mysql-router as an application that is never actually instantiated. This
leads to zaza failures looking for a unit of that application.
Simply change the charm_name to an instantiation of mysql-router
resolves this. i.e. keystone-mysql-router which is in each bundle.
Change-Id: Ib89d11352635e077f062b3f86a4024802f59419f
Closes-Bug: #1931117
These are the test bundles (and any associated changes) for
focal-wallaby and hirsute-wallaby support.
hisute-wallaby test is disabled (moved to dev) due to [1].
[1] https://github.com/juju-solutions/layer-basic/issues/194
Change-Id: I16b04aab3ad2438b4c2ecabb697d24c7725e316b
This patchset updates all the requirements for charms.openstack,
charm-helpers, charms.ceph, zaza and zaza-openstack-tests back
to master branch.
Change-Id: Id6c48e13015db148357fe656592fb1864e36fe0b
* charm-helpers sync for classic charms
* build.lock file for reactive charms
* ensure tox.ini is from release-tools
* ensure requirements.txt files are from release-tools
* On reactive charms:
- ensure stable/21.04 branch for charms.openstack
- ensure stable/21.04 branch for charm-helpers
Change-Id: Ifcfdc4d51204d8bf39eecc33c45ad312ca87deb2
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
This update adds the new hirsute Ubuntu release (21.04) and
removes trusty support (14.04 which is EOL at 21.04).
Change-Id: I65c6b94e87c094953229c26f6b24cc61c1608f0e
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
* Update requirements.txt to pin charm-tools to 2.8.3
* Update tox.ini to change the build parameters.
* This upgrades from <2.7 which adds reproducible charms
* Bug was fixed that controlled the default output directory
doesn't get 'builds' appended. The tox change puts it
back so that stable & master both build to the same
directory. This may be reviewed in the future.
Change-Id: Ifd1393cc9f417bc5dc4bad6f72e925dd89ff73de
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>
Reverting to an earlier version of charm-tools to
resolve some building issues seen with latest 2.8.2
version.
Change-Id: I6b2d422b8bef71e703b3f1ff3d8200dc3dfd23a3
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
Includes updates to charmhelpers/charms.openstack for cert_utils
and unit-get for the install hook error on Juju 2.9
* charm-helpers sync for classic charms
* rebuild for reactive charms
* ensure tox.ini is from release-tools
* ensure requirements.txt files are from release-tools
* On reactive charms:
- ensure master branch for charms.openstack
- ensure master branch for charm-helpers
Change-Id: Ib0e48fb7bb640e489c94b20b62f6084b35591b1e