Commit Graph

1132 Commits

Author SHA1 Message Date
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 cdff2ae66a Handle timeout_waiting_for_khepri_projections on cli commands 2024-07-18 16:08:21 +02:00
Michael Klishin 5346339655 Squash two more deprecated CMQ-related CLI command warnings 2024-07-15 12:38:01 -04:00
Michael Klishin 8de26fbc03 Fix two warnings in a deprecated CMQ-related CLI command 2024-07-15 12:38:01 -04:00
Michal Kuratczyk e1b649c0c6 check_if_node_is_mirror_sync_critical is no-op
Make `check_if_node_is_mirror_sync_critical` a no-op
with a deprecation warning. Since this command is commonly used
as part of the node shutdown process (eg. by Cluster Operator),
making it a no-op instead of removing completly will make the
transition to 4.0 easier for users.
2024-07-15 12:38:01 -04:00
Michael Davis 88c1ad2f6e
Adapt to new `{error, timeout}` return value in Khepri 0.14.0
See rabbitmq/khepri#256.
2024-07-10 16:07:43 -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
Michael Klishin a21a60958b CLI: placate Dialyzer 2024-05-08 23:33:36 -04:00
Michael Klishin 4a3806bd18 Makes PluginsFormatterTest pass 2024-05-08 20:03:29 -04:00
Péter Gömöri 69eb2b9c29 Don't show disabled plugins as pending upgrade
Since commit c0187ec15 the value of `running_version` is converted
to_string (`nil` would become the empty string). But the formatter
expected `running_version` to be `nil` if the plugin is not
running. This did not match and not running/not enabled plugins were
marked incorrectly as "pending upgrade to...".

For example:
```
$ rabbitmq-plugins list trust -q
[  ] rabbitmq_trust_store               (pending upgrade to 3.13.0+51.g9145b53)

$ rabbitmq-plugins list trust --formatter erlang -q
 #{status => running,format => normal,
  plugins =>
      [#{enabled => not_enabled,name => rabbitmq_trust_store,running => false,
         version => <<"3.13.0+51.g9145b53">>,running_version => <<>>}]}
```
2024-05-08 08:23:21 +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
Ayanda Dube 9391e48b30 test plugin list supressed warnings, refs: #10865 and #10870 2024-03-28 12:46:19 +00:00
Michael Klishin c0187ec155 Reuse --silent and --quiet in #10865 2024-03-27 21:36:53 -04:00
Michael Klishin eb261acd30
CLI: update guide URLs to use the new path structure
the original paths, e.g. /streams.html, do have redirects
in place but it turned out to be a surprisingly fragile
Cloudflare feature when there are hundreds of them,
so we better switch now.
2024-03-07 15:53:14 -05: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
Michael Klishin 4641e66c85
Merge pull request #10426 from rabbitmq/amazon-mq-global-quorum-critical
New upgrade time QQ health check: add check_if_new_quorum_queue_replicas_have_finished_initial_sync by @illotum (plus a test)
2024-01-26 23:08:26 -05:00
Michael Klishin c4ae6f30b0
Basic tests for the new CLI command #10304 2024-01-26 20:29:03 -05:00
Alex Valiushko 2177d4a5c8 add ability to list queues with local promotable replicas 2024-01-24 12:25:39 -08:00
Karl Nilsson f038ae0d06 formatting 2024-01-24 11:28:41 +00: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 d9a8c2d964
Merge pull request #10393 from ariel-anieli/pr-os-name
Removed extra clause in platform.os_name/1
2024-01-22 18:34:29 -05:00
Ariel Otilibili 9868c919c8 Removed extra clause in platform.os_name/1
* platform.os_name/1 parses output of :rabbit.status/1
* :rabbit.status/1 get its `os` key from :os.type/0
* :linux already matched by `platform.os_name({:unix, name})`.
2024-01-22 22:28:06 +01: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
Michael Klishin 79d52b9b5d CLI: mix format 2024-01-16 00:13:41 -05:00
Michael Klishin 48ce1b5ec7 Improve supported information units (Mi, Gi, Ti)
This revisits the information system conversion,
that is, support for suffixes like GiB, GB.

