Commit Graph

128 Commits

Author SHA1 Message Date
Alex Kavanagh 6751832bb6 Migrate percona-cluster to charmcraft build
- add *.charm  to .gitignore
- add build-requirements.txt
- add charmcraft.yaml (build on 18.04, run on 18.04)
- modify osci.yaml to do build
- add rename.sh to clean-up naming of charms
- modify bundles to work with *.charm and use the charmhub
- modify tox.ini to include the build target

Note that this charm doesn't officially support xenial, but the bundle
has been left in the tests for debugging/test purposes.  It Launchpad it
will be build on bionic to run on bionic.

This patch adds *.charm to the .gitignore to ensure that any built
artifacts are ignored.

Change-Id: Icd4942262a8dfcd3a194684571861121d92f8ed2
2022-05-20 16:08:07 -07:00
Corey Bryant 393afdd1e7 Remove xenial metadata and function tests
Drop xenial metadata and function tests as the next release of
the charms won't support xenial. xenial-queens-ha-series-upgrade
was not dropped as it still seems useful to test.

Change-Id: I27005eb7c149f788a14a68fad1b700b374697dd3
2021-11-12 11:09:26 -05:00
Alex Kavanagh 432c3f0be4 Ensure that nagios user gets created with a password
The associated bug is due to a change introduced in commit d55dcde
which was to ensure that the correct password update is used for
different versions of mysql (pre and post 5.7.5).  However, this change
has broken the nagios user creation due to not setting the password.

This patch creates the nagios user and passord at the same time.  The
updating of the password is only done if the account already exists.

The change also corrects the nagios password store in leader-settings to
the 'mysql-nagios.passwd' key instead of 'nagios-password'.  This was an
unfortuante error when the nagios change password was introduced.  The
charm detects if the 'nagios-password' key is used on charm-upgrade and
moves it to 'mysql-nagios.passwd'.  This enables the key to work with
the standard MySQLHelper functions.

Finally, the ALTER command (on percona) doesn't update non-InnoDB tables
and thus needs to be run for each unit when the nagios password is
changed via the action.  The changes in percona_utils.py enable this to
happen.

Whilst the change looks large it ONLY affects the nagios password parts
of the charm.

The related bug is a tracking bug to serve as a reminder to fix this in
charm-helpers and this charm (i.e. make the charm-helpers code work to
change a password for any user other than root, and then enable this
charm to use that code).

Change-Id: Ibc751bef7b4654ebffdf843c556b193373e6e80c
Related-Bug: #1925377
Closes-Bug: #1925042
2021-04-21 18:17:45 +01:00
Alex Kavanagh 1b813d1fd9 Fix series-upgrade issue where seeded file goes missing
During resume on a non-leader unit, the 'seeded' file can go missing
when the package syncs over to the /var/lib/mysql or
/var/lib/percona-xtradb-cluster directories (vivid+).  It's not really
clear why it doesn't do this every time (i.e. not every non-leader unit
fails), but this fix ensures that if the unit *is* seeded prior to the
series-upgrade, then it stays seeded after the series upgrade.

The related zaza-openstack-tests change [1] is about fixing the
series-upgrade test.

Note there is no trusty-mitaka test here as the charm doesn't support
trusty.  The last version of percona-cluster in the charm store that
supports trusty is rev. 276

[1]: https://github.com/openstack-charmers/zaza-openstack-tests/pull/406

Change-Id: I628be1c24081d7e0e150e5064c5fa4ab694632e9
Closes-bug: #1868326
2020-09-04 18:22:17 +01:00
Aurelien Lourot 85e8536480 Remove Groovy from metadata
Also remove unused Disco test bundle.

Change-Id: I4357def0540caa1911c0a47821f1bfddf5da7028
2020-07-10 10:37:27 +02:00
Alex Kavanagh 3170c8cf5b Remove disco support from the charm
Change-Id: Id5bdbff5ae9218d5f9ba495e81b37c263cab3a7d
2020-02-18 14:50:08 +00:00
Liam Young 8443c165f9 Notify clients of series upgrade
When the percona cluster is undergoing a series upgrade, clients
should suspend db activity in their hooks (like db migrations).

