Commit Graph

596 Commits

Author SHA1 Message Date
Michael Klishin 3ffcb8fbb5 RMQ-1263 CLI tools: replace Erlang files with Elixir
otherwise we end up with two copies of the compiled
module on the code path some of the time.

We don't need to mix Erlang and Elixir even
more to bring in one constant that hasn't changed
since its introduction some eight years ago.

(cherry picked from commit c32b948258f226a86be91cab80448d7a536afd7d)
(cherry picked from commit 4bb21d7549)
2025-03-14 05:03:42 +00:00
Diana Parra Corbacho fd5909390e RMQ-1263: Add a --force option to rabbitmqctl delete_queue command
RMQ-1263: Add a --force option to rabbitmqctl delete_queue command.

This work was originally done by Iliia Khaprov <iliia.khaprov@broadcom.net>.

---------

Co-authored-by: Iliia Khaprov <iliia.khaprov@broadcom.net>
Co-authored-by: Michael Klishin <klishinm@vmware.com>
(cherry picked from commit d9522d3ee708250cc84443af5c3556b14f7c5ab9)
(cherry picked from commit d2f66ced1b)
2025-03-14 05:03:41 +00:00
Michael Klishin 643a58fdce
ctl import definitions: correct usage
it is likely a copy-paste artifact from
'ctl export_definitions' which does use '-'
as a target.

References #13157
2025-01-26 18:06:03 -05:00
Michael Klishin 6281dcb798
CLI commands for #12772 2025-01-02 18:35:31 -05:00
Michael Klishin 3f5b13d47f
Merge branch 'main' into mk-virtual-host-protection-from-accidental-deletion 2025-01-02 17:01:54 -05:00
Michael Klishin c95a95f822
CLI: mix format 2025-01-02 17:00:46 -05:00
Michael Klishin f62d46c286
Introduce a way to protect a virtual host from deletion
Accidental "fat finger" virtual deletion accidents
would be easier to avoid if there was a protection mechanism
that would apply equally even to CLI tools and external
applications that do not use confirmations for deletion
operations.

This introduce the following changes:

 * Virtual host metadata now supports a new queue,
   'protected_from_deletion', which, when set,
   will be considered by key virtual host deletion function(s)
 * DELETE /api/vhosts/{name} was adapted to handle
   such blocked deletion attempts to respond with
   a 412 Precondition Failed status
 * 'rabbitmqctl list_vhosts' and 'rabbitmqctl delete_vhost'
   were adapted accordingly
 * DELETE /api/vhosts/{name}/deletion/protection
   is a new endpoint that can be used to remove
   the protective seal (the metadata key)
 * POST /api/vhosts/{name}/deletion/protection
   marks the virtual host as protected

In the case of the HTTP API, all operations on
virtual host metadata require administrative
privileges from the target user.

Other considerations:

 * When a virtual host does not exist, the behavior
  remains the same: the original, protection-unaware
  code path is used to preserve backwards compatibility

References #12772.
2025-01-02 16:50:51 -05:00
Michael Klishin 968eefa1bb
Bump (c) line year
There are no functional changes to this massive diff.
2025-01-01 17:54:10 -05:00
Jean-Sébastien Pédron 58c609c4e7
rabbitmq_cli: Fix typo in an error message in `join_cluster` 2024-12-02 11:51:24 +01:00
Michael Klishin 1cae417dbf
Merge pull request #12821 from rabbitmq/rabbitmq-server-12776
Definition export: inject default queue type into virtual host metadata
2024-11-27 14:53:25 -05:00
Michael Klishin f377e8f9f0
Cosmetics 2024-11-27 12:44:17 -05:00
Michael Klishin 3e9c6a95df
Explain why list_vhosts does not list metadata such as DQT by default 2024-11-27 07:27:54 -05:00
Michael Klishin 93fd1dcda1
Drop release_series_support_status from overview and status
This undocumented key used to use a simple date-based
formula and used to help support and the core
team.