When configuration values like disk_free_limit.absolute,
vm_memory_high_watermark.absolute are set, the value
can contain an information unit (IU) suffix.

We now support several new suffixes and the meaning
a few more changes.

First, the changes:

 * k, K now mean kilobytes and not kibibytes
 * m, M now mean megabytes and not mebibytes
 * g, G now means gigabytes and not gibibytes

This is to match the system used by Kubernetes.
There is no consensus in the industry about how
"k", "m", "g", and similar single letter suffixes
should be treated. Previously it was a power of 2,
now a power of 10 to align with a very popular OSS
project that explicitly documents what suffixes it supports.

Now, the additions:

Finally, the node will now validate these suffixes
at boot time, so an unsupported value will cause
the node to stop with a rabbitmq.conf validation
error.

The message logged will look like this:

````
2024-01-15 22:11:17.829272-05:00 [error] <0.164.0> disk_free_limit.absolute invalid, supported formats: 500MB, 500MiB, 10GB, 10GiB, 2TB, 2TiB, 10000000000
2024-01-15 22:11:17.829376-05:00 [error] <0.164.0> Error preparing configuration in phase validation:
2024-01-15 22:11:17.829387-05:00 [error] <0.164.0>   - disk_free_limit.absolute invalid, supported formats: 500MB, 500MiB, 10GB, 10GiB, 2TB, 2TiB, 10000000000
````

Closes #10310
2024-01-15 22:11:57 -05:00
Ariel Otilibili 09b4be92f6 Removed ASCII escape codes if not enabled; fixes #2634
https://hexdocs.pm/elixir/IO.ANSI.html#format/2
2024-01-10 01:04:12 +01:00
Ariel Otilibili a9e488dbed
Fix for #8557, removed ANSI codes in JSON output
Add missing newline chars
2024-01-09 09:15:14 -08:00
Karl Nilsson 972e78b9d3 Avoid some cluster wide calls in cluster_status command. 2023-12-13 09:28:21 +00:00
Diana Parra Corbacho a363737337 CLI: list_deprecated_features command
Lists all or used deprecated features
2023-12-11 12:51:13 +01:00
Michael Klishin 9d94048852 Avoid importing resources without specified virtual host
On boot first and foremost. Log a more helpful message.

 See #10068 for the background.
2023-12-08 02:35:17 -05:00
Michael Klishin 5caad16366
Make 'ctl node_health_check' a no-op
It's been deprecated over three years ago [1]
(before RabbitMQ 3.9).

