Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/operations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This guide is for operators of the StackHPC Kayobe configuration project.
octavia
openstack-projects-and-users-management
openstack-reconfiguration
rabbitmq
secret-rotation
tempest
upgrading-openstack
Expand Down
123 changes: 123 additions & 0 deletions doc/source/operations/rabbitmq.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
========
RabbitMQ
========

This guide covers common RabbitMQ operational checks and the response to an
alert caused by an uneven distribution of quorum queue leaders.

Routine checks
==============

Run these commands inside the RabbitMQ container on a controller:

.. code-block:: console

docker exec rabbitmq rabbitmqctl cluster_status

The cluster should contain every controller in ``Running Nodes`` and have no
network partitions or alarms. See :doc:`shutdown-and-startup` for the full
RabbitMQ checks used when stopping or starting the overcloud.
Comment on lines +17 to +19

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: In some clouds, rabbitmq is offloaded on different nodes, not the controllers. It might be worth mentioning that here?


Quorum queue leader distribution
================================

RabbitMQ quorum queues have a leader, and the leader handles operations for
the queue. Leaders should be spread across the RabbitMQ nodes. The
``RabbitMQConsumersLowUtilization`` alert may be raised when one node is not
the leader for any quorum queues, even when the RabbitMQ cluster itself is
healthy.

Check the number of quorum queue leaders on each node. Run this command on a
controller and replace the node names with the names in your cluster:

.. code-block:: console

docker exec rabbitmq rabbitmqctl list_queues name type leader | \
grep 'rabbit@<node-name>' | grep quorum | wc -l

Repeat the command for each RabbitMQ node. A large imbalance, particularly a
node with zero leaders, is the likely cause of the
``RabbitMQConsumersLowUtilization`` alert.

Rebalance the leaders of quorum queues from a controller:

.. code-block:: console

docker exec rabbitmq rabbitmq-queues rebalance quorum

The command reports the number of quorum queues assigned to each node. Confirm
that the result is reasonably even, then repeat the leader distribution checks
above. The exact counts depend on the number of queues and nodes in the
deployment.

After rebalancing, monitor the alert and check the RabbitMQ logs and service
dashboards. Run a Tempest check to confirm that OpenStack services using
RabbitMQ continue to operate normally.
Comment on lines +53 to +55

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could link to the tempest docs here to describe how to do that


Missing quorum queue replicas
=============================

Quorum queues should have a member on every RabbitMQ node. To find quorum
queues with fewer members than the cluster has nodes, run the following on a
controller. Replace ``3`` with the number of RabbitMQ nodes in the cluster:

.. code-block:: console

sudo docker exec rabbitmq rabbitmqctl list_queues name type members --formatter json | \
jq 'map(select(.type == "quorum") | select((.members // []) | length < 3))'
Comment on lines +66 to +67

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/sh
set -eu
docker exec rabbitmq rabbitmq-queues help grow
docker exec rabbitmq rabbitmq-queues help add_member

Repository: stackhpc/stackhpc-kayobe-config

Length of output: 213


🏁 Script executed:

#!/bin/sh
set -eu
printf '%s\n' '--- relevant documentation ---'
sed -n '55,105p' doc/source/operations/rabbitmq.rst
printf '%s\n' '--- repository references ---'
rg -n --hidden -S 'rabbitmq-queues|list_queues|add_member|grow' . -g '!*.git'

Repository: stackhpc/stackhpc-kayobe-config

Length of output: 11066


🌐 Web query:

RabbitMQ 3.13 rabbitmq-queues man page grow add_member vhost-pattern

💡 Result:

In RabbitMQ 3.13, the rabbitmq-queues command-line tool provides specific commands for managing quorum queue replicas. The grow and add_member commands serve different purposes in managing these replicas [1][2]. grow Command The grow command adds a new replica on a specified node for a set of quorum queues [1][2]. Syntax: rabbitmq-queues grow node selector [--vhost-pattern pattern] [--queue-pattern pattern] [--errors-only] Parameters: node: The target node (e.g., "rabbit@newhost") where the new replica should be added [1][2]. selector: Determines which queues to grow. Supported values include "all" (selects all quorum queues) and "even" (selects quorum queues with an even number of replicas) [2][3]. --vhost-pattern pattern: Optional. Filters the queues by virtual host using a pattern [1][2]. --queue-pattern pattern: Optional. Filters the queues by name using a pattern [1][2]. Example: rabbitmq-queues grow "rabbit@newhost" "all" --vhost-pattern "a-vhost" --queue-pattern ".*" [1][2] add_member Command The add_member command is used to add a quorum queue replica on a specific node for a single, designated queue [1][2]. Syntax: rabbitmq-queues add_member --vhost virtual-host queue node Parameters: --vhost virtual-host: Specifies the virtual host of the queue [1][2]. queue: The name of the quorum queue [1][2]. node: The target node where the replica should be added [1][2]. Example: rabbitmq-queues add_member --vhost "a-vhost" "a-queue" "rabbit@new-node" [1][2]

