Commit Graph

55323 Commits

Author SHA1 Message Date
Michael Klishin f414c2d512
More missed license header updates #9969 2024-02-05 11:53:50 -05:00
Michael Klishin 49335b7c4c
Merge pull request #10481 from rabbitmq/rabbitmq-server-10477
Select parts of #10477, take 2
2024-02-03 03:32:20 -05:00
Michael Klishin 144e6add39 Port the rabbit part of #10477 2024-02-03 01:56:19 -05:00
Michael Klishin 7a7da0f086
Merge pull request #10476 from rabbitmq/SimonUnge-check_consumer_count
Rework consumer sample deletion when a channel is closed
2024-02-02 20:21:18 -05:00
Michael Klishin dad9379945 Reword a comment #10451 #9356 2024-02-02 18:57:20 -05:00
Simon Unge 3044201f7d Better variable names, and comments 2024-02-02 18:57:20 -05:00
Simon Unge a2ff5a0b7b Check consumer size for clean strats 2024-02-02 18:57:20 -05:00
Michael Klishin 6115f8f4f7
Merge pull request #10471 from rabbitmq/handle-shutdown-reason-in-federation-downstream
rabbitmq_federation: Handle `shutdown` from upstream
2024-02-02 17:34:38 -05:00
Jean-Sébastien Pédron 2a23ccbcd9
rabbitmq_federation: Handle `shutdown` from upstream
[Why]
The downstream process was already handling a `{shutdown, Term}`
termination reason from upstream gracefully: it would log a message an
close the connection.

However it didn't handle the more common `shutdown` reason, which
happens with a regular stop of the upstream node. It led to the log of a
giant scary crash message.

[How]
We handle `shutdown` the same as `{shutdown, Term}`.
2024-02-02 17:11:12 +01:00
Michael Klishin 875fe9a74c
Merge pull request #10459 from rabbitmq/md-elixir-warnings
Resolve CLI elixirc warnings
2024-02-01 18:56:04 -05:00
Michael Klishin 1aa9e13b93
Merge pull request #10457 from rabbitmq/md-check-epmd-before-starting
Check whether EPMD is running before starting it
2024-02-01 18:55:24 -05:00
Michael Klishin de9c4835d1
Merge pull request #10458 from amazon-mq/bump-elixir
CLI: allow building with Elixir 1.17
2024-02-01 18:54:36 -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 Davis cc12d73b91
Add Bazel test for compiling rabbitmqctl with warnings-as-errors
This test should fail when `mix compile --warnings-as-errors` gives
any warnings.
2024-02-01 15:39:47 -05:00
Michael Davis 46ca3269e3
Check whether EPMD is running before starting it
`rabbit_nodes_common:ensure_epmd/0` unconditionally starts EPMD by
spawning `erl` with nodename options. Spawning `erl` can be quite slow
though (around 250ms for me locally), so we should try to avoid it when
we detect that EPMD is already running.

We can relatively cheaply check whether EPMD is already running with
`net_adm:names/0`, a function that asks the daemon on localhost to list
any registered names, the same as `epmd -names` on the comand line. If
we can successfully get the list of names from the daemon then we don't
need to start EPMD. `net_adm:names/0` is relatively cheap compared to
running `erl`, costing around 8ms when EPMD is running and less than a
millisecond when it is not.

This improves the CLI's total run time for commands that read the
`enabled_plugins_file` and `plugins_dir` config options. Those options
try to consult a running node and so they start distribution and ensure
that EPMD is running. `rabbitmqctl --help` saves nearly 500ms when EPMD
is already running as it reads both options, since previously it
spawned and blocked on `erl` when reading each option.
2024-02-01 14:20:07 -05:00
Michael Klishin 40ff91a55b
Merge pull request #10453 from rabbitmq/rabbitmq-server-10416
Handle old child id format in federation_exchange_link_sup_sup (take 3)
2024-02-01 00:01:59 -05:00
Michael Klishin 2a42471fdd Simplify rabbit_federation_exchange_link_sup_sup:adjust/1
(cherry picked from commit 1414a14dfb)
2024-01-31 21:40:55 -05:00
Michael Klishin 80df65e83f rabbit_federation_exchange_link_sup_sup: avoid an export from a case expression
(cherry picked from commit a879138e13)
2024-01-31 21:40:43 -05:00
Péter Gömöri 6f79af05f6 Handle old child id format in federation_exchange_link_sup_sup
After an upgrade (multi-node cluster with rolling restart) from pre
3.13.0 with already existing federation links, old child ids are
preserved in the mirrored supervisor.