1. e01753ed7a
2023-11-23 18:18:25 -05:00
Michael Klishin 1b642353ca
Update (c) according to [1]
1. https://investors.broadcom.com/news-releases/news-release-details/broadcom-and-vmware-intend-close-transaction-november-22-2023
2023-11-21 23:18:22 -05:00
Michal Kuratczyk 5459975c5c
Revert "Use rabbit_json in the CLI"
This reverts commit 6c65715875.
2023-11-17 13:05:38 +01:00
Michal Kuratczyk 6c65715875
Use rabbit_json in the CLI
dep_json doesn't seem to be maintained
and it's unnecessary anyway, since we can
use rabbit_json, which uses thoas
2023-11-16 00:01:14 +01:00
Michael Klishin 229a9fb7bd
list_policies_that_match: correctly format 'not found' errors as JSON 2023-11-13 21:35:48 -05:00
Michael Klishin 1ff5f6077b
mix format 2023-11-13 21:18:27 -05:00
Michael Klishin fd0488516b
diagnostics list_policies_that_match: support JSON formatting 2023-11-13 20:46:06 -05:00
Michael Klishin c4db560e0e
CLI: mix format 2023-11-13 11:21:29 -05:00
Michal Kuratczyk 408c33ec49
Add list_policies_that_match command 2023-11-13 13:47:54 +01:00
Michael Klishin a88c22144d CLI: mix format 2023-11-06 23:03:41 -05:00
Michael Klishin 114f9b90c9 CLI: refactor 'diagnostics check_if_any_deprecated_features_are_used' 2023-11-06 22:50:35 -05:00
Diana Parra Corbacho 51783e9464 CLI: check if any deprecated features are used returns just the list of features 2023-11-06 17:45:11 +01:00
Michael Klishin cbe2756cbd CLI: tests and refactoring for 'diagnostics check_if_cluster_has_classic_queue_mirroring_policy' 2023-11-06 07:20:08 -05:00
Michael Klishin 827b495d1a CLI: wording 2023-11-06 07:20:08 -05:00
Michael Klishin b725bba735 CLI: add a test for 'ctl remove_classic_queue_mirroring_from_policies' 2023-11-06 07:20:08 -05:00
Diana Parra Corbacho 6288e9aa2c CTL: check if any deprecated features are used command 2023-11-06 07:20:08 -05:00
Diana Parra Corbacho 13e88ced92 Use Diagnostics group 2023-11-06 07:20:08 -05:00
Michael Klishin ae934d9ebc CLI: mix format 2023-11-06 07:20:08 -05:00
Diana Parra Corbacho 70c97be06c CLI: command to remove all classic queue mirroring policies 2023-11-06 07:20:08 -05:00
Diana Parra Corbacho a06698d43d CLI: command to check if cluster has a classic queue mirroring policy 2023-11-06 07:20:08 -05:00
Diana Parra Corbacho 8df94cc13c CLI: commands to list policies / operator policies with CMQ
rabbitmq-queues list_operator_policies_with_classic_queue_mirroring
rabbitmq-queues list_policies_with_classic_queue_mirroring
2023-11-06 07:20:08 -05:00
Jean-Sébastien Pédron b15eb0ff1b
rabbit_db: `join/2` now takes care of stopping/starting RabbitMQ
[Why]
Up until now, a user had to run the following three commands to expand a
cluster:
1. stop_app
2. join_cluster
3. start_app

Stopping and starting the `rabbit` application and taking care of the
underlying Mnesia application could be handled by `join_cluster`
directly.

[How]
After the call to `can_join/1` and before proceeding with the actual
join, the code remembers the state of `rabbit`, the Feature flags
controler and Mnesia.

After the join, it restarts whatever needs to be restarted to. It does
so regardless of the success or failure of the join. One exception is
when the node switched from Mnesia to Khepri as part of that join. In
this case, Mnesia is left stopped.
2023-10-26 11:22:47 +02:00
Michael Klishin 6d3f008336
CLI: mix format 2023-10-10 09:24:29 -04:00
Michael Klishin 17fded2e12
CLI: support for pre-hashed passwords
Providing a pre-hashed and salted password is
not significantly more secure but satisfies those
who cannot pass clear text passwords on the command
line for regulatory reasons.

Note that the optimal way of seeding users is still
definition import on node boot, not scripting with
CLI tools.

