Make a minimal set of rabbitmq-queues CLI commands generic#15226
Merged
Conversation
ea977d5 to
987f288
Compare
987f288 to
0ee6143
Compare
a21a85c to
3ea7761
Compare
michaelklishin
approved these changes
Jan 9, 2026
Ayanda-D
reviewed
Jan 15, 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 ``` ## 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.
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)
Apply PR feedback from #15226 (comment)
fbc5c5f to
e94beb8
Compare
ansd
added a commit
that referenced
this pull request
Jan 20, 2026
This CLI command applies to all Ra based queue types going forward, not only to quorum queues (see #15226)
ansd
added a commit
that referenced
this pull request
Jan 21, 2026
This commit makes `rabbit_queue_type_ra:add_member/5` and `rabbit_queue_type_ra:delete_member/3` idempotent by returning `ok` if the member is already added or already deleted. `quorum_queue_SUITE` now uses `rabbit_queue_type_ra` like the CLI commands. This commit is a follow-up of #15226
ansd
added a commit
that referenced
this pull request
Jan 21, 2026
This commit makes `rabbit_queue_type_ra:add_member/5` and `rabbit_queue_type_ra:delete_member/3` idempotent by returning `ok` if the member is already added or already deleted. `quorum_queue_SUITE` now uses `rabbit_queue_type_ra` like the CLI commands. This commit is a follow-up of #15226
michaelklishin
pushed a commit
that referenced
this pull request
Feb 24, 2026
* Make a minimal set of `rabbitmq-queues` CLI commands generic ## 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. * Introduce rabbit_queue_type_ra for Ra-based queue types 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) * Remove duplicate code Apply PR feedback from #15226 (comment)
michaelklishin
pushed a commit
that referenced
this pull request
Feb 24, 2026
This CLI command applies to all Ra based queue types going forward, not only to quorum queues (see #15226)
michaelklishin
pushed a commit
that referenced
this pull request
Feb 24, 2026
This commit makes `rabbit_queue_type_ra:add_member/5` and `rabbit_queue_type_ra:delete_member/3` idempotent by returning `ok` if the member is already added or already deleted. `quorum_queue_SUITE` now uses `rabbit_queue_type_ra` like the CLI commands. This commit is a follow-up of #15226
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This commit makes the following
rabbitmq-queuesCLI commands queuetype generic such that they do not only work against quorum queues, but
also against other (replicated or Ra based) queue types:
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:
The following CLI commands stay quorum queue specific:
Command
rabbitmq-queues force_checkpointwill be a no-op starting in 4.3 thanks to Ra v3.The following CLI commands are made queue type generic:
Adding a member, deleting a member, and getting the status for a queue
are the most essential commands. Commands
growandshrinkare onlywrappers for
add_memberanddelete_member. Arguably, a simple bashscript is sufficient to call
add_memberordelete_membermultipletimes. But for consistency and convenience this commit decides to make
growandshrinkalso generic.These CLI commands call from now on into
rabbit_queue_type_rainstead ofcalling 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_statusagainst 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:
Unfortunately, they contain
quorumin the HTTP path and also containquorum 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.