Skip to content

Commit 627ed9b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "rabbitmq: fix reset-state on RabbitMQ 4.x"
2 parents dc0661e + ad5b9e1 commit 627ed9b

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

ansible/roles/rabbitmq/tasks/reset-state.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
changed_when: true
55
ansible.builtin.command: "{{ kolla_container_engine }} exec rabbitmq rabbitmqctl stop_app"
66

7+
# TODO: rabbitmqctl force_reset is not supported with Khepri and
8+
# causes the reset to fail. Remove the fallback to force_reset
9+
# above RabbitMQ version 4.2 where only Khepri is used.
710
- name: Reset the state of RabbitMQ
811
become: true
912
changed_when: true
10-
ansible.builtin.command: "{{ kolla_container_engine }} exec rabbitmq rabbitmqctl force_reset"
13+
ansible.builtin.command: >
14+
{{ kolla_container_engine }} exec rabbitmq bash -c
15+
'rabbitmqctl force_reset || rabbitmqctl reset'
1116
1217
- name: Start the RabbitMQ application
1318
become: true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
fixes:
3+
- |
4+
Fix ``kolla-ansible rabbitmq-reset-state`` on RabbitMQ 4.2 or later.
5+
Khepri is the new default metadata store starting from RabbitMQ 4.2,
6+
and it does not support ``rabbitmqctl force_reset``, which causes
7+
the reset to fail. This patch adds a fallback to
8+
``rabbitmqctl reset`` to ensure the operation completes successfully.
9+
`LP#2150536 <https://launchpad.net/bugs/2150536>`__

0 commit comments

Comments
 (0)