Closes #9166
2023-10-09 23:52:34 -04:00
Michael Klishin 856f56ea0b
ctl: add support for providing pre-hashed passwords (WIP) 2023-10-09 23:52:34 -04:00
Alex Valiushko 4df3080fa1 New quorum queue members join as temporary non-voters
Because both `add_member` and `grow` default to Membership status `promotable`,
new members will have to catch up before they are considered cluster members.
This can be overridden with either `voter` or (permanent `non_voter` statuses.
The latter one is useless without additional tooling so kept undocumented.

- non-voters do not affect quorum size for election purposes
- `observer_cli` reports their status with lowercase 'f'
- `rabbitmq-queues check_if_node_is_quorum_critical` takes voter status into
account
2023-10-04 11:14:07 -07:00
Diana Parra Corbacho 5f0981c5a3
Allow to use Khepri database to store metadata instead of Mnesia
[Why]

Mnesia is a very powerful and convenient tool for Erlang applications:
it is a persistent disc-based database, it handles replication accross
multiple Erlang nodes and it is available out-of-the-box from the
Erlang/OTP distribution. RabbitMQ relies on Mnesia to manage all its
metadata:

* virtual hosts' properties
* intenal users
* queue, exchange and binding declarations (not queues data)
* runtime parameters and policies
* ...

Unfortunately Mnesia makes it difficult to handle network partition and,
as a consequence, the merge conflicts between Erlang nodes once the
network partition is resolved. RabbitMQ provides several partition
handling strategies but they are not bullet-proof. Users still hit
situations where it is a pain to repair a cluster following a network
partition.

[How]

@kjnilsson created Ra [1], a Raft consensus library that RabbitMQ
already uses successfully to implement quorum queues and streams for
instance. Those queues do not suffer from network partitions.

We created Khepri [2], a new persistent and replicated database engine
based on Ra and we want to use it in place of Mnesia in RabbitMQ to
solve the problems with network partitions.

This patch integrates Khepri as an experimental feature. When enabled,
RabbitMQ will store all its metadata in Khepri instead of Mnesia.

This change comes with behavior changes. While Khepri remains disabled,
you should see no changes to the behavior of RabbitMQ. If there are
changes, it is a bug. After Khepri is enabled, there are significant
changes of behavior that you should be aware of.

Because it is based on the Raft consensus algorithm, when there is a
network partition, only the cluster members that are in the partition
with at least `(Number of nodes in the cluster ÷ 2) + 1` number of nodes
can "make progress". In other words, only those nodes may write to the
Khepri database and read from the database and expect a consistent
result.

For instance in a cluster of 5 RabbitMQ nodes:
* If there are two partitions, one with 3 nodes, one with 2 nodes, only
  the group of 3 nodes will be able to write to the database.
* If there are three partitions, two with 2 nodes, one with 1 node, none
  of the group can write to the database.

Because the Khepri database will be used for all kind of metadata, it
means that RabbitMQ nodes that can't write to the database will be
unable to perform some operations. A list of operations and what to
expect is documented in the associated pull request and the RabbitMQ
website.

This requirement from Raft also affects the startup of RabbitMQ nodes in
a cluster. Indeed, at least a quorum number of nodes must be started at
once to allow nodes to become ready.

To enable Khepri, you need to enable the `khepri_db` feature flag:

    rabbitmqctl enable_feature_flag khepri_db

When the `khepri_db` feature flag is enabled, the migration code
performs the following two tasks:
1. It synchronizes the Khepri cluster membership from the Mnesia
   cluster. It uses `mnesia_to_khepri:sync_cluster_membership/1` from
   the `khepri_mnesia_migration` application [3].
2. It copies data from relevant Mnesia tables to Khepri, doing some
   conversion if necessary on the way. Again, it uses
   `mnesia_to_khepri:copy_tables/4` from `khepri_mnesia_migration` to do
   it.

This can be performed on a running standalone RabbitMQ node or cluster.
Data will be migrated from Mnesia to Khepri without any service
interruption. Note that during the migration, the performance may
decrease and the memory footprint may go up.

Because this feature flag is considered experimental, it is not enabled
by default even on a brand new RabbitMQ deployment.

More about the implementation details below:

In the past months, all accesses to Mnesia were isolated in a collection
of `rabbit_db*` modules. This is where the integration of Khepri mostly
takes place: we use a function called `rabbit_khepri:handle_fallback/1`
which selects the database and perform the query or the transaction.
Here is an example from `rabbit_db_vhost`:

* Up until RabbitMQ 3.12.x:

        get(VHostName) when is_binary(VHostName) ->
            get_in_mnesia(VHostName).

* Starting with RabbitMQ 3.13.0:

        get(VHostName) when is_binary(VHostName) ->
            rabbit_khepri:handle_fallback(
              #{mnesia => fun() -> get_in_mnesia(VHostName) end,
                khepri => fun() -> get_in_khepri(VHostName) end}).

This `rabbit_khepri:handle_fallback/1` function relies on two things:
1. the fact that the `khepri_db` feature flag is enabled, in which case
   it always executes the Khepri-based variant.
