Skip to content

Conversation

@ansd
Copy link
Member

@ansd ansd commented Jan 8, 2026

What?

This commit makes the following rabbitmq-queues CLI commands queue
type generic such that they do not only work against quorum queues, but
also against other (replicated or Ra based) queue types:

rabbitmq-queues add_member
rabbitmq-queues delete_member
rabbitmq-queues quorum_status
rabbitmq-queues grow
rabbitmq-queues shrink

This PR is a subset of what was aimed for in #14119.

Why?

Plugins may introduce other Ra based queue types which should
also support above CLI commands. Instead of creating new queue type
specific CLI commands, it's more user friendly if above existing CLI
commands work with the new queue types.

How?

The following queue based CLI commands already work against multiple
queue types:

rabbitmqctl list_queues
rabbitmqctl purge_queue
rabbitmqctl delete_queue
rabbitmqctl list_unresponsive_queues
rabbitmq-queues rebalance
rabbitmq-queues check_if_node_is_quorum_critical

The following CLI commands stay quorum queue specific:

rabbitmq-queues check_if_new_quorum_queue_replicas_have_finished_initial_sync
rabbitmq-queues peek
rabbitmq-queues reclaim_quorum_memory
rabbitmq-diagnostics check_for_quorum_queues_without_an_elected_leader_command
rabbitmq-queues force_checkpoint

Command rabbitmq-queues force_checkpoint will be a no-op starting in 4.3 thanks to Ra v3.

The following CLI commands are made queue type generic:

rabbitmq-queues add_member
rabbitmq-queues delete_member
rabbitmq-queues quorum_status
rabbitmq-queues grow
rabbitmq-queues shrink

Adding a member, deleting a member, and getting the status for a queue
are the most essential commands. Commands grow and shrink are only
wrappers for add_member and delete_member. Arguably, a simple bash
script is sufficient to call add_member or delete_member multiple
times. But for consistency and convenience this commit decides to make
grow and shrink also generic.

These CLI commands call from now on into rabbit_queue_type_ra instead of
calling into rabbit_quorum_queue.

This commit also ensures that the CLI commands are mixed version
compatible. In a mixed version 4.3 / 4.2 cluster, both a 4.3 CLI
and a 4.2 CLI should be able to execute for example
rabbitmq-queues quorum_status against either 4.3 or 4.2 nodes.

Making the following quorum queue specific HTTP API endpoints queue type generic
is out of scope in this commit:

/queues/quorum/:vhost/:queue/status
/queues/quorum/:vhost/:queue/replicas/add
/queues/quorum/:vhost/:queue/replicas/delete
/queues/quorum/replicas/on/:node/grow
/queues/quorum/replicas/on/:node/shrink

Unfortunately, they contain quorum in the HTTP path and also contain
quorum queue specific configuration variables, such as "restriction" quorum_queue_replica_operations.
It's up for discussion whether these same HTTP endpoints should be made
queue type generic or whether new HTTP endpoints should be introduced for new
queue types.

@ansd ansd force-pushed the da-queue-commands branch 5 times, most recently from ea977d5 to 987f288 Compare January 9, 2026 10:41
@ansd ansd added this to the 4.3.0 milestone Jan 9, 2026
@ansd ansd self-assigned this Jan 9, 2026
@ansd ansd force-pushed the da-queue-commands branch from 987f288 to 0ee6143 Compare January 9, 2026 10:58
@ansd ansd marked this pull request as ready for review January 9, 2026 12:41
@ansd ansd marked this pull request as draft January 9, 2026 13:30
@ansd ansd force-pushed the da-queue-commands branch from 29d16f7 to a21a85c Compare January 9, 2026 13:32
 ## What?

This commit makes the following `rabbitmq-queues` CLI commands queue
type generic such that they do not only work against quorum queues, but
also against other (replicated or Ra based) queue types:
```
rabbitmq-queues add_member
rabbitmq-queues delete_member
rabbitmq-queues quorum_status
rabbitmq-queues grow
rabbitmq-queues shrink
```

 ## Why?

Plugins may introduce other Ra based queue types which should
also support above CLI commands. Instead of creating new queue type
specific CLI commands, it's more user friendly if above existing CLI
commands work with the new queue types.

 ## How?

The following queue based CLI commands already work against multiple
queue types:
```
rabbitmqctl list_queues
rabbitmqctl purge_queue
rabbitmqctl delete_queue
rabbitmqctl list_unresponsive_queues
rabbitmq-queues rebalance
rabbitmq-queues check_if_node_is_quorum_critical
```

The following CLI commands stay quorum queue specific:
```
rabbitmq-queues check_if_new_quorum_queue_replicas_have_finished_initial_sync
rabbitmq-queues peek
rabbitmq-queues reclaim_quorum_memory
rabbitmq-diagnostics check_for_quorum_queues_without_an_elected_leader_command
rabbitmq-queues force_checkpoint
```
Command `rabbitmq-queues force_checkpoint` will be a no-op starting in 4.3 thanks to Ra v3.

The following CLI commands are made queue type generic:
```
rabbitmq-queues add_member
rabbitmq-queues delete_member
rabbitmq-queues quorum_status
rabbitmq-queues grow
rabbitmq-queues shrink
```
Adding a member, deleting a member, and getting the status for a queue
are the most essential commands. Commands `grow` and `shrink` are only
wrappers for `add_member` and `delete_member`. Arguably, a simple bash
script is sufficient to call `add_member` or `delete_member` multiple
times. But for consistency and convenience this commit decides to make
`grow` and `shrink` also generic.

These CLI commands call from now on into `rabbit_queue_type` instead of
calling into `rabbit_quorum_queue`.

`rabbit_queue_type` is getting more and more bloated. Therefore, in
future, we should ideally split the `rabbbit_queue_type` module into two modules:
One for a message flow related API, e.g. enqueue, checkout, settle (for stateful interactions)
and one for queue topology management/observability API (for stateless interactions).

This commit also ensures that the CLI commands are mixed version
compatible. In a mixed version 4.3 / 4.2 cluster, both a 4.3 CLI
and a 4.2 CLI should be able to execute for example
`rabbitmq-queues quorum_status` against either 4.3 or 4.2 nodes.

Making the following quorum queue specific HTTP API endpoints queue type generic
is out of scope in this commit:
```
/queues/quorum/:vhost/:queue/status
/queues/quorum/:vhost/:queue/replicas/add
/queues/quorum/:vhost/:queue/replicas/delete
/queues/quorum/replicas/on/:node/grow
/queues/quorum/replicas/on/:node/shrink
```
Unfortunately, they contain `quorum` in the HTTP path and also contain
quorum queue specific configuration variables, such as "restriction" `quorum_queue_replica_operations`.
It's up for discussion whether these same HTTP endpoints should be made
queue type generic or whether new HTTP endpoints should be introduced for new
queue types.
@ansd ansd force-pushed the da-queue-commands branch from a21a85c to 3ea7761 Compare January 9, 2026 13:33
This commit refactors the Ra-specific queue operations introduced in the
previous commit into a dedicated module.

This design is cleaner because:

- `rabbit_queue_type` stays generic for all queue types
- `rabbit_queue_type_ra` is specific to Ra-based queue types
- Clear semantics: `rabbitmq-streams` commands call `rabbit_stream_queue`
  directly (stream-specific), while `rabbitmq-queues` commands call
  `rabbit_queue_type_ra` (for all Ra-based queue types)
@ansd ansd marked this pull request as ready for review January 9, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants