Commit Graph

2004 Commits

Author SHA1 Message Date
Michael Klishin 5a8e74ed5d
Merge pull request #7280 from rabbitmq/rin/rabbit_vhost-update_tags-skip-notify-if-unchanged
rabbit_vhost:set_tags/2 avoids notifying if tags are unchanged
2023-02-14 06:46:05 -03:00
Michael Klishin d0dc951343
Merge pull request #7058 from rabbitmq/add-node-lists-functions-to-clarify-intent
rabbit_nodes: Add list functions to clarify which nodes we are interested in
2023-02-13 23:06:50 -03:00
Michael Klishin 9beda74d86
Sort tags before comparing them in this test
now that the server sorts and deduplicates them
2023-02-13 22:16:21 -03:00
Alexey Lebedeff 949b53543d Fix all dependencies for the dialyzer
This is the latest commit in the series, it fixes (almost) all the
problems with missing and circular dependencies for typing.

The only 2 unsolved problems are:

- `lg` dependency for `rabbit` - the problem is that it's the only
  dependency that contains NIF. And there is no way to make dialyzer
  ignore it - looks like unknown check is not suppressable by dialyzer
  directives. In the future making `lg` a proper dependency can be a
  good thing anyway.

- some missing elixir function in `rabbitmq_cli` (CSV, JSON and
  logging related).

- `eetcd` dependency for `rabbitmq_peer_discovery_etcd` - this one
  uses sub-directories in `src/`, which confuses dialyzer (or our bazel
  machinery is not able to properly handle it). I've tried the latest
  rules_erlang which flattens directory for .beam files, but it wasn't
  enough for dialyzer - it wasn't able to find core erlang files. This
  is a niche plugin and an unusual dependency, so probably not worth
  investigating further.
2023-02-13 17:37:44 +01:00
David Ansari 575f4e78bc Remove compatibility for feature flag stream_queue
Remove compatibility code for feature flag `stream_queue`
because this feature flag is required in 3.12.

See #7219
2023-02-13 15:31:40 +00:00
Jean-Sébastien Pédron d65637190a
rabbit_nodes: Add list functions to clarify which nodes we are interested in
So far, we had the following functions to list nodes in a RabbitMQ
cluster:
* `rabbit_mnesia:cluster_nodes/1` to get members of the Mnesia cluster;
  the argument was used to select members (all members or only those
  running Mnesia and participating in the cluster)
* `rabbit_nodes:all/0` to get all members of the Mnesia cluster
* `rabbit_nodes:all_running/0` to get all members who currently run
  Mnesia

Basically:
* `rabbit_nodes:all/0` calls `rabbit_mnesia:cluster_nodes(all)`
* `rabbit_nodes:all_running/0` calls `rabbit_mnesia:cluster_nodes(running)`

We also have:
* `rabbit_node_monitor:alive_nodes/1` which filters the given list of
  nodes to only select those currently running Mnesia
* `rabbit_node_monitor:alive_rabbit_nodes/1` which filters the given
  list of nodes to only select those currently running RabbitMQ

Most of the code uses `rabbit_mnesia:cluster_nodes/1` or the
`rabbit_nodes:all*/0` functions. `rabbit_mnesia:cluster_nodes(running)`
or `rabbit_nodes:all_running/0` is often used as a close approximation
of "all cluster members running RabbitMQ". This list might be incorrect
in times where a node is joining the clustered or is being worked on
(i.e. Mnesia is running but not RabbitMQ).

With Khepri, there won't be the same possible approximation because we
will try to keep Khepri/Ra running even if RabbitMQ is stopped to
expand/shrink the cluster.

So in order to clarify what we want when we query a list of nodes, this
patch introduces the following functions:
* `rabbit_nodes:list_members/0` to get all cluster members, regardless
  of their state
* `rabbit_nodes:list_reachable/0` to get all cluster members we can
  reach using Erlang distribution, regardless of the state of RabbitMQ