4. the ability or not to read and write to Mnesia tables otherwise.

Before the feature flag is enabled, or during the migration, the
function will try to execute the Mnesia-based variant. If it succeeds,
then it returns the result. If it fails because one or more Mnesia
tables can't be used, it restarts from scratch: it means the feature
flag is being enabled and depending on the outcome, either the
Mnesia-based variant will succeed (the feature flag couldn't be enabled)
or the feature flag will be marked as enabled and it will call the
Khepri-based variant. The meat of this function really lives in the
`khepri_mnesia_migration` application [3] and
`rabbit_khepri:handle_fallback/1` is a wrapper on top of it that knows
about the feature flag.

However, some calls to the database do not depend on the existence of
Mnesia tables, such as functions where we need to learn about the
members of a cluster. For those, we can't rely on exceptions from
Mnesia. Therefore, we just look at the state of the feature flag to
determine which database to use. There are two situations though:

* Sometimes, we need the feature flag state query to block because the
  function interested in it can't return a valid answer during the
  migration. Here is an example:

        case rabbit_khepri:is_enabled(RemoteNode) of
            true  -> can_join_using_khepri(RemoteNode);
            false -> can_join_using_mnesia(RemoteNode)
        end

* Sometimes, we need the feature flag state query to NOT block (for
  instance because it would cause a deadlock). Here is an example:

        case rabbit_khepri:get_feature_state() of
            enabled -> members_using_khepri();
            _       -> members_using_mnesia()
        end

Direct accesses to Mnesia still exists. They are limited to code that is
specific to Mnesia such as classic queue mirroring or network partitions
handling strategies.

Now, to discover the Mnesia tables to migrate and how to migrate them,
we use an Erlang module attribute called
`rabbit_mnesia_tables_to_khepri_db` which indicates a list of Mnesia
tables and an associated converter module. Here is an example in the
`rabbitmq_recent_history_exchange` plugin:

    -rabbit_mnesia_tables_to_khepri_db(
       [{?RH_TABLE, rabbit_db_rh_exchange_m2k_converter}]).

The converter module  — `rabbit_db_rh_exchange_m2k_converter` in this
example  — is is fact a "sub" converter module called but
`rabbit_db_m2k_converter`. See the documentation of a `mnesia_to_khepri`
converter module to learn more about these modules.

[1] https://github.com/rabbitmq/ra
[2] https://github.com/rabbitmq/khepri
[3] https://github.com/rabbitmq/khepri_mnesia_migration

See #7206.

Co-authored-by: Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com>
Co-authored-by: Diana Parra Corbacho <dparracorbac@vmware.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-09-29 16:00:11 +02:00
Diana Parra Corbacho c241b36bf7 CLI forget_cluster_node: shrink stream queues 2023-09-18 16:08:40 +02:00
Diana Parra Corbacho 7540ccc628 forget_cluster_node: handle errors while shrinking quorum queues 2023-09-15 13:34:53 +02:00
Ayanda-D 84e924b854 update ctl delete_queue command to use delete_with api 2023-09-11 14:13:02 +01:00
Jean-Sébastien Pédron b8b4b5d187
rabbitmq_cli: Handle absence of the `rabbit_db*` modules in older versions 2023-09-04 21:09:11 +02:00
Jean-Sébastien Pédron b9b4f8a4c1
rabbit_db: Fall back to `rabbit_mnesia` if functions are undefined in remote nodes
[Why]
The CLI may be used against a remote node running a different version.
We took that into account in several uses of the `rabbit_db*` modules on
remote nodes, but not everywhere. Likewise in the
`clustering_management_SUITE` testsuite.

[How]
This patch falls back to previous `rabbit_mnesia`-based calls if the
initial calls throws an `undef` exception.
2023-07-20 15:47:40 +02:00
Jean-Sébastien Pédron 95449bd20e
rabbit_db_cluster: Check `rabbit` is stopped in `forget_node()`
[Why]
`rabbit_mnesia` indirectly checks that `rabbit` is stopped on the remote
node because `mnesia:del_table_copy()` requires that Mnesia is stopped
to delete the schema. However, this is not specific to Mnesia and we
want `rabbit` to be stopped when we use Khepri in the future.

[How]
We use `rabbit:is_running(Node)` to query the status of RabbitMQ on the
remote node to forget. This is not atomic so there is a small chance
that RabbitMQ is restarted between the check and the actual forget.

Note: `rabbit_mnesia` also removes some queues and emit a "left cluster"
event after a successful forget. However, this part was not moved
because other parts of the module rely on this in RPC calls. To keep
nodes compatibles, the calls are left in place. They will be duplicated
for Khepri.
2023-07-11 16:46:27 +02:00
Michael Davis 5f3baf381d
CLI: Rename disk space monitoring commands 2023-07-07 11:16:19 -05:00
Rin Kuryloski 59f5494df2 elixir syntax over erlang 2023-07-04 17:45:50 +02:00
Rin Kuryloski 89a3ffcff2 Improve loading of public_key in listeners.ex
Inspired by https://github.com/voltone/x509/pull/60/files
2023-07-04 17:45:32 +02:00
Rin Kuryloski 42d29a5ca3 Run 'mix format' with elixir 1.15.2 2023-07-04 17:45:32 +02:00
Rin Kuryloski 8efc71eb9f Fix rabbitmqctl compilation under elixir 1.15.x 2023-07-04 17:45:04 +02:00
Michael Klishin e1a1984293
CLI tools: introduce commands that enable and disable free disk space monitoring (#8743)
* Closes #8741

References #8740

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-07-04 00:14:01 +04:00
Michael Klishin c9221bd717
Improve rabbitmq-queues {add,delete}_member error messages
when target queue was not found.
2023-05-02 13:28:29 +04:00
Michael Klishin d5f16d4ce6
mix format 2023-05-02 13:08:31 +04:00
Michael Klishin e8cb0c4947
rabbitmq-queues add_member: improve error reporting 2023-05-02 12:14:48 +04:00
Michael Klishin 29d17f05cd
rabbitmq-queues add_member: extract the correct argument
during execution environment validation.
2023-05-02 12:14:26 +04:00
Michael Klishin 247452de5d
rabbitmq-queues add_member: add a missing import 2023-05-02 11:08:00 +04:00
Michael Klishin d4a2d48cea
rabbitmq-queues: validate cluster membership of the argument
Specifically of the node where new replicas should be
placed.

Closes #8007
2023-05-02 10:55:31 +04:00
Michael Klishin 26ebd5c061
Merge pull request #7970 from rabbitmq/mk-silence-remote-shell-dialyzer-on-otp-26
CLI: more OTP 26 compatibility for remote_shell
2023-04-24 21:44:51 +04:00
Michael Klishin 57cd750a1a mix format 2023-04-24 21:16:41 +04:00
Michael Klishin 4e41246415 CLI: more OTP 26 compatibility for remote_shell
shell:start_interactive/1 takes a {node(), mfa()}, not
{node(), atom(), atom(), non_neg_integer()}
2023-04-24 20:54:13 +04:00
Michael Klishin ddf7926941 CLI: make input ordering preditable when formatting a table
if the input is given as a map.

References #7931, #7921
2023-04-24 14:50:31 +04:00
Michael Klishin cec151df59
Introduce a way to update virtual host metadata using CLI tools (#7914)
Introduce 'ctl update_vhost_metadata'

that can be used to update the description, tags or default queue type of
any existing virtual hosts.

Closes #7912, #7857.

#7912 will need an HTTP API counterpart change.
2023-04-18 02:54:37 +04:00
Michael Klishin f1a922a17c Virtual host limit: error type naming
vhost_precondition_failed => vhost_limit_exceeded

vhost_limit_exceeded is the error type used by
definition import when a per-vhost is exceeded.
It feels appropriate for this case, too.
2023-04-01 23:11:48 +04:00