(cherry picked from commit 311cc925e3)
2024-01-31 21:40:32 -05:00
Michael Klishin d57a31068d
Merge pull request #10450 from rabbitmq/dependabot/github_actions/main/peter-evans/create-pull-request-6.0.0
build(deps): bump peter-evans/create-pull-request from 5.0.2 to 6.0.0
2024-01-31 14:34:53 -05:00
Jean-Sébastien Pédron 6d3c9a8e2b
Merge pull request #10443 from rabbitmq/use-local-khepri-queries
Use local Khepri queries only
2024-01-31 20:02:28 +01:00
dependabot[bot] 1901811ff8
build(deps): bump peter-evans/create-pull-request from 5.0.2 to 6.0.0
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.2 to 6.0.0.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v5.0.2...v6.0.0)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 18:38:24 +00:00
Jean-Sébastien Pédron af0728c33f
rabbit_db_maintenance: Use local queries with Khepri
[Why]
Ra consistent queries are currently fragile in the sense that the query
function may run on a remote node and the function reference or MFA may
not be valid on that node. See previous commit for more details.

[How]
We perform local queries in `rabbit_db_maintenance:get_consistent/1`
when Khepri is enabled. This violates what the expectation from this
API, that's why it is a temporary measure, until a proper solution is
found.
2024-01-31 19:12:28 +01:00
Jean-Sébastien Pédron 6ea19b9fa1
rabbit_khepri: Use local queries exclusively
[Why]
Ra consistent queries are currently fragile in the sense that the query
function may run on a remote node and the function reference or MFA may
not be valid on that node:

* A different Erlang compiler may produce difference function references
  for the same module source code. We observed a difference between
  Erlang/OTP 25.x and Erlang/OTP 26.x compilers for instance.

* There is no way to be sure that the remote function copy, whether it
  is described by a function reference of an MFA tuple, is the same as
  the copy local to the caller. Indeed, the remote node may run a
  different version after an upgrade to one of the local or remote
  nodes.

[How]
That's why we force local queries for now. This is fine for now,
especially that we use Khepri projections in many places and they are
local by design.
2024-01-31 19:12:28 +01:00
Jean-Sébastien Pédron d5624d976f
Bump khepri_mnesia_migration from 0.2.1 to 0.3.0
Release notes:
https://github.com/rabbitmq/khepri_mnesia_migration/releases/tag/v0.3.0
2024-01-31 19:12:27 +01:00
Jean-Sébastien Pédron d8abd3ac2b
Bump Khepri from 0.10.0 to 0.11.0
Release notes:
https://github.com/rabbitmq/khepri/releases/tag/v0.11.0
2024-01-31 19:12:27 +01:00
Jean-Sébastien Pédron 967533967e
Bump Ra from 2.7.1 to 2.7.3
Release notes:
* https://github.com/rabbitmq/ra/releases/tag/v2.7.2
* https://github.com/rabbitmq/ra/releases/tag/v2.7.3
2024-01-31 19:12:23 +01:00
Jean-Sébastien Pédron ab65dc9742
Merge pull request #10448 from rabbitmq/fix-flake-in-rabbit_stream_queue_SUITE
rabbit_stream_queue_SUITE: Wait for `ra_leaderboard` to return the leader
2024-01-31 19:11:55 +01:00
Jean-Sébastien Pédron 2a0563b30e
rabbit_stream_queue_SUITE: Wait for ra_leaderboard to return the leader
[Why]
Sometimes, `ra_leaderboard:lookup_leader/1` will return `undefined`
because it doesn't know the leader yet. This leads to a failure of the
testcase with a `badmatch` exception.