This change sents a notification of upgrade down the shared-db
relation which clients can then react to.

Change-Id: I5d8ed7d3935db5568c50f8d585e37a4d0cc6914f
2020-01-29 12:56:23 +00:00
David Ames d8b13606e4 Guard yaml load of grastate on cold boot
Occasionally after cold boot yaml load of grastate will be throw an
exception. Do not error out in this instance.
Update percona to use TEST_ variables
Fix HA overlays

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/116
Change-Id: I6e40970423acb6f70dcc3b91f8b5109de6f46bfc
2019-11-07 15:56:52 -08:00
Camille Rodriguez 9b1699e7cb Add disco-stein bundle to gate tests
The bundle disco-stein was in the dev bundles because
a bug with the Python 3.7 syntax prevented the success of
the deployment of HA clusters. This bug is fixed, we can
reintegrate disco-stein in the gate bundles.

Other small additions:
- Removed unused Amluet test templates
- removing sitepackages in tox.ini to avoid test env pollution
- skip_missing_interpreters in tox.ini set to False to avoid false
positives by skipping missing interpreters.

LP Related-Bug: #1823718
Change-Id: I38ba1d762fede6c25b8b4c41919859e52eb097fd
2019-09-04 09:14:37 -04:00
David Ames 257c58f373 Convert percona-cluster to Zaza
Convert amulet tests to zaza.
Add additional tests for new cold boot actions.
Use multi-model tests.yaml for different tests for bionic and xenial.

Change-Id: I5dadefa6092acecdaae194370a81b05a69b09909
2019-07-18 13:57:58 -07:00
David Ames 681cdf8e45 Convert to python3
Convert the percona cluster charm to python3.

Remove Trusty testing.

Change-Id: Ia5ae43f16caffb5c4356d3f5616e0383e23b5f50
2019-07-08 07:41:48 -07:00
Frode Nordahl 9b7d7d6a02
Enable cosmic gate test and disco dev test
Pending LP: #1823718 to enable disco gate test

Change-Id: I7fcd92968252499a25a2e4a85b049f15ab24587b
2019-04-08 14:51:42 +02:00
James Page cd505a45e8 Enable trusty gate check
Add functional test for trusty to ensure we don't regress
older deployments (until trusty support is dropped).

Change-Id: I888a1bcd21aca074e6f742e920280297c9cab341
2019-03-29 13:48:09 +00:00
Ryan Beisner b8ae801dde
Update functional test definitions
Remove trusty-icehouse test combo from gate, leaving trusty-mitaka
if/where it exists.

Change-Id: I1ffafd2c64de7e62fbd5f53e7a87393078e74967
2019-02-06 14:50:02 -06:00
Xav Paice 7b7188b610 Add wsrep-slave-threads and gcs-fc-limit
These options allow tuning the Galera replication to avoid flow control from
slowing down the primary.

Change-Id: Ib275cae0db02e4c8c0a85fcc8cb138b26eb26982
Closes-Bug: 1799622
2018-12-17 18:08:24 +13:00
Liam Young 29b586c61b Use chelper to configure vip and dnsha settings
Use helpers from charmhelpers to generate the data to send down the
relation to the hacluster charm.

This results in a few changes in behaviour:

1) The charm will no longer specify a nic name to bind the vip. This
   is because Pacemaker VIP resources are able to automatically
   detect and configure correct iface and netmask parameters based
   on local configuration of the unit.
2) The original iface named VIP resource will be stopped and deleted
   prior to the creation of the new short hash named VIP resource.

Change-Id: Id3804fb7913662b8c573f59d84e663561a687b1f
2018-12-12 09:55:45 +00:00
Ryan Beisner a5ebe488eb Update requirements
Also remove tests/charm-helpers if present, in favor
of the pip-installed charm-helpers.

Change-Id: I60b6b713df3ce3c53a5d339569bbd53a9148d874
2018-10-03 13:11:40 -05:00
Ryan Beisner 9b6f192ed9 Add cosmic
Add a tactical change which is already merged into charm-helpers.

This needs to go into all charms to solve the chicken:egg issue
where cosmic is untestable until this change exists.

Reference:

4835c6c167