Nodes no longer have the context to return
a correct response, so all we can do is drop this
key.
2024-11-24 17:56:57 -05:00
Michael Klishin 94c8f01699
rabbitmq-diagnostics status: handle output of 3.13.x and previously released 4.0.x nodes
In a mixed cluster environment,
'rabbitmq-diagnostics status' can hit a node
that does not return any node tags.

Be more defensive and handle such cases
by simply displaying "(none)" for such
values.
2024-11-11 17:41:33 -05:00
Simon Unge 3d35416635 Node tags local to broker, add to /api/overview output and ctl status command 2024-11-11 20:49:21 +00:00
Simon Unge eeea517da5 Store tags in global parameters 2024-11-08 21:41:49 +00:00
Simon Unge f5ef64ad06 Add cluster tag config that is exposed via HTTP /api/overview and CTL cluster_status 2024-11-08 21:05:02 +00:00
Michael Klishin 80f4797e76 Remove multiple mentions of global prefetch
As suggested by @johanrhodin in #12454.

This keeps the Prometheus plugin part but
marks it as deprecated. We can remove it in
4.1.
2024-10-04 20:47:37 -04:00
Michael Klishin 47210c8307
cli enable_feature_flag: alias --experimental as --opt-in
--experimental is no longer particularly fair to Khepri,
which is not enabled by default because of its enormous
scope, and because once enabled, it cannot be disabled.

--opt-in would be a better name but --experimental
remains for backwards compatiblity.

When both are specified, we consider that the
user opts in if at least one of the flags is
set to true.
2024-09-17 19:08:28 -04:00
David Ansari f78f14ab1d Display container-id in the UI and CLI 2024-09-13 17:05:46 +02:00
Michal Kuratczyk 9b828c08b7
Remove HiPE 2024-08-28 09:18:28 +02:00
Michael Davis dc611dd45c
Non-zero exit code for failing to enable an experimental feature flag
With the prior behavior it can be unclear whether the text was a warning
and the feature flag was enabled anyways. We can use a non-zero exit
code and the `{:error, code, text}` return value to make it clear that
the flag wasn't enabled.
2024-08-20 16:03:29 -04:00
Michael Davis f0c0cf8052
enable_feature_flag CLI: Fix typo in usage message 2024-08-20 15:25:20 -04:00
Michal Kuratczyk 396ad7af1a Reject `--experimental all` 2024-08-19 13:41:37 -04:00
Michal Kuratczyk ddb117f810 `-f` -> `-e`; drop unneeded cases; typos
Also, remove the `undef` case which was only needed for
RabbitMQ 3.7 and older.
2024-08-19 13:41:37 -04:00
Michal Kuratczyk e3302f2f9a Rename --force to --experimental
Plus, a slightly more scary error message
2024-08-19 13:41:37 -04:00
Michal Kuratczyk 58e0c1600f Require --force to enable experimental FF 2024-08-19 13:41:37 -04:00
Michael Klishin bd1e953b95 Configuration value encryption CLI commands: unconditionally print stack traces 2024-08-13 14:31:55 -04:00
Michael Klishin e1490c6d9c More CLI commands for tagged values 2024-08-13 14:26:02 -04:00
Michael Klishin c2fdd73c4b Secret encoding: refine CLI tools
'ctl encode' is unfortunately name and targets
advanced.config commands.

This introduce a command that targets 'rabbitmq.conf'
values and has a more specific name.

Eventually 'ctl encode' will be aliased and deprecated,
although we still do not have an aliasing mechanism
and it won't be in scope for 4.0.
2024-08-13 12:29:28 -04:00
Diana Parra Corbacho a8dcca084a rabbit_definitions: ensure federation-upstream-set parameters are exported
These parameters are not proplists but a list of maps
2024-07-04 12:41:34 +02:00
Loïc Hoguin 2a64a0f6c8
Restore FD info in rabbitmqctl status
The FD limits are still valuable.

The FD used will still show some information during CQv1
upgrade to v2 so it is kept for now. But in the future
it will have to be reworked to query the system, or be
removed.
2024-06-24 12:07:51 +02:00
Loïc Hoguin 49bedfc17e
Remove most of the fd related FHC code
Stats were not removed, including management UI stats
relating to FDs.

