-
Notifications
You must be signed in to change notification settings - Fork 4k
Make a minimal set of rabbitmq-queues CLI commands generic
#15226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ansd
wants to merge
2
commits into
main
Choose a base branch
from
da-queue-commands
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+378
−152
Conversation
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
ea977d5 to
987f288
Compare
987f288 to
0ee6143
Compare
29d16f7 to
a21a85c
Compare
## 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.
a21a85c to
3ea7761
Compare
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)
michaelklishin
approved these changes
Jan 9, 2026
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.