[How]
We wait for the function to return a valid leader ID, then try again and
return the result.
2024-01-31 18:48:38 +01:00
Michael Klishin 8a8230caea
Merge pull request #10446 from rabbitmq/rluvaton-add-to-ack-timeout-log-more-info-on-the-problematic-message
Improve the message logged when a channel runs into a consumer acknowledgement timeout
2024-01-31 00:46:53 -05:00
Michael Klishin a188fbc44d Log message wording for #10444 2024-01-30 23:07:22 -05:00
Raz Luvaton 0683c4cded add consumer tag and queue name in the ack timeout warning message 2024-01-30 18:52:48 +02:00
Michael Klishin 507db36511
Update 3.13.0 change log
(cherry picked from commit c046723b13d8e2c9b762e399aaea087aaee152ed)
2024-01-29 19:53:41 -05:00
Michael Klishin da882dff46
Merge pull request #10437 from rabbitmq/loic-update-cowboy
Update Cowboy to 2.11
2024-01-29 19:53:27 -05:00
Alex Valiushko 70ac0cf3c5 bump elixir to 1.17 2024-01-29 16:28:08 -08:00
Michael Klishin 7b2d6972db
Merge pull request #10438 from rabbitmq/mgmt-feature-flags
Allow management users to query feature flags and deprecated features
2024-01-29 19:21:37 -05:00
Michael Klishin f8401df53e
Drive-by change: naming 2024-01-29 12:21:45 -05:00
Loïc Hoguin 865bc22fb8
Update Cowboy to 2.11 2024-01-29 16:27:59 +01:00
Diana Parra Corbacho dc3b6fb5bc Allow management users to query feature flags and deprecated features
The new banner to warn about not-enabled feature flags requires access
to this endpoint, and it must be visible for all users.
2024-01-29 15:51:21 +01:00
Michael Klishin a9ced75476 rabbitmq_stream: add a few missing license headers 2024-01-27 20:46:16 -05:00
David Ansari bedcae18c2 Fix MQTT test flake
Prior to this commit test block_connack_timeout
flaked when 2 new ports got created instead of only 1
in line
```
[NewPort] = Ports -- Ports0,
```

This commit filters for tcp_inet ports.
This will always return the port of the new MQTT connection.
2024-01-27 17:43:38 +01: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
Michael Klishin 1855f0d32b
Merge pull request #10424 from cloudamqp/qq_status_err
Minor: Fix error handling in rabbit_quorum_queue:status/2
2024-01-26 18:08:06 -05:00
Péter Gömöri 733d0048de Fix error handling in rabbit_quorum_queue:status/2
The 'Err' variable was accidentally bound twice resulting in the below
error when `erpc_call` and `get_sys_status` returned two different
errors.

An example when 1 follower of a quorum queue is not alive
```
% rabbitmq-queues quorum_status qq1
Status of quorum queue qq1 on node rabbit-1@localhost ...
Error:
{{:case_clause, {:error, :noproc}}, [{:rabbit_quorum_queue, :"-status/2-lc$^0/1-0-", 2, [file: 'rabbit_quorum_queue.erl', line: 1094]}, {:rabbit_quorum_queue, :status, 2, []}]}
```
2024-01-26 18:47:11 +01:00
Karl Nilsson b1d7037c7d
Merge pull request #10331 from rabbitmq/stream-coordinator-fixes
Stream coordinator: fixes to automatic membership changes.
2024-01-26 15:39:27 +00:00
Karl Nilsson 8bcd43ed03 comment 2024-01-26 14:13:24 +00:00
Karl Nilsson 3c964284f4 Make find_queue_info a bit more reliable and possibly faster. 2024-01-26 12:58:25 +00:00
Karl Nilsson 31cad52d82 Try making test backwards compatible. 2024-01-26 11:50:29 +00:00
Michael Klishin 0e63d3b753
Merge pull request #10417 from rabbitmq/rabbitmq-server-10415-mk-alternative
An alternative to #10415, closes #10330
2024-01-25 19:05:36 -05:00