Citations:


🏁 Script executed:

#!/bin/sh
set -eu
printf '%s\n' '--- RabbitMQ 3.13 command documentation ---'
curl -fsSL https://raw.githubusercontent.com/rabbitmq/rabbitmq-website/main/versioned_docs/version-3.13/man/rabbitmq-queues.8.md |
  sed -n '/## grow/,/## /p;/## add_member/,/## /p' | head -220
printf '%s\n' '--- surrounding repository context ---'
sed -n '1,115p' doc/source/operations/rabbitmq.rst

Repository: stackhpc/stackhpc-kayobe-config

Length of output: 4521


🌐 Web query:

site:rabbitmq.com/docs/3.13/man/rabbitmq-queues.8 "add_member" "-p" "--vhost"

💡 Result:

The command add_member is a subcommand of the rabbitmq-queues tool, used to add a quorum queue member (replica) to a specific node in a RabbitMQ cluster [1]. The command usage is: rabbitmq-queues add_member --vhost [virtual-host] [queue] [node] The --vhost flag is used to specify the virtual host (vhost) where the target queue resides [1]. The -p flag is not a standard option for this specific subcommand as documented; the vhost is explicitly defined using the --vhost flag followed by the vhost name [1]. If a command is being used as add_member -p, it is possible that -p is being used as a shorthand for --vhost in some configurations or older versions, but the authoritative documentation uses --vhost [1].

Citations:


🏁 Script executed:

#!/bin/sh
set -eu
url='https://raw.githubusercontent.com/rabbitmq/rabbitmq-website/main/versioned_docs/version-3.13/man/rabbitmq-queues.8.md'
curl -fsSL "$url" |
  rg -n -C 8 'add_member|grow|vhost-pattern|queue-pattern|Usage|usage'

Repository: stackhpc/stackhpc-kayobe-config

Length of output: 5065


🌐 Web query:

RabbitMQ 3.13 rabbitmq-queues add_member --vhost source usage

💡 Result:

In RabbitMQ 3.13, the rabbitmq-queues add_member command is used to add a replica (member) of a quorum queue to a specific node [1][2]. The basic syntax for the command is: rabbitmq-queues add_member --vhost virtual-host queue-name node Arguments: --vhost virtual-host: Specifies the virtual host (vhost) where the target queue resides [1][3]. queue-name: The name of the quorum queue to which you are adding a member [1][2]. node: The name of the RabbitMQ node (e.g., rabbit@node-name) where the new replica should be hosted [1][2]. Example usage: rabbitmq-queues add_member --vhost "my-vhost" "my-queue" "rabbit@new-node" Alternative syntax: Some documentation also references the use of the -p flag as a shorthand for the vhost parameter [4][5]: rabbitmq-queues add_member -p virtual-host queue-name node Important Considerations: 1. Operational Requirements: You must have a quorum of existing replicas available in the cluster to successfully add a new member, as membership changes are treated as queue state changes [4][6]. 2. Purpose: This command is used to manually manage quorum queue replicas. When a new node is added to a cluster, it does not automatically host quorum queue replicas; they must be explicitly added by the operator using commands like add_member or grow [4][7].

Citations:


Use valid per-queue commands and preserve the vhost scope.

rabbitmq-queues grow accepts a node and a selector, not a queue name. Use add_member --vhost <vhost> <queue-name> rabbit@ctrl0 for one queue. Add -p <vhost> to list_queues and --vhost-pattern <vhost> to the bulk grow command so both operations target the same vhost.


The output lists the affected queues and their current members. For example,
a queue with only ``rabbit@ctrl0`` as a member is missing replicas on the
other nodes.

An upstream Kolla-Ansible change is intended to add missing quorum queue
members automatically: `review 973110
<https://review.opendev.org/c/openstack/kolla-ansible/+/973110>`__.
Until that change is available in the deployed Kolla-Ansible version, add the
Comment on lines +60 to +76

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift

Use configured replica targets instead of the cluster-node count.

Both sections treat a replica missing from any RabbitMQ node as a fault. RabbitMQ supports explicit quorum-queue group sizes and stream replica sets that can be smaller than the cluster. (rabbitmq.com)

  • doc/source/operations/rabbitmq.rst#L60-L76: compare quorum members with the configured group size and qualify the CMR behaviour.
  • doc/source/operations/rabbitmq.rst#L97-L106: repair only the intended stream replicas and avoid unconditional all-node growth.
📍 Affects 1 file
  • doc/source/operations/rabbitmq.rst#L60-L76 (this comment)
  • doc/source/operations/rabbitmq.rst#L97-L106

missing members manually. Run the following for each affected queue, replacing
``<queue-name>`` with its name and ``rabbit@ctrl0`` with the node to which the
queue should be added:

.. code-block:: console

sudo docker exec rabbitmq rabbitmq-queues grow rabbit@ctrl0 <queue-name>

For example, the abbreviated form used when growing all applicable queues is:

.. code-block:: console

sudo docker exec rabbitmq rabbitmq-queues grow rabbit@ctrl0 all

Re-run the inspection command afterwards and confirm that every quorum queue
has the expected number of members.

Missing stream replicas
=======================

After some upgrades, RabbitMQ streams may not have replicas across all
RabbitMQ nodes. The problem can appear in the logs as:

.. code-block:: text

Basic.consume: (406) PRECONDITION_FAILED - stream queue 'compute_fanout' in vhost '/' does not have a running replica on the local node

A proper fix is still a work in progress. In the meantime, resolve these
errors using the `RabbitMQ stream replica repair script
<https://gist.github.com/MoteHue/00ba4b85b8e708c46060e025deee8a78>`__.

After running the script, check the RabbitMQ logs and service dashboards to
confirm that the errors have stopped.

Recovery considerations
=======================

* Do not rebalance during a RabbitMQ outage or network partition. Resolve the
underlying cluster problem first.
* Rebalancing changes queue leadership and can create a short period of extra
RabbitMQ activity. Perform it during an appropriate maintenance window when
the deployment is busy.
Comment on lines +116 to +118

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Run leader rebalancing during a quiet maintenance window.

The phrase when the deployment is busy conflicts with the preceding warning about extra RabbitMQ activity. Replace it with when the deployment is quiet or during a low-activity maintenance window.

Proposed wording change
-  the deployment is busy.
+  the deployment is quiet.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Rebalancing changes queue leadership and can create a short period of extra
RabbitMQ activity. Perform it during an appropriate maintenance window when
the deployment is busy.
* Rebalancing changes queue leadership and can create a short period of extra
RabbitMQ activity. Perform it during an appropriate maintenance window when
the deployment is quiet.

* If the cluster has missing nodes, partitions, or alarms, follow the relevant
recovery procedure before attempting to rebalance. The
``rabbitmq-reset.yml`` playbook can reset a broken cluster, but it stops and
restarts OpenStack services and should only be used with an agreed outage
window.
Comment on lines +119 to +123

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "relevant recovery procedure" here is a bit vague. Can we make it clear that the process is either to run the rabbitmq-reset.yml playbook, or perform some other action that we can link to here?

10 changes: 3 additions & 7 deletions doc/source/operations/upgrading-openstack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@ Known issues
RabbitMQ
--------

After some upgrades, it has been seen that RabbitMQ streams do not have replicas across all RabbitMQ nodes.
Errors like this will be logged::

Basic.consume: (406) PRECONDITION_FAILED - stream queue 'compute_fanout' in vhost '/' does not have a running replica on the local node

A proper fix is still WIP, in the meantime these errors can be resolved with this script:
`<https://gist.github.com/MoteHue/00ba4b85b8e708c46060e025deee8a78>`__
After some upgrades, RabbitMQ streams may not have replicas across all
RabbitMQ nodes. See :doc:`rabbitmq` for the error to look for and the current
repair procedure.

ProxySQL
--------
Expand Down
Loading