Change-Id: I182314eee702cf4bf842b26cb2f2a5c0ee03dcc7
2018-09-19 13:33:21 +02:00
Ryan Beisner 960e2ac18e Update functional test definitions
Change-Id: Ib0fe0304761729d6df494cbe6cae42ebd9300a12
2018-08-27 18:17:49 -05:00
Chris MacNaughton e49f780083 Sync charm-helpers to ensure Rocky support
Change-Id: Ibf2bbd56a06deda4770781edaeb61340b774b3c1
2018-07-13 15:59:09 +02:00
Ryan Beisner 99e9dcfcf6 Update series metadata
Ensure that EOL releases are removed from metadata
and tests, and that the current dev release is enabled
in metadata.  Dev release tests are enabled separately
because of chickens and eggs.

Change-Id: I56fdbbfc2ead2f3af8ea8a4bd17c53c6794c141a
2018-07-11 14:07:31 -05:00
David Ames caadf6cd7a Enable Bionic as a gate test
Change bionic test from dev to gate for 18.05.

Change-Id: I137ad6fad748f751da53efa21931f9f7fcda9616
2018-05-08 12:57:33 -07:00
David Ames 801c2e7829 Redesign cluster buildup process
In order to fix bug#1756928 the whole cluster buildup process needed to
be redesigned. The assumptions about what is_bootstrapped and clustered
meant and when to restart on configuration changed needed to be
re-evaluated.

The timing of restarts needed to be protected to avoid collisions.
Only bootstrapped hosts should go in to the
wsrep_cluster_address=gcomm:// setting. Adding or removing units should
be handled gracefully. Starting with a single unit and expanding to a
cluster must work.

This change guarantees mysqld is restarted when the configuration file
changes and meets all the above requirements. As a consequence of the redesign,
the workload status now more accurately reflects the state of the unit.

Charm-helpers sync to bring in distributed_wait fix.

Closes-Bug: #1756308
Closes-Bug: #1756928
Change-Id: I0742e6889b32201806cec6a0b5835e11a8027567
2018-03-29 09:24:05 -07:00
Corey Bryant 7d835b8674 Add support for PXC 5.7 and xtrabackup 2.4
Bionic will ship with Percona XtraDB Cluster 5.7 and a newer
version of Percona XtraBackup; the majority of charm changes
are associated with the use of native mysql{@} units for
bootstrap and startup of mysqld.

Co-Authored-By: James Page <james.page@ubuntu.com>
Change-Id: I50c5642e11393da3bc03de0ef0b9af4c32e9a0c9
2018-03-09 11:55:43 +00:00
Ryan Beisner c54685d8e1 Sync charm-helpers
Change-Id: I6beeb8282d1ab1b7b1dd9ae280f2373d320912f9
2018-02-21 14:10:33 -06:00
Ryan Beisner b68d29ce6c Sync charm-helpers
Notable issues resolved:

openstack_upgrade_available() broken for swift
https://bugs.launchpad.net/charm-swift-proxy/+bug/1743847

haproxy context doesn't consider bindings
https://bugs.launchpad.net/charm-helpers/+bug/1735421

regression in haproxy check
https://bugs.launchpad.net/charm-helpers/+bug/1743287

Change-Id: I542fe7ac3f407f607f9ed03865f5919de883ae5c
2018-01-19 12:10:51 +00:00
Ryan Beisner e579ac7a94 Add Bionic and remove Zesty series and tests
Bionic, being the next LTS, is important to enable for dev
and test as early as possible ahead of 18.02.

Zesty goes EOL in Jan 2018. The next stable charms release (18.02)
will not provide Zesty series support, as it was an interim
(non-LTS) release.

Change-Id: I63403c8aacfd2da5195b0baac2fdb7c550a741e7
2017-12-05 05:33:46 +00:00
Ryan Beisner 0abe0c4b92 Sync charm-helpers
Change-Id: Iaa2708cd9c067f57442d3116d1f962cda5c4ea27
2017-11-22 18:49:39 +00:00
Andrew McLeod f75b58ea4a Enable artful amulet test
Rename tests to align with ubuntu releases;
Remove explicit openstack release amulet tests
Make default func27-smoke xenial
Charm-helpers sync

