Merge "Allow removal of classic queue mirroring for internal RabbitMQ" into stable/victoria

This commit is contained in:
Zuul 2022-03-30 13:59:21 +00:00 committed by Gerrit Code Review
commit c75d83aa26
6 changed files with 51 additions and 0 deletions

View File

@ -74,6 +74,8 @@ rabbitmq_server_additional_erl_args: "+S 2:2 +sbwt none +sbwtdcpu none +sbwtdio
rabbitmq_tls_options: {}
# To avoid split-brain
rabbitmq_cluster_partition_handling: "pause_minority"
# Whether to remove the ha-all policy.
rabbitmq_remove_ha_all_policy: false
####################
# Plugins

View File

@ -1,4 +1,7 @@
---
- include_tasks: remove-ha-all-policy.yml
when: rabbitmq_remove_ha_all_policy | bool
- import_tasks: config.yml
- import_tasks: check-containers.yml

View File

@ -0,0 +1,29 @@
---
- block:
- name: Get container facts
become: true
kolla_container_facts:
name:
- "{{ service.container_name }}"
register: container_facts
- block:
- name: List RabbitMQ policies
become: true
command: "docker exec {{ service.container_name }} rabbitmqctl list_policies --silent"
register: rabbitmq_policies
changed_when: false
# NOTE(dszumski): This can be removed in the Zed cycle
- name: Remove ha-all policy from RabbitMQ
become: true
command: "docker exec {{ service.container_name }} rabbitmqctl clear_policy ha-all"
when:
- "'ha-all' in rabbitmq_policies.stdout"
when: container_facts[service.container_name] is defined
delegate_to: "{{ groups[role_rabbitmq_groups] | first }}"
run_once: true
vars:
service_name: "rabbitmq"
service: "{{ rabbitmq_services[service_name] }}"

View File

@ -16,6 +16,9 @@
when: inventory_hostname in groups[role_rabbitmq_groups]
register: rabbitmq_differs
- include_tasks: remove-ha-all-policy.yml
when: rabbitmq_remove_ha_all_policy | bool
- import_tasks: config.yml
- import_tasks: check-containers.yml

View File

@ -16,9 +16,13 @@
{"user": "{{ murano_agent_rabbitmq_user }}", "vhost": "{{ murano_agent_rabbitmq_vhost }}", "configure": ".*", "write": ".*", "read": ".*"}
{% endif %}
],
{% if rabbitmq_remove_ha_all_policy | bool %}
"policies":[]
{% else %}
"policies":[
{"vhost": "/", "name": "ha-all", "pattern": ".*", "apply-to": "all", "definition": {"ha-mode":"all"}, "priority":0}{% if project_name == 'outward_rabbitmq' %},
{"vhost": "{{ murano_agent_rabbitmq_vhost }}", "name": "ha-all", "pattern": ".*", "apply-to": "all", "definition": {"ha-mode":"all"}, "priority":0}
{% endif %}
]
{% endif %}
}

View File

@ -0,0 +1,10 @@
---
fixes:
- |
Fixes an issue where RabbitMQ was configured to mirror classic transient
queues for all services. According to the RabbitMQ documentation this is
not a supported configuration, and contributed to numerous bug reports.
In order to avoid making unexpected changes to the RabbitMQ cluster, it is
necessary to set ``rabbitmq_remove_ha_all_policy`` to ``yes`` in order to
apply this fix. This variable will be removed in the Yoga release.
`LP#1954925 <https://launchpad.net/bugs/1954925>`__