* `rabbit_nodes:list_running/0` to get all cluster members who run
  RabbitMQ, regardless of the maintenance state
* `rabbit_nodes:list_serving/0` to get all cluster members who run
  RabbitMQ and are accepting clients

In addition to the list functions, there are the corresponding
`rabbit_nodes:is_*(Node)` checks and `rabbit_nodes:filter_*(Nodes)`
filtering functions.

The code is modified to use these new functions. One possible
significant change is that the new list functions will perform RPC calls
to query the nodes' state, unlike `rabbit_mnesia:cluster_nodes(running)`.
2023-02-13 12:58:40 +01:00
Michael Klishin 7b5e8a9955
ctl add_vhost: minor improvements to help output 2023-02-09 15:12:51 -05:00
Jean-Sébastien Pédron 78e8c595b1
set_permissions_globally_command_test: Fix "invalid_regex patterns" test expectations
Testcases are executed in a random order. Unfortunately, this testcase
depended on side effects of other testcases. If this testcase was
executed first, then there were no permissions set and the testcase
would fail.

It now lists permissions before and after the actual test and compare
both.
2023-02-08 10:21:10 +01:00
Jean-Sébastien Pédron 271a7babdf
set_permissions_globally_command_test: Always set @user
Otherwise the command causes a `function_clause` exception in the broker
because a `nil` atom is passed as the username instead of a binary.
2023-02-08 10:18:24 +01:00
Michael Klishin 69add44ce3
CLI: mix format 2023-02-06 15:54:09 -05:00
Michael Klishin ab99ccfa45
Introduce a CLI command that grants permissions to all virtual hosts
Closes #1000
2023-02-06 13:07:09 -05:00
Rin Kuryloski 0ac62a4a3b Forward-port dialyzer related rabbitmq_cli fixes from #7122 2023-02-01 23:21:10 +01:00
Michael Klishin 6fd7b983d8
Merge pull request #7135 from rabbitmq/mk-report-total-core-count-cluster-status
List CPU core count in 'rabbitmq-diagnostics cluster_status'
2023-02-01 06:45:41 -05:00
Michael Klishin 1f902fd016
mix format 2023-01-31 20:57:11 -05:00
Michael Klishin cee705b99f
List CPU core count in 'rabbitmq-diagnostics cluster_status'
Both to simplify troubleshooting in some cases and to make it
easier to spot licensing irregularities.
2023-01-31 20:37:44 -05:00
Michael Klishin 2cf2133a44
Fix one more issue reported by CLI tools Dialyzer
(cherry picked from commit 5d8ba2f32a)
2023-01-31 17:47:24 -05:00
Rin Kuryloski bdb2046185
Add rabbitmq_cli dialyze to bazel (#7066)
* Add rabbitmq_cli dialyze to bazel

and fix a number of warnings

Because we stop mix from recompiling rabbit_common in bazel, many
unknown functions are reported, so this dialyzer analysis is somewhat
incomplete.

* Use erlang dialyzer for rabbitmq_cli rather than mix dialyzer

Since this resolves all of the rabbit functions, there are far fewer
unknown functions.

Requires yet to be released rules_erlang 3.9.2

* Temporarily use pre-release rules_erlang

So that checks can run on this PR without a release

* Fix additional dialyzer warnings in rabbitmq_cli

* rabbitmq_cli: mix format

* Additional fixes for ignored return values

* Revert "Temporarily use pre-release rules_erlang"

This reverts commit c16b5b6815.

* Use rules_erlang 3.9.2
2023-01-31 15:05:52 +01:00
Simon Unge 03617f681c See #5957. Accept empty arg and prompt for password 2023-01-26 11:46:24 -08:00
Alexey Lebedeff a9b44f017c Fix all dialyzer warnings in `rabbitmq_stomp` 2023-01-25 16:13:10 +01:00
Simon Unge 67bc94ed16 See #5957. CLI command to generate hashed password from cleartext password 2023-01-23 14:47:29 -08:00
Michael Klishin 3bfba02281
Merge pull request #6919 from rabbitmq/rin/rework-elixir-dialyze
Rework elixir dialyze
2023-01-21 12:11:02 -06:00
Rin Kuryloski 3b2513eb93 Quote vars in shell in deps/rabbitmq_cli/rabbitmqctl.bzl 2023-01-20 15:50:17 +01:00
Rin Kuryloski dd9a8c96f1 Change `alias` to `test_suite` in deps/rabbitmq_cli/BUILD.bazel
bazel test won't work correctly on an alias, apparently:
https://docs.bazel.build/versions/2.2.0/be/general.html#alias

the recommended workaround is to use a test_suite instead
2023-01-19 22:06:56 +01:00
Rin Kuryloski 057f776c8a Fixup docstring 2023-01-19 17:29:29 +01:00
Rin Kuryloski 08d641a1a9 Fix dialyzer warnings revealed from previous commit 2023-01-19 17:29:29 +01:00
Rin Kuryloski b84e746ee9 Rework plt/dialyze for rabbitmqctl and plugins that depend on it
This allows us to stop ignorning undefined callback warnings

When mix compiles rabbitmqctl, it produces a 'consolidated' directory
alongside the 'ebin' dir. Some of the modules in consolidated are
intended to be used instead of those provided by elixir. We now handle
the conflicts properly in the bazel build.
2023-01-19 17:29:23 +01:00
Michael Klishin c3c4665970
Update tests 2023-01-16 09:24:37 -08:00
Michael Klishin 9d69a4b325
CLI: mix format 2023-01-16 09:24:37 -08:00
Michael Klishin 226a7603e8
diagnostics check_port_connectivity: support --address
For scenarios where node hostname resolution on the invoking
host is not a suitable option and a particular address
should be tried instead.

Closes #6853.
2023-01-16 09:24:37 -08:00
Alexey Lebedeff 2c4e4fb691 Fix all dialyzer warnings in rabbitmq_stream
There are some elixir-related messages about undefined functions, but
they don't produce warnings (yet).
2023-01-16 17:11:24 +01:00
Jean-Sébastien Pédron 4840ca9f2f
Merge pull request #6866 from rabbitmq/init-db-from-rabbit_db
rabbit_db: Add `init/0`, `is_virgin_node/0`, `dir/0` and `ensure_dir_exists/0` functions
2023-01-13 16:26:06 +01:00
Jean-Sébastien Pédron 950c4ef7eb
Use `rabbit:data_dir/0` instead of `rabbit_mnesia:dir/0` where it makes sense
Some testcases are interested in RabbitMQ data directory, not Mnesia
directory per se. In this case, call `rabbit:data_dir/0` instead.
2023-01-13 11:56:21 +01:00
Rin Kuryloski d3794cf2c0 Conform vhost tags to a list when set with the cli in all cases
`rabbitmqctl add_vhost myvhost --tags "my_tag"` would not previously
conform "my_tag" to a list before setting vhost metadata, which could
cause crashes when the list was read.
2023-01-13 10:06:11 +01:00
Jean-Sébastien Pédron 8bad27b16d
rabbitmq_cli: Fix typo where we set `rabbit`'s `data_dir` environment variable
The application name was incorrect, leading to errors when trying to use
this data dir as part of the `forget_cluster_node` command.
2023-01-12 15:33:31 +01:00
Michael Klishin ec4f1dba7d
(c) year bump: 2022 => 2023 2023-01-01 23:17:36 -05:00
Michal Kuratczyk 4160dac33e
Check if stream coordinator is quorum critial 2022-12-22 10:02:13 +01:00
Arnaud Cogoluègnes d3caa1cdaa
Merge pull request #6440 from rabbitmq/stream-balancing
Streams rebalancing
2022-12-14 16:51:30 +01:00
Jean-Sébastien Pédron 46b71e8994
rabbitmq-cli: Deleting a non-existing user or vhost is fine
This patch adapts several testcases to this behavior change. The goal is
to avoid transactions where there is no need for one.
2022-12-14 10:06:45 +01:00
Jean-Sébastien Pédron b25175563c
rabbitmq-cli: Fix several testcases which didn't test anything
RabbitMQ lacks argument verifications in many places unfortunately.
Several testcases were passing bad arguments to the command but were
also comparing the result to bad data. This happened to "work"...
2022-12-13 14:55:46 +01:00
Arnaud Cogoluègnes 41c6e55c2a
Fix typos 2022-12-13 11:01:35 +01:00
Michael Klishin d339027850
Merge pull request #6598 from rabbitmq/rin/rabbitmqctl-usage-lists-plugin-commands
Make rabbitmqctl with no command (implicit "help") behave more like with "help"
2022-12-09 13:45:17 +04:00
Péter Gömöri 88877c654c Fix error filtering and printing in queue grow/shrink commands 2022-12-08 18:02:31 +01:00
Rin Kuryloski e2d26953b6 mix format 2022-12-08 17:24:50 +01:00
Rin Kuryloski 8696531d8d Apply node name normalization in cli when loading available commands 2022-12-08 17:07:11 +01:00
Rin Kuryloski 27bb51bb1e Also pass remote node info for regular help commands 2022-12-08 17:05:55 +01:00
Rin Kuryloski 1c5f577c19 Make rabbitmqctl with no command behave more like with "help"
For instance, if '-n ...' has been used to specify a node, it will be
used to discover plugins and print additional commands made available
by plugins, as the "help" command does
2022-12-08 15:26:09 +01:00
Alexey Lebedeff 398f072a03 Expose effective policy definition via CLI
Now it's only visible in the management UI.

One can craft a series of calls to `rabbitmqctl list_queues` and
`rabbitmqctl list_policies` to achieve similiar result. But it's more
difficult, and also doesn't take operator policy (if any) into account.
2022-12-02 17:06:17 +01:00
Jean-Sébastien Pédron ae06f79c10
rabbit: Introduce `rabbit:data_dir/0`
This function returns the data directory where all subsystems should
store their files.

Historically, this was the Mnesia directory. But semantically, this
should be the reverse: RabbitMQ owns the data directory and Mnesia is
configured to put its files there too.

`rabbit_mnesia:dir/0` now calls `rabbit:data_dir/0`.

Other subsystems will be modified in a follow-up commit to call
`rabbit:data_dir/0` instead of `rabbit_mnesia:dir/0`.
2022-11-30 14:41:28 +01:00
Jean-Sébastien Pédron 99b14fd0fa
rabbit_env: Rename `mnesia_*dir` to `data_*dir`
The location and name of this directory remains the same for
compatibility reasons. Therefore, it sill contains "mnesia" in its name.
However, semantically, we want this directory to be unrelated to Mnesia.

In the end, many subsystems write files and directories there, including
Mnesia, all Ra systems and in the future, Khepri.
2022-11-30 13:00:49 +01:00
Michal Kuratczyk feff12cbe2
Stream rebalancing support 2022-11-29 18:59:50 +01:00
Karl Nilsson 97c2bb15c6 Stream coordiantor restart stream preferred leader flag
Allow the restart_stream command / API to provide a preferrred leader
hint. If this leader replies to the coordinator stop phase as one of the
first n/2+1 members and has a sufficientl up-to-date stream tail it will be
selected as the leader, else it will fall back and use the modulus logic to
select the next leader.

sufficiently up to
2022-11-29 16:30:44 +00:00
Karl Nilsson 9736425fa5 Add restart_stream command to rabbitmq-streams
Also add epoch to stream_status output which requires osiris 1.4.1
2022-11-29 16:30:41 +00:00
Michal Kuratczyk d8ff99180b
Consider streams when quorum critical check (#6448)
Extended the quorum critical check to also consider streams and their
potential unavailability if the nodes is stopped.
2022-11-23 15:24:26 +01:00
Alex Valiushko d70660dac7 Add inclusive aliases to ctl info keys
Includes generic ability to provide aliases in other commands.
2022-11-11 14:44:05 -08:00
Michael Klishin 1b1fdfbed5
Merge pull request #6316 from rabbitmq/rabbitmq-server-6289
CLI tools: discover commands in plugins that are enabled indirectly as dependencies; rework plugin state assertions
2022-11-03 17:19:27 +04:00
Michael Klishin 0c821ded1a
CLI: do not fail if plugin directory does not exist
As of #6316/#6020 all plugin directories are scanned earlier and
unconditionally. In some environments, the path won't be set or
will be set incorrectly. Make sure that 'rabbitmqctl help'
and friends work in such environments, even if no commands from
plugins would be available.

Per discussion with @pjk25.
2022-11-03 15:44:08 +04:00
Philip Kuryloski 6c3664d871 Filter the rabbitmq_cli format check out on windows
When I ran it manually, all files were reported as mis-formatted. I
didn't investigate further, may line endings or encoding is an issue?
It seems worth it to skip the check for now since we don't run
integration test on windows with bazel yet anyway.
2022-11-02 14:24:44 +01:00
Rin Kuryloski bff69d325c Fixup format check on windows 2022-11-02 11:50:42 +01:00
Michael Klishin 6ebbfaa0a4
Adopt new helpers that assert on plugin presence and state
In many tests, we do not care what is the complete set of plugins
running on a node (or present, or in a specific state). We only
care that a few select ones are running, are of the expected version,
in a certain state, and so on.

So list comparison assertions are counterproductive and lead to
test interference that is difficult to track down. In many cases
we can do more fine grained assertions and ignore the rest of
the plugins present on the node.

References #6289, #6020.
2022-11-02 14:07:10 +04:00
Rin Kuryloski cb935a034e Reduce unnecessary setup in rabbitmq_cli formatting check 2022-11-02 10:41:30 +01:00
Rin Kuryloski d15599940d Split rabbitmq_cli format check into a separate test target in bazel
`bazel test //deps/rabbitmq_cli:all` runs tests and format check
`bazel test //deps/rabbitmq_cli:tests` runs just the tests
`bazel test //deps/rabbitmq_cli:check_formatted` runs just the format
check
2022-11-02 10:17:08 +01:00
Michael Klishin 8c6b3bfbc6
CLI: continue reworking assertions on plugin state 2022-11-02 13:08:44 +04:00
Michael Klishin e1d14bac2d
Reset enabled plugins after each test that enables any 2022-11-02 13:08:44 +04:00
Simon Unge cd1ac5b66c
See Issue 6020. Add rabbitmq_stream_management plugin to test suite 2022-11-02 13:08:44 +04:00
Simon Unge 917bf55e19
See Issue 6020. Take plugin dependency into account 2022-11-02 13:08:44 +04:00
Rin Kuryloski 278025f514 Copy rather than symlink files in rabbitmqctl_test.bzl
Bazel seems to be cleaning up files after following directory symlinks
after the test. Not what I would have expected, and maybe a
consequence of lighter sandboxing used on macos with rabbitmq. In any
case copying seems to be a reasonable workaround.
2022-11-02 09:49:38 +01:00
Michael Klishin e7e88d4dc4
Explain that 'bazel clean' helps with this odd condition 2022-11-02 09:50:08 +04:00
Rin Kuryloski 55a9245493 Fail fast in the rabbitmq_cli tests if test_helper.exs is missing
For reasons which are not yet fully understood, this file can go
missing and require a `bazel clean` to get the suite working
again. Having this check in place should make future flakes easier to
diagnose, and help determine if subsequent symlinking in the
underlying bazel rule should be replaced with copying, or if something
else altogether is happening.
2022-11-01 17:05:53 +01:00
Michael Klishin 7dcacf5f52
Merge pull request #6294 from rabbitmq/mk-status-format-when-free-disk-space-cannot-be-computed
ctl status: handle cases when free disk space cannot be computed
2022-11-01 17:16:15 +04:00
Michael Klishin 0cd8dff415
CLI: improve isolation of set_disk_free_limit tests 2022-11-01 16:39:35 +04:00
Michael Klishin ca518b846b
ctl status: handle cases when free disk space cannot be computed 2022-11-01 15:25:05 +04:00
Jean-Sébastien Pédron 4b132daaba
Remove upgrade-specific log file
This category should be unused with the decommissioning of the old
upgrade subsystem (in favor of the feature flags subsystem). It means:
1. The upgrade log file will not be created by default anymore.
2. The `$RABBITMQ_UPGRADE_LOG` environment variable is now unsupported.

The configuration variables remain to avoid breaking an existing and
working configuration.
2022-10-06 21:28:50 +02:00
Rin Kuryloski a71ff1341e Add 'mix format --check-formatted' to the rabbitmqctl_tests in bazel
to match the check on the Makefile side that was recently introduced
2022-10-04 14:59:45 +02:00
Ayanda Dube c4b42f6c50 add rabbitmq_cli format check on make/mix task aliases 2022-10-02 19:07:08 +01:00
Ayanda Dube 345a580f6d remove deprecated and replace with import Config module 2022-10-02 18:56:48 +01:00
Ayanda Dube 4cbbaad2df mix format rabbitmq_cli 2022-10-02 18:54:11 +01:00
Ayanda Dube 56ca86a48e initial .formatter.exs configuration file 2022-10-02 18:52:43 +01:00
Michael Klishin 7780c594eb Require Elixir 1.13.4 or 1.14.x 2022-09-18 22:25:42 +04:00
Michael Klishin 8db79fadda
Merge branch 'main' into rabbitmq-server-5708-whitelist-elixir-1.14 2022-09-03 01:15:30 +04:00
Michael Klishin e40a121c80 Make CLI tools version reflect that of RabbitMQ itself on this branch 2022-09-03 00:32:13 +04:00
Michael Klishin 7914e60d6a CLI tools: whitelist Elixir 1.14
As suggested by @VlkrS in #5708
2022-09-03 00:30:23 +04:00
Michael Klishin 53c7ea0661
Merge pull request #5579 from rabbitmq/mk-release-eol-date-warnings
Introduce a concept of release series EOL date
2022-08-28 18:18:46 +04:00
Michael Klishin ead5acc7d6 Squash a few compiler warnings
one revealed a real issue in a CLI command
2022-08-28 18:16:01 +04:00
Michael Klishin fc0de65393 Release series support: wording
"maintenance" is already used by node maintenance mode,
"supported" is also closer to the language used in the docs
2022-08-27 22:12:43 +04:00
Michael Klishin 33b4e6f799 Report version series maintenance status via CLI
as part of 'rabbitmq-diagnostics status'
2022-08-27 21:49:35 +04:00
Rin Kuryloski 165f946ffd Remove .travis.yml.patch files 2022-08-16 09:48:46 +02:00
Rin Kuryloski 575c5f9975 Remove all of the .travis.yml files
since we no longer use them
2022-08-16 09:46:31 +02:00
Michael Klishin 83676fa74b
Validate the feature flag behind user-provided queue type on the server end 2022-08-01 19:04:10 +04:00
Michael Klishin 2c4c51d62d
ctl add_vhost: check if relevant feature flags are enabled 2022-08-01 15:56:35 +04:00
Jean-Sébastien Pédron 5b98d7d2a2
Remove test code which depended on the `maintenance_mode_status` feature flags
These checks are now irrelevant as the feature flag is required.
2022-07-29 11:51:52 +02:00
Rin Kuryloski e9c1e6b680 Bump the rabbitmq version on this branch to 3.12.0 (bazel)
To reduce cache misses, the bazel build uses a hard coded version. A
correct value is injected in releases.
2022-07-28 09:45:26 +02:00
Rin Kuryloski 59b858de54 Revert "Fixup an accidental backport side-effect"
This reverts commit 5053d48bce.
2022-07-27 14:03:01 +02:00
Rin Kuryloski 5053d48bce
Fixup an accidental backport side-effect 2022-07-27 14:02:35 +02:00
Rin Kuryloski f67eaaae68 Use code compiled with -DTEST in mixed version testing
Also introduces an actions workflow to provide the necessary archives
referenced in secondary_umbrella.bzl
2022-07-26 20:29:33 +02:00
Michael Klishin 1b62cfcca2
add_vhost: help wording 2022-07-26 01:16:36 +04:00
Karl Nilsson 65ca0b4dfd Add default_queue_type to list_vhosts command 2022-07-25 12:34:52 +01:00
Karl Nilsson 51fe7c72af Add a --default-queue-type argument to rabbitmqctl add_vhost 2022-07-25 12:34:51 +01:00
Jean-Sébastien Pédron bcb8733880
rabbit_feature_flags: Add a feature flags controller process
This gen_statem-based process is responsible for handling concurrency
when feature flags are enabled and synchronized when a cluster is
expanded.

This clarifies and stabilizes the behavior of the feature flag subsystem
w.r.t. situations where e.g. a feature flag migration function takes
time to update data and a new node joins a cluster and synchronizes its
feature flag states with the cluster. There was a chance that the
feature flag was marked as enabled on the joining node, even though the
migration function didn't take care of that node.

With this new feature flags controller, enabling or synchronizing
feature flags blocks and delays any concurrent operations which try to
modify feature flags states too.

This change also clarifies where and when the migration function is
called: it is called at least once on each node who knows the feature
flag and when the state goes from "disabled" to "enabled" on that node.

Note that even if the feature flag is being enabled on a subset of the
nodes (because other nodes already have it enabled), it is marked as
"state_changing" everywhere during the migration. This is to prevent
that a node where it is enabled assumes it is enabled on all nodes who
know the feature flag.

There is a new feature as well: just after a feature flag is enabled,
the migration function is called a second time for any post-enable
actions. The feature flag is marked as enabled between these "enable"
and "post-enable" steps. The success or failure of this "post-enable"
run does not affect the state of the feature flag (i.e. it is ignored).

A new migration function API is introduced to allow more advanced
things. The new API is:

    my_migration_function(
      #ffcommand{name = ...,
                 props = ...,
		 command = enable | post_enable,
		 extra = #{...}})

The record is defined in `include/feature_flags.hrl`. Here is the
meaning of each field:

* `name` and `props` are the equivalent of the `FeatureName` and
  `FeatureProps` arguments of the previous migration function API.

* `command` is basically the same as the previous `Arg` arguments.

* `extra` is map containing context-specific information. For instance, it
  contains the list of nodes where the feature flag state changes.

This whole new behavior is behind a new feature flag called
`feature_flags_v2`. If a feature flag uses the new migration function
API, `feature_flags_v2` will be automatically enabled.

If many feature flags are enabled at once (like when a fresh RabbitMQ
node is started for the first time), `feature_flags_v2` will be enabled
first if it is in the list.
2022-06-28 10:13:19 +02:00
Jean-Sébastien Pédron 3eb6374e4e
rabbitmq_cli: Take "make" command from $MAKE env. variable
This unbreaks the build of rabbitmq_cli on platforms where GNU Make is
installed under another name than `make`. This is the case on Mac OSX
and *BSD for instance where GNU Make is available as `gmake`.
2022-06-20 11:36:02 +02:00
Philip Kuryloski 09fa85e570 Remove extra tar options not supported on macos
They would have improved the reproducibility of the :source_archive
rule, but are not essential. Fixes the macos breakage introduced by
5027.
2022-06-14 17:53:49 +02:00