Merge lp://qastaging/~tribaal/charms/trusty/rabbitmq-server/add-pause-resume-actions into lp://qastaging/~openstack-charmers-archive/charms/trusty/rabbitmq-server/next

Proposed by Chris Glass
Status: Work in progress
Proposed branch: lp://qastaging/~tribaal/charms/trusty/rabbitmq-server/add-pause-resume-actions
Merge into: lp://qastaging/~openstack-charmers-archive/charms/trusty/rabbitmq-server/next
Diff against target: 316 lines (+225/-3)
7 files modified
Makefile (+1/-1)
actions.yaml (+4/-0)
actions/actions.py (+61/-0)
hooks/rabbit_utils.py (+31/-0)
hooks/rabbitmq_server_relations.py (+1/-1)
tests/basic_deployment.py (+125/-0)
unit_tests/test_rabbitmq_server_relations.py (+2/-1)
To merge this branch: bzr merge lp://qastaging/~tribaal/charms/trusty/rabbitmq-server/add-pause-resume-actions
Reviewer Review Type Date Requested Status
David Ames (community) Needs Fixing
James Page Needs Fixing
Geoff Teale (community) Approve
Review via email: mp+277418@code.qastaging.launchpad.net

Description of the change

This branch adds two unit-level actions, "pause" and "resume" to the charm, that users can execute to pause and respectively resume a particular unit of a rabbitmq-server cluster, similar to the way other charms implement the same feature (ceilometer, swift*).

A unit that is "paused" should not have any responsability anymore and should be allowed to be taken offline without further warning. In Rabbitmq's case this is pretty simple, since the application itself allows for this to happen by default. Pausing the unit will simply stop the rabbitmq service on the given unit. Other charms need to make sure no data is lost.

One small non-obvious change here: the @restart_on_change decorator is further wrapped to make it "pause aware" otherwise some service-level configuration changes would restart the rabbitmq services on paused units. Again, this is not critical in rabbitmq's case since the application logic should handle a killed service gracefully, but was added anyway for consistency's sake.

To post a comment you must log in.
Revision history for this message
Geoff Teale (tealeg) wrote :

+1 Approve.

review: Approve
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12768 rabbitmq-server-next for tribaal mp277418
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full unit test output: http://paste.ubuntu.com/13246423/
Build: http://10.245.162.77:8080/job/charm_unit_test/12768/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13698 rabbitmq-server-next for tribaal mp277418
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
make: *** [lint] Error 1
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/13246424/
Build: http://10.245.162.77:8080/job/charm_lint_check/13698/

Revision history for this message
James Page (james-page) wrote :

I think we need to avoid calling status_set directly in the actions, and move to updating the assess_status function in the main relations file to be pause aware; this will ensure that the next 'update-status' hook execution (which happens periodically in 1.25) will set the correct status of 'paused' rather than determining that rabbitmq is not running and setting 'blocked'

review: Needs Fixing
Revision history for this message
Chris Glass (tribaal) wrote :

> I think we need to avoid calling status_set directly in the actions, and move
> to updating the assess_status function in the main relations file to be pause
> aware; this will ensure that the next 'update-status' hook execution (which
> happens periodically in 1.25) will set the correct status of 'paused' rather
> than determining that rabbitmq is not running and setting 'blocked'

Excellent point. Changed the "status_set" to be in assess_status() as you suggested.

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7855 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13246587/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7855/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12769 rabbitmq-server-next for tribaal mp277418
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/12769/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13699 rabbitmq-server-next for tribaal mp277418
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/13699/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7856 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13246796/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7856/

Revision history for this message
James Page (james-page) wrote :

Hmm - that amulet test look suspicious as the rabbitmq cluster is not clustering correctly

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7859 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
2015-11-13 18:31:20,197 publish_amqp_message_by_unit DEBUG: Closing connection...
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13249544/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7859/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Please also add lint coverage for the new actions dir via the Makefile's lint target. Thank you.

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7860 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
MESSAGE 1@172.17.107.152 [4B29C6B3-6F9A-4DF2-9A09-3675F6DE0EEA-1447444725.03]
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13250328/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7860/

Revision history for this message
Chris Glass (tribaal) wrote :

> Please also add lint coverage for the new actions dir via the Makefile's lint
> target. Thank you.

Good catch! Done.

Thanks!

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12924 rabbitmq-server-next for tribaal mp277418
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/12924/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13863 rabbitmq-server-next for tribaal mp277418
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/13863/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13866 rabbitmq-server-next for tribaal mp277418
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/13866/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12926 rabbitmq-server-next for tribaal mp277418
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/12926/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7900 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
2015-11-16 22:33:08,393 _test_rmq_amqp_messages_all_units DEBUG: Publish message to: 172.17.105.97 (rabbitmq-server/0 juju-osci-sv05-machine-4)
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13303433/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7900/

Revision history for this message
David Ames (thedac) wrote :

Tests need fixing:
Traceback (most recent call last):
  File "tests/014-basic-precise-icehouse", line 11, in <module>
    deployment.run_tests()
  File "/var/lib/jenkins/checkout/rabbitmq-server/tests/charmhelpers/contrib/amulet/deployment.py", line 95, in run_tests
    getattr(self, test)()
  File "/var/lib/jenkins/checkout/rabbitmq-server/tests/basic_deployment.py", line 587, in test_416_pause_resume_actions
    self._test_pause()
  File "/var/lib/jenkins/checkout/rabbitmq-server/tests/basic_deployment.py", line 551, in _test_pause
    self._assert_services(should_run=True)
AttributeError: 'RmqBasicDeployment' object has no attribute '_assert_services'

review: Needs Fixing
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12978 rabbitmq-server-next for tribaal mp277418
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/12978/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13923 rabbitmq-server-next for tribaal mp277418
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/13923/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7905 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
2015-11-17 14:35:37,575 connect_amqp_by_unit DEBUG: Connecting to amqp on 172.17.107.199:5671 (rabbitmq-server/2) as testuser1...
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13313632/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7905/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #12981 rabbitmq-server-next for tribaal mp277418
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/12981/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13925 rabbitmq-server-next for tribaal mp277418
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/13925/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7908 rabbitmq-server-next for tribaal mp277418
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
2015-11-17 16:00:50,154 connect_amqp_by_unit DEBUG: Connecting to amqp on 172.17.106.18:5671 (rabbitmq-server/1) as testuser1...
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13314342/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7908/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

hi @tribaal

It's hard to say why the test failed on the pause action. I'd suggest adding a check + debug output when it fails the == check, before returning from wait_on_action() in charmhelpers/contrib/amulet/utils.py.

Unmerged revisions

134. By Chris Glass

This should hopefully fix tests once and for all.

133. By Chris Glass

Added missing method (straight copy from the swift-proxy charm).

132. By Chris Glass

Re-added actions directory to linting after commit revert.

131. By Chris Glass

Reverting last change - unintended charmhelpers sync was pulled in as well.

130. By Chris Glass

Added new actions directory to lint makefile target.

129. By Chris Glass

Fixed missing mock for tests.

128. By Chris Glass

Lint fixes.

127. By Chris Glass

Move the maintenance status set to the assess_status() function. (james's review)

126. By Chris Glass

Forgot the tests

125. By Chris Glass

First pass to make rabbitmq-server maintenance-aware.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches