Skip to content

DO NOT MERGE: QQ AZ awareness#16739

Draft
mkuratczyk wants to merge 5 commits into
mainfrom
qq-az-awareness
Draft

DO NOT MERGE: QQ AZ awareness#16739
mkuratczyk wants to merge 5 commits into
mainfrom
qq-az-awareness

Conversation

@mkuratczyk

Copy link
Copy Markdown
Contributor

Implements AZ-aware membership placement for quorum queues.

Until now, if there's more nodes than QQ members requested, we put one member locally (where the queue is declared) and the other members would be assigned randomly to other nodes, preferring nodes running at the time of declaration.

With this change, you can tag nodes using the existing node_tags feature and specify the tag used as the az information.
For example:

node_tags.az = az1

AZ awareness can be enabled:

  • on the cluster level, using: rabbit.quorum_queue_member_placement_tag=az
  • on the queue argument level: member-placement-tag=az
  • using a policy/operator policy: x-member-placement-tag=az

When either of these is in effect, we'll make sure that members are evenly spread between nodes with different tag values.

For example, with 7 nodes, 3 tagged with az = az1, 2 with az = az2 and 2 with az = az3, all 3-member quorum queues will have one member in az1, one in az2 and one in az3. The distribution of members between nodes within the same AZ remains as before: up to the limit (default of 1000 queues), we make it perfectly even, and if there's more queues - we start to assign nodes randomly (still taking AZ into consideration to be clear).

@mkuratczyk mkuratczyk added the do-not-backport Changes not meant to be backported to release branches label Jun 19, 2026
@mergify mergify Bot added the make label Jun 19, 2026
@mkuratczyk mkuratczyk force-pushed the qq-az-awareness branch 4 times, most recently from 434baeb to 7f350f5 Compare June 22, 2026 10:39
Comment thread deps/rabbit/src/rabbit_member_placement.erl
This should be completely transparent for most
users. However, this allows easily testing AZ-aware
quorum queue placement in a local environment.
Introduce `rabbit_db_node_metadata` to store generic node-specific metadata
in Khepri and query it locally via an ETS-backed projection.
Introduce a pluggable quorum queue member placement strategy behaviour
and implement `rabbit_member_placement_az` to distribute replicas across
distinct values of a configured node tag, querying tags locally from Khepri.
Include the availability zone (AZ) of each replica in the quorum_status output
when a member placement tag is configured on the queue.
Expose the `x-member-placement-tag` argument in the management UI for
quorum queues, operator policies, and user policies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-backport Changes not meant to be backported to release branches make

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants