From 7b4640d5fbf3479a72188a759ff9135caec08169 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 21 Nov 2023 11:07:40 +0100 Subject: [PATCH] Add variable to control queues redundancy Since we have 2 redundancy scenarios that are controlled independnetly and are exclusive, we add variable to disable any queues redundancy. This also allows to adjust logic of classic queues versioning, since usage of CQv2 with classic mirrored queues may result in reduced performance as CQv2 do not have optimizations for mirrored queues [1] [1] https://blog.rabbitmq.com/posts/2023/05/rabbitmq-3.12-performance-improvements/#classic-queues-massively-improved-classic-queues-v2-cqv2 Change-Id: I81c7e9ce0ed090d7b87ba865c7dd5b4b706701d5 --- doc/source/user/messaging/messaging.rst | 2 +- inventory/group_vars/all/infra.yml | 10 ++++++++-- inventory/group_vars/all/oslo-messaging.yml | 3 --- .../rabbitmq_queue_replication-4deacbb389dd2e25.yaml | 7 +++++++ 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/rabbitmq_queue_replication-4deacbb389dd2e25.yaml diff --git a/doc/source/user/messaging/messaging.rst b/doc/source/user/messaging/messaging.rst index b0159b6e46..1712680e7e 100644 --- a/doc/source/user/messaging/messaging.rst +++ b/doc/source/user/messaging/messaging.rst @@ -87,7 +87,7 @@ to the rabbitmq server backend. .. literalinclude:: ../../../../inventory/group_vars/all/oslo-messaging.yml :language: yaml - :start-after: ## Main + :start-after: under the License. .. _oslo-messaging.yml: https://github.com/openstack/openstack-ansible/blob/master/inventory/group_vars/all/oslo-messaging.yml diff --git a/inventory/group_vars/all/infra.yml b/inventory/group_vars/all/infra.yml index 36c845fd68..54f26f6abc 100644 --- a/inventory/group_vars/all/infra.yml +++ b/inventory/group_vars/all/infra.yml @@ -24,18 +24,24 @@ rabbitmq_servers: >- | map('extract', hostvars, 'management_address') | list | join(',') }} + +# If you do not want to use neither quorum queues nor classic mirror queues, +# set rabbitmq_queue_replication to False +rabbitmq_queue_replication: True +oslomsg_rabbit_quorum_queues: False + rabbitmq_policies: - name: "HA" pattern: '^(?!(amq\.)|(.*_fanout_)|(reply_)).*' priority: 0 tags: "ha-mode=all" - state: "{{ (oslomsg_rabbit_quorum_queues | default(True)) | ternary('absent', 'present') }}" + state: "{{ (oslomsg_rabbit_quorum_queues | default(True) or not rabbitmq_queue_replication) | ternary('absent', 'present') }}" - name: CQv2 pattern: '.*' priority: 0 tags: queue-version: 2 - state: "{{ (oslomsg_rabbit_quorum_queues | default(True)) | ternary('absent', 'present') }}" + state: "{{ (oslomsg_rabbit_quorum_queues | default(True) or not rabbitmq_queue_replication) | ternary('present', 'absent') }}" ## Galera options galera_client_package_state: "{{ package_state }}" diff --git a/inventory/group_vars/all/oslo-messaging.yml b/inventory/group_vars/all/oslo-messaging.yml index da8cf37feb..80d250e8a1 100644 --- a/inventory/group_vars/all/oslo-messaging.yml +++ b/inventory/group_vars/all/oslo-messaging.yml @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -## Main -oslomsg_rabbit_quorum_queues: False - # RPC oslomsg_rpc_transport: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary('amqp', 'rabbit') }}" oslomsg_rpc_port: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_port, rabbitmq_port) }}" diff --git a/releasenotes/notes/rabbitmq_queue_replication-4deacbb389dd2e25.yaml b/releasenotes/notes/rabbitmq_queue_replication-4deacbb389dd2e25.yaml new file mode 100644 index 0000000000..56b08bb21a --- /dev/null +++ b/releasenotes/notes/rabbitmq_queue_replication-4deacbb389dd2e25.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Added new variable ``rabbitmq_queue_replication`` that allows to control + if any redundancy features (like quorum queues or classic mirrored queues) + will be used. + By default it is set to ``True``.