Commit Graph

54727 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron 09a95a5235
Merge pull request #9875 from rabbitmq/logger-exchange-wait-for-init
Logger exchange: fix race condition during initialisation
2023-11-09 13:50:51 +01:00
Michael Klishin ac09b6e384
Merge pull request #9869 from rabbitmq/cli-commands-for-mirroring-deprecation
CLI commands for mirroring deprecation
2023-11-08 18:12:41 -05:00
Michael Klishin 4e58ad9dad CLI: two more test suites 2023-11-08 16:49:53 -05:00
Michael Klishin 5deacfc4ab
Merge pull request #9896 from rabbitmq/opt-mgmt-queue-listings
Fix streams minority calculation
2023-11-08 09:23:05 -05:00
Michal Kuratczyk 4a4285a25e
OCI updates: bump OpenSSL, remove outdated/unused Dockerfile (#9898)
* Remove unused and outdated Dockerfile

check BUILD.bazel for how the image is built

* Update OpenSSL from 3.1.1 to 3.1.4
2023-11-08 12:56:29 +01:00
Diana Parra Corbacho 55f724aedb Logger exchange: fix race condition during initialisation
The logger exchange needs to declare the exchange during initialisation,
which requires the metadata store to be ready.
Metadata store initalisation happens in a rabbit boot step after
logger initialisation in the second phase of the prelaunch.
The spawned process that declares the exchange, should also
wait for the store to be ready. Otherwise it enters a loop
trying to decide which store to use which generates a huge log
and delays initialisation:
'Mnesia->Khepri fallback handling: Mnesia function failed because table
 `rabbit_vhost` is missing or read-only. Migration could be in progress;
 waiting for migration to progress and trying again...'

This commit gives it 60 seconds for the metadata store to boot,
and only afterwards tries (and retries if needed) to declare the
exchange.
2023-11-08 12:54:02 +01:00
Karl Nilsson 8d2c0a6425 Add tests for rabbit_queue_type:format/2
For streams and quorum queues, classic are tested in many other
places including mgmt tests.
2023-11-08 10:27:01 +00:00
David Ansari e99aa68ea4 Fix coverage
Dependency horus broke coverage on `main` branch.

After this commit, on `main` branch in rabbitmq-server root
directory, both show coverage:

1.
```
make -C deps/rabbitmq_mqtt ct-auth t=[v5,limit]:vhost_queue_limit FULL=1 COVER=1
open deps/rabbitmq_mqtt/logs/index.html
```

2.
```
bazel coverage //deps/rabbitmq_mqtt:auth_SUITE -t- --test_sharding_strategy=disabled --test_env FOCUS="-group [v5,limit] -case vhost_queue_limit"
genhtml --output genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat"
open genhtml/index.html
```
where `genhtml` is
https://github.com/linux-test-project/lcov/blob/master/bin/genhtml

Prior to this commit, coverage was broken with both Bazel and Erlang.mk:

On main - below logs are printed in different outputs:
First:
```
*** CT 2023-11-07 16:40:04.959 *** COVER INFO🔗
Adding nodes to cover test: ['rmq-ct-reader_SUITE-1-21000@localhost']
```

followed by
```
Could not start cover on 'rmq-ct-reader_SUITE-1-21000@localhost': {error,
                                                                   {already_started,
                                                                    <20798.286.0>}}
```

followed by
```
*** CT 2023-11-07 16:40:04.960 *** COVER INFO🔗
Successfully added nodes to cover test: []
```

followed by
```
Error in process <0.202.0> on node ct_rabbitmq_mqtt@nuc with exit value:
{{badmatch,{ok,[]}},
 [{rabbit_ct_broker_helpers,'-cover_add_node/1-fun-0-',1,
                            [{file,"rabbit_ct_broker_helpers.erl"},
                             {line,2211}]},
  {rabbit_ct_broker_helpers,query_node,2,
                            [{file,"rabbit_ct_broker_helpers.erl"},
                             {line,824}]},
  {rabbit_ct_broker_helpers,run_node_steps,4,
                            [{file,"rabbit_ct_broker_helpers.erl"},
                             {line,447}]},
  {rabbit_ct_broker_helpers,start_rabbitmq_node,4,
                            [{file,"rabbit_ct_broker_helpers.erl"},
```

It's also worth mentioning that
`make run-broker`
on v3.12.x:
```
  Starting broker... completed with 36 plugins.
1> whereis(cover_server).
undefined
```
but on main:
```
  Starting broker... completed with 36 plugins.
1> whereis(cover_server).
<0.295.0>
```
So, process `cover_server` runs on main in non test code.
2023-11-08 10:49:03 +01:00
Karl Nilsson 62b675969f fix streams minority calculation 2023-11-08 09:04:53 +00:00
Michael Klishin e52772057c
Merge pull request #9874 from rabbitmq/opt-mgmt-queue-listings
Optimise HTTP API /queues endpoint
2023-11-07 14:30:42 -05:00
Michael Klishin f109d73a3a
Merge pull request #9891 from rabbitmq/dependabot/maven/deps/rabbitmq_amqp1_0/test/system_SUITE_data/java-tests/main/org.apache.maven.plugins-maven-surefire-plugin-3.2.2
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.1 to 3.2.2 in /deps/rabbitmq_amqp1_0/test/system_SUITE_data/java-tests
2023-11-07 13:59:29 -05:00
dependabot[bot] 9e963c97ef
Bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 18:51:41 +00:00
Michael Klishin b54ec8d04a
Merge pull request #9889 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/org.apache.maven.plugins-maven-surefire-plugin-3.2.2
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.1 to 3.2.2 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2023-11-07 13:36:23 -05:00
Michael Klishin 4e0df85d30
Merge pull request #9887 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.apache.maven.plugins-maven-surefire-plugin-3.2.2
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.1 to 3.2.2 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2023-11-07 13:36:10 -05:00
Michael Klishin 07cac5e8ba
Merge pull request #9886 from rabbitmq/dependabot/maven/deps/rabbitmq_stream_management/test/http_SUITE_data/main/org.apache.maven.plugins-maven-surefire-plugin-3.2.2
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.1 to 3.2.2 in /deps/rabbitmq_stream_management/test/http_SUITE_data
2023-11-07 13:30:53 -05:00
dependabot[bot] c3676c6c79
Bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 18:30:48 +00:00
dependabot[bot] 37acb08feb
Bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 18:25:28 +00:00
dependabot[bot] d9c1406f62
Bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 18:14:33 +00:00
Karl Nilsson baff660ab4 use right dummy type 2023-11-07 11:53:57 +00:00
David Ansari 5b18e9d982 Avoid warning of unhandled message
Prior to this commit:
1. Start RabbitMQ with MQTT plugin enabled.
2.
```
rabbitmq-diagnostics consume_event_stream
^C
```
3. The logs will print the following warning:
```
[warning] <0.570.0> ** Undefined handle_info in rabbit_mqtt_internal_event_handler
[warning] <0.570.0> ** Unhandled message: {'DOWN',#Ref<0.2410135134.1846280193.145044>,process,
[warning] <0.570.0>                               <52723.100.0>,noconnection}
[warning] <0.570.0>
```

This is because rabbit_event_consumer:init/1 monitors the CLI process.

Any rabbit_event handler should therefore implement handle_info/2.

It's similar to what's described in the gen_event docs about
add_sup_handler/3:
> Any event handler attached to an event manager which in turn has a
> supervised handler should expect callbacks of the shape
> Module:handle_info({'EXIT', Pid, Reason}, State).
2023-11-07 12:33:02 +01:00
Karl Nilsson ff12d3b6b4 HTTP API /queues optimise resource_exists
There is no need to list all queues to check if the vhost
exists.
2023-11-07 11:27:11 +00:00
Karl Nilsson 9cf6454973 Expose rabbit_quorum_queue:infos/2
To allow callers to specify a subset of fields they'd like.
2023-11-07 09:20:52 +00:00
Karl Nilsson d77f937ff4 tweak 2023-11-07 08:48:57 +00:00
Arnaud Cogoluègnes 1ada0fd97f
Merge pull request #9883 from rabbitmq/dependabot/maven/deps/rabbitmq_amqp1_0/test/system_SUITE_data/java-tests/main/org.junit.jupiter-junit-jupiter-engine-5.10.1
Bump org.junit.jupiter:junit-jupiter-engine from 5.10.0 to 5.10.1 in /deps/rabbitmq_amqp1_0/test/system_SUITE_data/java-tests
2023-11-07 09:02:16 +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
Michael Klishin 9eecc15737
Merge pull request #9882 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.junit.jupiter-junit-jupiter-5.10.1
Bump org.junit.jupiter:junit-jupiter from 5.10.0 to 5.10.1 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2023-11-06 14:14:12 -05:00
Michael Klishin 1e82765524
Merge pull request #9881 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot/main/org.junit.jupiter-junit-jupiter-params-5.10.1
Bump org.junit.jupiter:junit-jupiter-params from 5.10.0 to 5.10.1 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot
2023-11-06 14:14:02 -05:00
dependabot[bot] 4cbe61362d
Bump org.junit.jupiter:junit-jupiter-engine
Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.10.0 to 5.10.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.0...r5.10.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 18:57:18 +00:00
dependabot[bot] 0664b7ec7b
Bump org.junit.jupiter:junit-jupiter
Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.10.0 to 5.10.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.0...r5.10.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 18:46:05 +00:00
dependabot[bot] 818d68695f
Bump org.junit.jupiter:junit-jupiter-params
Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.10.0 to 5.10.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.0...r5.10.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 18:41:57 +00: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
Karl Nilsson c2cd60b18d Optimise mgmt HTTP API /queues endpoint
Listing queues with the HTTP API when there are many (1000s) of
quorum queues could be excessively slow compared to the same scenario
with classic queues.

This optimises various aspects of HTTP API queue listings.
For QQs it removes the expensive cluster wide rpcs used to get the
"online" status of each quorum queue. This was previously done _before_
paging and thus would perform a cluster-wide query for _each_ quorum queue in
the vhost/system. This accounted for most of the slowness compared to
classic queues.

Secondly the query to separate the running from the down queues
consisted of two separate queries that later were combined when a single
query would have sufficed.

This commit also includes a variety of other improvements and minor
fixes discovered during testing and optimisation.

MINOR BREAKING CHANGE: quorum queues would previously only display one
of two states: running or down. Now there is a new state called minority
which is emitted when the queue has at least one member running but
cannot commit entries due to lack of quorum.

Also the quorum queue may transiently enter the down state when a node
goes down and before its elected a new leader.
2023-11-06 15:34:26 +00: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
Rin Kuryloski ac6301e27e
Merge pull request #9877 from rabbitmq/update-user-bazelrc-template
Adjust strategy flags for bazel
2023-11-06 11:14:43 +01:00
Rin Kuryloski 47566e418e Adjust strategy flags for bazel
With this adjustment, more actions will use the sandbox, which may
help with an error relating to a missing `rabbit.hrl` that could occur
when building the cli or running its tests

Since this adjusts the user-template.bazelrc, everyone should likely
update their own user.bazelrc accordingly
2023-11-06 10:08:24 +01:00
David Ansari 552775ead9 Fix dialyzer in OTP 25 2023-11-03 14:57:05 +01:00
Michael Klishin fcb4d95d80
Merge pull request #9870 from rabbitmq/fix-shovel-credit
Fix error insufficient_credit for AMQP 1.0 shovel
2023-11-03 09:19:37 -04:00
Rin Kuryloski b2d410b893 Add .mailmap file 2023-11-03 13:17:30 +01:00
David Ansari a6996ab1bc Fix error insufficient_credit for AMQP 1.0 shovel
WHY:

Shovelling from RabbitMQ to Azure Service Bus and Azure Event Hub fails.

Reported in
https://discord.com/channels/1092487794984755311/1092487794984755314/1169894510743011430

Reproduction steps:
1. Follow https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-integrate-with-rabbitmq
2. Publish messages to RabbitMQ:
```
java -jar target/perf-test.jar -x 1 -y 0 -u azure -p -C 100000 -s 1 -c 100000
```

Prior to this commit, after a few seconds and after around 20k messages
arrived in Azure, RabbitMQ errored and logged:
```
{function_clause,
    [{amqp10_client_connection,close_sent,
         [info,
          {'EXIT',<0.949.0>,
              {{badmatch,{error,insufficient_credit}},
               [{rabbit_amqp10_shovel,forward,4,
                    [{file,"rabbit_amqp10_shovel.erl"},
                     {line,334}]},
                {rabbit_shovel_worker,handle_info,2,
                    [{file,"rabbit_shovel_worker.erl"},
                     {line,101}]},
                {gen_server2,handle_msg,2,
                    [{file,"gen_server2.erl"},{line,1056}]},
                {proc_lib,init_p_do_apply,3,
                    [{file,"proc_lib.erl"},{line,241}]}]}},
```

After this commit, all 100k messages get shovelled to Azure Service Bus.

HOW:

1. Fix link credit accounting in Erlang AMQP 1.0 client library. For each
message being published, link credit must be decreased by 1 instead of
being increased by 1.

2. If the shovel plugin runs out of credits, it must wait until the
   receiver (Azure Service Bus) grants more credits to RabbitMQ.

Note that the solution in this commit is rather a naive quick fix for one
obvious bug. AMQP 1.0 integration between RabbitMQ and Azure Service Bus is
not tested and not guaranteed at this point in time.
More work will be needed in the future, some work is done as part of
https://github.com/rabbitmq/rabbitmq-server/pull/9022
2023-11-03 12:43:49 +01:00
David Ansari d1940c997e Fix Khepri flake
Previously, test pubsub was flaky
```
{shared_SUITE,pubsub,766}
{test_case_failed,missing m1}
```
because the binding wasn't present yet on node 0 when publishing to node
0.
2023-11-03 09:52:53 +01:00
Michael Davis 766f7a25ad
Fix a small typo in the 3.13.0 release notes 2023-11-02 15:21:32 -04:00