Merge lp:~hopem/charms/trusty/percona-cluster/min-cluster-size into lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next
| Status: | Merged |
|---|---|
| Merged at revision: | 66 |
| Proposed branch: | lp:~hopem/charms/trusty/percona-cluster/min-cluster-size |
| Merge into: | lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next |
| Diff against target: |
790 lines (+444/-77) 10 files modified
Makefile (+2/-2) config.yaml (+6/-0) hooks/percona_hooks.py (+113/-33) hooks/percona_utils.py (+121/-0) tests/10-deploy_test.py (+1/-1) tests/40-test-bootstrap-single.py (+17/-0) tests/41-test-bootstrap-multi-notmin.py (+41/-0) tests/42-test-bootstrap-multi-min.py (+43/-0) tests/basic_deployment.py (+83/-41) unit_tests/test_percona_utils.py (+17/-0) |
| To merge this branch: | bzr merge lp:~hopem/charms/trusty/percona-cluster/min-cluster-size |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| James Page | 2015-07-22 | Approve on 2015-07-22 | |
| David Ames | 2015-07-22 | Pending | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2015-07-17.
charm_unit_test #5996 percona-
UNIT OK: passed
charm_amulet_test #5175 percona-
AMULET FAIL: amulet-test missing
AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.
Full amulet test output: http://
Build: http://
charm_unit_test #6137 percona-
UNIT OK: passed
charm_lint_check #6505 percona-
LINT OK: passed
charm_amulet_test #5227 percona-
AMULET FAIL: amulet-test missing
AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.
Full amulet test output: http://
Build: http://
charm_unit_test #6141 percona-
UNIT OK: passed
charm_lint_check #6509 percona-
LINT OK: passed
charm_amulet_test #5231 percona-
AMULET FAIL: amulet-test missing
AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.
Full amulet test output: http://
Build: http://
charm_unit_test #6142 percona-
UNIT OK: passed
charm_lint_check #6510 percona-
LINT OK: passed
charm_amulet_test #5232 percona-
AMULET FAIL: amulet-test missing
AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.
Full amulet test output: http://
Build: http://
| David Ames (thedac) wrote : | # |
Ed,
This looks good and appears to solve bug 1475585.
I am new here but it seems we want to keep the *_hooks.py as clean as possible and have these helper functions in the *_utils.py. For example is_bootstrapped and get_wsrep_value and possibly all of the new functions could be moved over to the utils
functions into perconal_utils.py
This should really get its own amulet test. Setup with min-cluster-size, add min-cluster-size -1, verify percona has not started
, add another unit and verify it all comes up.
Lastly, is "boostrap-pxc mysql" idempotent? If any config change changes the config file this gets run. On a stable cluster would "boostrap-pxc mysql" being run break anything?
| Edward Hope-Morley (hopem) wrote : | # |
Thanks for the review David.
I totally agree that the helper functions should go into percona_utils.py and I will move them across.
I'll see what I can do amulet test-wise.
With regards to bootstrap-pxc, this should be safe since it will only be called once at bootstrap time (ideally once all nodes are configured but that is not a hard requirement). If it were called prior to more units being added to the cluster, on subsequent runs of config_changed() we should only ever be calling 'restart' although bootstrap-pxc is idempotent and, in fact, can be done before you have all units in the cluster. The charm will also only restart percona if the config file changes.
| Edward Hope-Morley (hopem) wrote : | # |
Oh and yes, bootstrap-pxc is idempotent.
| David Ames (thedac) wrote : | # |
> Oh and yes, bootstrap-pxc is idempotent.
Excellent.
Just to be clear bootstrap-pxc *will* be run more than once. After the cluster has been bootstrapped any config-changed run that changes the config file will "re-bootstrap" on the leader. This may not be your intent.
In config-changed bootstrapped is defaulted to False and therefore the leader will run render_
elif clustered and is_leader():
And in render_
if file_hash(MY_CNF) != pre_hash:
if bootstrap:
else:
charm_unit_test #6248 percona-
UNIT OK: passed
charm_lint_check #6616 percona-
LINT OK: passed
charm_amulet_test #5248 percona-
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
| Edward Hope-Morley (hopem) wrote : | # |
I have done a full amulet test run with this charm (tests enabled in Makefile) and I get 100% success locally. I notice that the way amulet is responding to amulet.SKIP in osci is different to how it is handled locally i.e. I get:
juju-test.
juju-test.
juju-test.
juju-test.
juju-test.conductor DEBUG : Tearing down lxc juju environment
juju-test.conductor DEBUG : Calling "juju destroy-environment -y lxc"
yet OSCI says:
juju-test.
juju-test.
juju-test.
juju-test.
juju-test.conductor INFO : Breaking here as requested by --set-e
- 66. By Edward Hope-Morley on 2015-07-22
-
[hopem,r=]
Add min-cluster-size config option. This allows the charm to wait
for a minimum number of peers to join before bootstrapping
percona and allowing relations to access the database.Closes-Bug: 1475585
charm_unit_test #6249 percona-
UNIT OK: passed
charm_lint_check #6617 percona-
LINT OK: passed
| Edward Hope-Morley (hopem) wrote : | # |
Hmm on closer inspection it appears that SKIP is being treated as a failure for me too (if i remove the vip config). Unlike OSCI I am not using --set-e but I am also not using --fail-on-skip so they should not be getting treated as failures. I'm gonna re-disable amulet here for now until this gets sorted.
charm_amulet_test #5249 percona-
AMULET FAIL: amulet-test missing
AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.
Full amulet test output: http://
Build: http://
charm_lint_check #6619 percona-
LINT OK: passed
charm_unit_test #6251 percona-
UNIT OK: passed
charm_amulet_test #5251 percona-
AMULET FAIL: amulet-test missing
AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.
Full amulet test output: http://
Build: http://
| Ryan Beisner (1chb1n) wrote : | # |
FYI: in UOSCI, we use --set-e so that the runner will keep the juju environment after a failed test exits. We do that so that we can collect juju unit logs. Otherwise, you'd just get "I failed."
However, based on the juju test -h, I also don't believe the intended behavior is to have a SKIP invoke --set-e.
| Ryan Beisner (1chb1n) wrote : | # |
AMULET_OS_VIP (and other network environment variables) are now calculated and exported to dynamically represent the IP space of each job's arbitrary jenkins slave.
charm_amulet_test #5253 percona-
AMULET OK: passed
Build: http://
| Ryan Beisner (1chb1n) wrote : | # |
Woomp there it is!
| Ryan Beisner (1chb1n) wrote : | # |
Amulet results from #5253 for those without private jenkins access: http://
| Ryan Beisner (1chb1n) wrote : | # |
Also just fyi, an example of what now gets passed to all uosci amulet jobs:
http://

charm_lint_check #6364 percona- cluster- next for hopem mp265108
LINT OK: passed
Build: http:// 10.245. 162.77: 8080/job/ charm_lint_ check/6364/