Change-Id: I6de9d3f052536827157b191f75e5d8f9b271f80e
2017-11-15 11:21:32 +13:00
Ryan Beisner feaad01996 Re-enable HA VIP and remove deprecated tests
The underlying test infrastructure and tooling previously had
an issue which prevented HA VIP tests from functioning.  That
issue is now resolved, and the VIP tests can be re-enabled.

Change-Id: I3f0bdace1baf62a646a487766744fdc212311640
2017-08-28 19:18:00 +00:00
Ryan Beisner 1e4cc0bc8f Sync charm-helpers
Change-Id: Ifab2cdced938fc17ff0661742cd7c872cca97859
2017-08-24 17:15:25 -05:00
Ryan Beisner 8ada52bf15 Remove deprecated series metadata and tests
Change-Id: I8d214d6d0fe53152e40eb4e45a0ad3df2a4ba09e
2017-08-23 09:55:47 -05:00
Jenkins d344106e6a Merge "Modify tests.yaml which specifies bundletester config params with the following key:value pairs:" 2017-08-10 21:07:29 +00:00
Andrew McLeod 3b34751f87 Modify tests.yaml which specifies bundletester config params
with the following key:value pairs:

- reset_timeout: 600

Change-Id: I671c4c0719d889f0d438563b36160ed721270202
2017-08-09 14:29:14 -06:00
Felipe Reyes e7f611ff2e Add support to change root password
Change the configured root's password in percona and update the leader
settings.

Change-Id: I7168a96cac7a3b4df7fcfa1afc6f35076748578b
Partial-Bug: 1436093
2017-07-28 18:06:30 -04:00
Felipe Reyes 62ed38b7b2 Resync charm-helpers for support to change passwords
Change-Id: I1337096eb32250285e4a4a5d2b1975f91993816a
Partial-Bug: 1436093
2017-07-28 16:23:05 -04:00
Ryan Beisner df0bb60803 Resync charm-helpers for sources repo ports fix
Change-Id: I9c562c0e23fcde2745794fca221c210223874241
Closes-bug: #1611134
2017-05-25 11:06:06 -05:00
James Page 3facb32aff Correctly quote all MySQL syntax
Resync charm-helpers to ensure that MySQL syntax is correctly
quoted with single quotes, supporting use of the db-{admin} relation
with services containing a dash.

Change-Id: I859133263a8200e82e73d74837bcb91a18b3e0ff
Closes-Bug: 1675220
2017-05-15 12:21:46 +01:00
David Ames 45f5a8a9a6 Enable Zesty-Ocata Amulet Tests
- Turn on Zesty-Ocata Amulet test definitions.
- Standardize test-requirements.txt
- Sync charm helpers for various fixes

Change-Id: I22d7f8f37bf53635cb689803eb6e9b5170181bb1
2017-05-02 16:04:45 -07:00
Jenkins 7f1b953982 Merge "Notify peers bootstrap-uuid during upgrade-charm hook" 2017-04-05 16:10:10 +00:00
Felipe Reyes af74254f20 Notify peers bootstrap-uuid during upgrade-charm hook
Since 17.02 the charm relies on the existence of bootstrap-uuid to
determine if pxc is bootstraped. The upgrade-charm hook handler uses
leader_node_is_ready() which calls cluster_ready(), this function will
evaluate to False when bootstrap-uuid is not defined

This patch drops leader_node_is_ready() from the upgrade-charm hook to
simply rely on is_leader(), for the non-leader unit
leader_get('bootstrap-uuid') and then notify_bootstrapped() if it's
set. For cases where the non-leader units are upgraded before
notify_bootstrapped() is called as part of the leader-settings-changed
hooks.

Change-Id: I621e23d7666920b91614491927711a85370310ad
Closes-Bug: 1674467
2017-04-05 09:43:30 -03:00
Alex Kavanagh 00b5990e74 Fix alphanumeric comparisons for ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: I61a6831f381664f9378a1b6a7a119cf3a2c026c2
Related-Bug: #1659575
2017-04-04 20:39:18 +01:00
James Page 60e58482f6 Improve password management for clustered deploys
In the past, its mandatory to provide the sst and root password
configuration options for clustered deployments to ensure consistent
use of passwords across the cluster from install onwards.