Web-MQTT and Web-STOMP configuration relating to FHC
were not removed.

The file_handle_cache itself must be kept until we
remove CQv1.
2024-06-24 12:07:51 +02:00
Michael Klishin 27269b7399 CLI: mix format 2024-06-06 21:21:26 -04:00
Michael Klishin 6e41d3e6e6 Introduce 'rabbitmqctl reconcile_vhosts' 2024-06-06 21:21:26 -04:00
Michael Klishin 41e5d38b94 rabbitmq-diagnostics status: drop date-based support status field
As of [1], this field has become irrelevant or even
misleading.

1. https://www.rabbitmq.com/blog/2024/05/31/new-community-support-policy
2024-06-05 23:20:35 -04:00
Diana Parra Corbacho 3bbda5bdba Remove classic mirror queues 2024-06-04 13:00:31 +02:00
Aaron Seo 652da0ebaa
Add type info_key for list_unresponsive_queues
In the rabbitmqctl docs for list_unresponsive_queues, `type` is listed as
a queueinfoitem parameter, but this is not reflected in the source code.
This  commit adds `type` as a queueinfoitem parameter for list_unresponsive_queues.
2024-04-24 20:11:18 +00:00
Michael Klishin 91def1edb5
ctl delete_queue: mention [--vhost <name>] explicitly
in the usage description.

It is already mentioned in the General Options section
below but apparently not everyone reads it.
2024-02-27 13:16:22 -05:00
Michael Klishin f414c2d512
More missed license header updates #9969 2024-02-05 11:53:50 -05:00
Michael Davis c285651636
Resolve elixirc warnings
* Remove unused aliases/imports
* Remove or underscore unused bindings
* Fix variables that should be atoms (`unavailable` -> `:unavailable`)

Also, `Logger.warn/1` has been replaced by `Logger.warning/1`. It should
be safe to just replace the call with `Logger.warning/1` since it's
been in the standard library since Elixir 1.11.
2024-02-01 16:30:14 -05:00
Karl Nilsson 71e7c33448 Stream coordinator: fixes to automatic membership changes.
Various bug fixes to make stream coordinator membership changes
more reliable. Previously various errors could happen as well as
partially successful attempts where the membership change command
may fail but it leaves the new server running.

Also ensure that stream coordinator members are removed as part of
the forget_cluster_node command.

Add stream coordinator status command.

To show the raft status of the stream coordinator just like is done
for quorum queues.
2024-01-24 11:02:42 +00:00
Michael Klishin c1d37e3e02
Merge pull request #10364 from rabbitmq/flaky-mc-flake-flake
Reduce flakiness of certain Common Test suites
2024-01-22 16:22:24 -05:00
Karl Nilsson 60f9f3ce56 Wait command: loop when file read returns the empty binary.
As writing to a file isn't atomic between opening and writing this
can happen and would unnecessarily return the :garbage_in_pid_file
error.
2024-01-22 15:51:24 +00:00
Karl Nilsson 5266902caf garbage 2024-01-22 15:27:35 +00:00
Diana Parra Corbacho 2171b5abe5 Mix format 2024-01-19 11:22:16 -05:00
Diana Parra Corbacho c9c4574dd0 Update rabbitmqctl tests for rename/update cluster nodes 2024-01-19 11:22:16 -05:00
Michael Klishin 06ca99c3ab Fix CLI tools dialyzer 2024-01-19 11:22:16 -05:00
Michael Klishin b2180a558b Make rabbitmqctl rename_cluster_node's friend, update_cluster_nodes, a no-op 2024-01-19 11:22:16 -05:00
Michael Klishin 1556fec127 Make 'rabbitmqctl rename_cluster_node' a no-op
This makes a command that renames cluster members
a no-op. This command is really complex under
the hood and is fundamentally incompatible
with a few key Raft-based features:

 * Khepri
 * Quorum queues
 * Streams

Because Khepri first ships in RabbitMQ 3.13,
now is the time to effectively eliminate this
command.

It will be permanently removed together with
other deprecated CLI commands in 4.0.

Per discussion with the team.

Closes #10367.
2024-01-19 11:22:16 -05:00