Rework password management and install process to seed passwords
from the lead unit if not supplied via configuration options.

Following units will defer installation until the leader has
stored this information in leader storage for retrieval by
followers.

Closes-Bug: 1454317

Change-Id: I5ab70cae78ed35322bf60048af841de071a69704
2017-03-08 10:07:52 +00:00
James Page fd6097fcb2 Redux amulet tests
Refactor to support direct use of BasicDeployment test class
in all gate tests.  As hacluster now defaults to using unicast
transport, the configuration for multicast device address is
no longer required and can be dropped, removing the need to
specialize tests on a per series basis.

Use min-cluster-size in tests to ensure that pxc clusters
build out correctly.

Refactor specific test cases into BasicDeployment test
class so they get executed against all series, including

    kill mysqld test
    pause/resume tests

Closes-Bug: 1546577

Change-Id: I239946808f68a0225b49c0327da2b4d35715b837
2017-03-07 15:56:33 +00:00
James Page 55154de2ee Ensure sane default memory configuration
Cap default memory consumption at 512MB or 50% of system memory -
whichever is the lowest - to ensure that deployments in containers
on large server infrastructure don't end up consuming silly
amounts of memory by default.

Update tests to not explicity configure dataset-size, and to
remove the constraint for a larger VM for testing - with the
performance schema disabled by default things should fit into
a default instance size in the gate.

Change-Id: Ifb9bd7e28e160190913f6bd03b84073a2857e4d7
2017-03-01 11:10:01 +00:00
David Ames 2efdae7dad Pre-release charm-helpers sync 17.02
Get each charm up to date with lp:charm-helpers for release testing.

Change-Id: I96082b8e448bc9c17451f0c6e5c98b6d174e8bf5
2017-02-14 11:59:53 -08:00
David Ames e47c4ad135 Default performance schema to off
The 5.6 version of mysql defauls to performance_schema=on at server
startup. This allocates all the memory that would be required to
handle max-connections plus several other memory settings.

We occasionally saw connection exhaustion in HA clouds with
max-connections near 2000. The common practice became to set
max-connections unrealistically high near 10k or 20k. In the move to
5.6 on Xenial this became a problem as the memory requirements for
values that high are unrealistic.

This change adds performance schema as a configuration option and
defaults to off giving 5.5 like behavior. It also considerably
updates documentation and highlights the need to carefully consider
memory related configuration settings for production environments.

Make the amulet test python2 and python3 capable.

Change-Id: Id01095ac2f73fa041b25b2602496a4c04a13e3ef
Partial-Bug: #1654086
Closes-Bug: #1600001
2017-01-09 13:59:24 -08:00
Ryan Beisner 23a76721f9 Update Amulet defs, series metadata and c-h sync
- Remove problematic tests from gate, place in dev-* re:
https://bugs.launchpad.net/bugs/1546577

- Sync charm helpers if applicable.

- Fix test executable hashbags for virtualenv prep.

- Add Yakkety-Newton Amulet test definitions.

- Prep Xenial-Ocata Amulet test definitions (not yet enabled).

- Prep Zesty-Ocata Amulet test definitions (not yet enabled).

- Remove Precise charm series metadata if present.

- Remove Precise Amulet test definitions if present.

- Add Newton tests.

Change-Id: I50e72c026fa3e62fcd29a04572c18b5bcaa59a85
2016-12-06 11:30:52 -08:00
Adam Collard d367494fbe NRPE services is a list not a string
Pass charm-helpers' nrpe.add_init_service_checks() a list of services
as its second argument, instead of a string.

Additionally adjust amulet tests to configure hacluster's cluster_count
when > 1 unit is configured.

Change-Id: Ib48a31e17c1e8d8c68e774b64fcf52c0ee99bef5
Closes-Bug: 1643855
2016-11-28 14:32:48 +00:00
David Ames 9d81bcdd80 Pre-release charm-helpers sync 16.10
Get each charm up to date with lp:charm-helpers for release testing.

Change-Id: I2be9f6440620694e95e415b9ee6e4c77ff191fca
2016-09-30 09:20:13 -07:00