Commit Graph

30445 Commits

Author SHA1 Message Date
Michael Klishin 1150d51df1
Merge pull request #12577 from rabbitmq/su_aws/actually_handle_timeout_reconciliation
QQ periodic membership reconciliation: correctly return a `ra:members/2` error in case of a timeout
2024-10-23 22:21:27 -04:00
Simon Unge dacdeb024d Fix so that the code handles a timeout return 2024-10-23 23:12:36 +00:00
David Ansari 17df1b9343 Attempt to eliminate test flake
This commit attempts to eliminate the test flake described in
https://github.com/rabbitmq/rabbitmq-server/issues/12413#issuecomment-2385449940

```
rabbitmq_mqtt > parallel-ct-set-1 > mqtt_shared_SUITE > cluster_size_3 > v4 rabbit_mqtt_qos0_queue_kill_node

=== Ended at 2024-10-01 09:59:52
=== Location: [{mqtt_shared_SUITE,rabbit_mqtt_qos0_queue_kill_node,[1165](https://github.com/rabbitmq/rabbitmq-server/issues/mqtt_shared_suite.src.html#1165)},
              {test_server,ts_tc,1793},
              {test_server,run_test_case_eval1,1302},
              {test_server,run_test_case_eval,1234}]
=== === Reason: no match of right hand side value {publish_not_received,
                                                    <<"m1">>}
  in function  mqtt_shared_SUITE:rabbit_mqtt_qos0_queue_kill_node/1 (mqtt_shared_SUITE.erl, line 1165)
  in call from test_server:ts_tc/3 (test_server.erl, line 1793)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1302)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 1234)
```

This flake could not be reproduced locally.
This commit also assumes that this flake occurred under Khepri but not
under Mnesia.

The hypothesis is the following:
* Node 0 is down
* MQTT client creates binding on node 1
* Khepri commits since the binding is replicated and persisted on node 1
  and node 2. However the binding isn't reflected yet in node 2's
  routing projecting table.
* Publishing a message to node 2 routes to nowhere.
2024-10-23 17:36:58 +00:00
David Ansari 814d44dd82 Convert array from AMQP 1.0 to AMQP 0.9.1
Fix the following crash when an AMQP 0.9.1 client consumes an AMQP 1.0
encoded message that contains an array value in message annotations:
```
crasher:
  initial call: rabbit_channel:init/1
  pid: <0.685.0>
  registered_name: []
  exception exit: {function_clause,
                      [{mc_amqpl,to_091,
                           [<<"x-array">>,
                            {array,utf8,[{utf8,<<"e1">>},{utf8,<<"e2">>}]}],
                           [{file,"mc_amqpl.erl"},{line,737}]},
                       {mc_amqpl,'-convert_from/3-fun-3-',1,
                           [{file,"mc_amqpl.erl"},{line,168}]},
                       {lists,filtermap_1,2,
                           [{file,"lists.erl"},{line,2279}]},
                       {mc_amqpl,convert_from,3,
                           [{file,"mc_amqpl.erl"},{line,158}]},
                       {mc,convert,3,[{file,"mc.erl"},{line,332}]},
                       {rabbit_channel,handle_deliver0,4,
                           [{file,"rabbit_channel.erl"},{line,2619}]},
                       {lists,foldl_1,3,[{file,"lists.erl"},{line,2151}]},
                       {lists,foldl,3,[{file,"lists.erl"},{line,2146}]}]}
```
2024-10-22 12:16:19 +02:00
Michael Klishin d7c4e94331
Merge pull request #12550 from rabbitmq/lukebakken/shellcheck-init-slapd
Ensure init-slapd.sh passes `shellcheck`
2024-10-22 00:56:30 -04:00
GitHub 7d8d338bf0 bazel run gazelle 2024-10-22 04:02:23 +00:00
Lois Soto Lopez 3ff7e82c5c Provide specific f. to fix client ssl options
Provides a specific function to fix client ssl options, i.e.: apply all
fixes that are applied for TLS listeneres and clients on previous
versions but also sets `cacerts` option to CA certificates obtained by
`public_key:cacerts_get`, only when no `cacertfile` or `cacerts` are
provided.
2024-10-21 18:00:06 -04:00
Michael Klishin f4e689310f
Merge pull request #12563 from rabbitmq/dependabot/maven/deps/rabbitmq_stream_management/test/http_SUITE_data/main/junit.jupiter.version-5.11.3
build(deps-dev): bump junit.jupiter.version from 5.11.2 to 5.11.3 in /deps/rabbitmq_stream_management/test/http_SUITE_data
2024-10-21 15:04:12 -04:00
Michael Klishin 770c807b56
Merge pull request #12560 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot/main/org.junit.jupiter-junit-jupiter-params-5.11.3
build(deps-dev): bump org.junit.jupiter:junit-jupiter-params from 5.11.2 to 5.11.3 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot
2024-10-21 15:04:04 -04:00
Michael Klishin b72adebf0c
Merge pull request #12561 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/junit.jupiter.version-5.11.3
build(deps-dev): bump junit.jupiter.version from 5.11.2 to 5.11.3 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2024-10-21 15:03:57 -04:00
dependabot[bot] 87ebc27c1c
build(deps-dev): bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.2 to 5.11.3.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.2 to 5.11.3
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.2 to 5.11.3
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- 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>
2024-10-21 19:00:47 +00:00
dependabot[bot] 45d285b06d
build(deps-dev): bump org.junit.jupiter:junit-jupiter
Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.11.2 to 5.11.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3)

---
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>
2024-10-21 19:00:19 +00:00
dependabot[bot] c9206ca2cd
build(deps-dev): bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.2 to 5.11.3.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.2 to 5.11.3
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.2 to 5.11.3
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- 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>
2024-10-21 18:57:44 +00:00
dependabot[bot] 7016af6c53
build(deps-dev): bump org.junit.jupiter:junit-jupiter-params
Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.11.2 to 5.11.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3)

---
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>
2024-10-21 18:44:27 +00:00
David Ansari cbe5551cf1 bazel run gazelle 2024-10-20 12:41:23 +02:00
David Ansari dc9ebc5b81 Check topic permissions of CC and BCC headers 2024-10-20 11:41:29 +02:00
Luke Bakken c69aa911c4
Ensure init-slapd.sh passes `shellcheck` 2024-10-18 16:46:08 -07:00
David Ansari 97512b0a9e
Merge pull request #12549 from rabbitmq/amqp-filtex-errors
Prevent crash for invalid application-properties filter
2024-10-18 17:46:03 +02:00
David Ansari c5b6e7f297 bazel run gazelle 2024-10-18 16:09:00 +02:00
David Ansari 1827df811a Prevent crash for invalid application-properties filter
application-properties keys are restricted to be strings.

Prior to this commit, a function_clause error occurred if the client
requested an invalid filter:
```
  │ *Error{Condition: amqp:internal-error, Description: Session error: function_clause
  │ [{rabbit_amqp_filtex,'-validate0/2-fun-0-',
  │                      [{{symbol,<<"subject">>},{utf8,<<"var">>}}],
  │                      [{file,"rabbit_amqp_filtex.erl"},{line,119}]},
  │  {lists,map,2,[{file,"lists.erl"},{line,2077}]},
  │  {rabbit_amqp_filtex,validate0,2,[{file,"rabbit_amqp_filtex.erl"},{line,119}]},
  │  {rabbit_amqp_filtex,validate,1,[{file,"rabbit_amqp_filtex.erl"},{line,28}]},
  │  {rabbit_amqp_session,parse_filters,2,
  │                       [{file,"rabbit_amqp_session.erl"},{line,3068}]},
  │  {rabbit_amqp_session,parse_filter,1,
  │                       [{file,"rabbit_amqp_session.erl"},{line,3014}]},
  │  {rabbit_amqp_session,'-handle_attach/2-fun-0-',21,
  │                       [{file,"rabbit_amqp_session.erl"},{line,1371}]},
  │
  {rabbit_misc,with_exit_handler,2,[{file,"rabbit_misc.erl"},{line,465}]}],
  Info: map[]}
```

After this commit, the filter won't actually take effect without a crash occurring.

Supersedes #12520
2024-10-18 15:37:28 +02:00
Michael Klishin 17dd95a801
Merge pull request #12543 from rabbitmq/su_aws/fix_desctiption_qq_target_group_size_policy
Fix module mentioned in target group size description
2024-10-18 09:01:19 -04:00
David Ansari d1d7d7bad4 Optionally notify client app with AMQP 1.0 performative
This commit notifies the client app with the AMQP performative if
connection config `notify_with_performative` is set to `true`.

This allows the client app to learn about all fields including
properties and capabilities returned by the AMQP server.
2024-10-18 13:51:35 +02:00
Simon Unge 691a0368ba Fix module mentioned in target group size description 2024-10-17 22:52:00 +00:00
Luke Bakken 3d668fda46
Grafana: add a runtime/Erlang/BEAM dashboard (#12456)
* Add BEAM dashboard

Also update the other dashboards by opening in Grafana v11.2.2 and ensuring they work as expected.

* Update the Erlang-Distributions-Compare dashboard

* Update the RabbitMQ-Overview dashboard

* Update the RabbitMQ-Quorum-Queues-Raft dashboard

* Update the RabbitMQ-Stream dashboard

* Update distribution link status panel

---------

Co-authored-by: Michal Kuratczyk <mkuratczyk@vmware.com>
2024-10-17 07:10:54 -07:00
Loïc Hoguin 469c3a0791
Make CI: Check that CI knows about all CT_SUITES in CI
Instead of every time we run Make for these applications.

This means that during development we are free to modify
these values or create new test suites without having to
worry about the check. If we forget to then add the test
suites in PARALLEL_CT the workflow will tell us.
2024-10-17 10:52:28 +02:00
David Ansari ab8814ad7d Fix error message
Prior to this commit if dotnet or mvnw failed to fetch test
dependencies, for example because dotnet isn't installed, the test setup
crashed in an unexpected way:
```
amqp_system_SUITE > dotnet
    {'EXIT',
        {badarg,
            [{lists,keysearch,
                 [rmq_nodes,1,
                  {skip,
                      "Failed to fetch .NET Core test project dependencies"}],
                 [{error_info,#{module => erl_stdlib_errors}}]},
             {test_server,lookup_config,2,
                 [{file,"test_server.erl"},{line,1779}]},
             {rabbit_ct_broker_helpers,get_node_configs,2,
                 [{file,"rabbit_ct_broker_helpers.erl"},{line,1411}]},
             {rabbit_ct_broker_helpers,enable_feature_flag,2,
                 [{file,"rabbit_ct_broker_helpers.erl"},{line,1999}]},
             {amqp_system_SUITE,init_per_group,2,
                 [{file,"amqp_system_SUITE.erl"},{line,77}]},
             {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
             {test_server,run_test_case_eval1,6,
                 [{file,"test_server.erl"},{line,1391}]},
             {test_server,run_test_case_eval,9,
                 [{file,"test_server.erl"},{line,1235}]}]}}
```

This commit improves the error message instead of failing with `badarg`.

This commit also decides to fail the test setup instead of skipping the
suite because we always want CI to execute this test and be notified
instead of silently skipping if the test can't be run.
2024-10-16 17:53:17 +02:00
David Ansari 8c0cd1b78c Bump dotnet
This commit fixes the CI error on `main` branch where
amqp_system_SUITE failed with the following error:
```
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.String.ToLowerInvariant()
   at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetArch()
   at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment..cctor()
   at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier()
   at Microsoft.DotNet.Cli.MulticoreJitProfilePathCalculator.CalculateProfileRootPath()
   at Microsoft.DotNet.Cli.MulticoreJitActivator.StartCliProfileOptimization()
   at Microsoft.DotNet.Cli.MulticoreJitActivator.TryActivateMulticoreJit()
   at Microsoft.DotNet.Cli.Program.Main(System.String[])

Exit code: 134 (pid <0.1533.0>)
```
2024-10-16 16:35:37 +02:00
David Ansari 358ff79611 Provide clear error message for reserved annotation keys
As described in https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-annotations
> The annotations type is a map where the keys are restricted to be of type symbol or of type ulong.
> All ulong keys, and all symbolic keys except those beginning with "x-" are reserved.

Prior to this commit, if an AMQP client used a reserved annotation key,
the entire AMQP connection terminated with a function_clause error
message that might be difficult to understand for client libs:
```
<<"Session error: function_clause\n[{amqp10_framing,'-decode_annotations/1-fun-0-',\n                 [{{symbol,<<\"aa\">>},{utf8,<<\"bbb\">>}}],\n                 [{file,\"amqp10_framing.erl\"},{line,158}]},\n {lists,map,2,[{file,\"lists.erl\"},{line,1559}]},\n {amqp10_framing,decode,1,[{file,\"amqp10_framing.erl\"},{line,127}]},\n {lists,map_1,2,[{file,\"lists.erl\"},{line,1564}]},\n {lists,map,2,[{file,\"lists.erl\"},{line,1559}]},\n {mc_amqp,init,1,[{file,\"mc_amqp.erl\"},{line,102}]},\n {mc,init,4,[{file,\"mc.erl\"},{line,150}]},\n {rabbit_amqp_session,incoming_link_transfer,4,\n                      [{file,\"rabbit_amqp_session.erl\"},{line,2341}]}]">>
```

This commit ends only the session and provides a clearer error message.
2024-10-16 14:14:04 +02:00
Loïc Hoguin e4d20bba51
Merge pull request #12502 from rabbitmq/loic-ct-master-patching
Make CI: Fix and enhance ct_master
2024-10-16 12:40:06 +02:00
Karl Nilsson 3b1ef8f529 QQ: fix the key_metrics_rpc function.
Currently this function always falls back to the compatibility code
and never gets the benefit of using ra:key_metrics/1 due to incorrect
use of the map update operatior ":=" instead of the insert operator
"=>".
2024-10-15 16:30:39 +01:00
Loïc Hoguin 4127f15676
Make CI: Bazel updates following ct_master work 2024-10-15 14:57:42 +02:00
Loïc Hoguin 8d411c7cda
Make CI: Print auto-skipped and failed test cases at the end
Of a ct_master run. This uses the builtin CT Master event
handler to gather the results.
2024-10-15 14:57:42 +02:00
Loïc Hoguin 655caf6d1a
Make CI: Have ct_master return the test results
Instead of having a CT hook just to know whether our tests failed.
2024-10-15 14:57:42 +02:00
Loïc Hoguin dddf917378
Make CI: Sort the results printout from ct_master
It makes more sense to sort by node name, than to have
the results in the order they finished.
2024-10-15 14:57:42 +02:00
Loïc Hoguin 6cdc32f558
Make CI: Make ct_master handle all testspec instructions 2024-10-15 14:57:42 +02:00
Loïc Hoguin 77ab5eddcb
Reduce the amount of printing to the terminal during tests 2024-10-15 14:57:42 +02:00
Loïc Hoguin 1897e02764
Make CI: Fix a small issue in master_runs.html 2024-10-15 14:57:42 +02:00
Loïc Hoguin ce7184598c
Make CI: Fix the master_runs.html css file paths
Needed to file:set_cwd like in normal CT.
2024-10-15 14:57:42 +02:00
Loïc Hoguin 37c2f9f675
Make CI: Don't refresh logs at the end of ct_master run
The ct_run:run_test function already takes care of the
node's logs. The ct_master_logs module takes care of
ct_master itself.
2024-10-15 14:57:41 +02:00
Loïc Hoguin 807c8f8a0b
Make CI: Add forks of ct_master_event and ct_master_logs 2024-10-15 14:57:41 +02:00
Arnaud Cogoluègnes 966e06f2f7
Use inner module function to increment stream protocol counter
Reduce duplication.
2024-10-14 09:53:48 +02:00
Arnaud Cogoluègnes affdeb3125
Use macro for stream publisher/consumer reference check guard
References #12499
2024-10-14 09:24:57 +02:00
Michael Klishin 2acc3298b3
Merge pull request #12503 from rabbitmq/rabbitmq-server-12499-check-stream-publisher-reference-length
Return error if stream publisher/consumer reference is longer than 255 characters
2024-10-11 13:33:07 -04:00
Michael Klishin 1726064579
Merge pull request #12208 from rabbitmq/qq-otp27-conf
Adjust vheap sizes for message handling processes in OTP 27
2024-10-11 09:59:40 -04:00
Arnaud Cogoluègnes 622dec011d
Return error if store offset reference is longer than 255 characters 2024-10-11 14:55:44 +02:00
David Ansari b1064fddba Support negative integers in modified annotations 2024-10-11 14:43:31 +02:00
David Ansari 2e90619a62 Add custom dead letter history test
Test the use case described in https://github.com/rabbitmq/rabbitmq-website/pull/2095:

> Rather than relying solely on RabbitMQ's built-in dead lettering tracking via x-opt-deaths,
consumers can customise dead lettering event tracking.
2024-10-11 13:00:25 +02:00
David Ansari 855a32ab28 Add alternate exchange test assertion
Test the use case described in
https://github.com/rabbitmq/rabbitmq-website/pull/2095
2024-10-11 12:23:00 +02:00
David Ansari e6818f0040 Track requeue history
Support tracking the requeue history as described in
https://github.com/rabbitmq/rabbitmq-website/pull/2095

This commit:
1. adds a test case tracing the requeue history via AMQP 1.0
   using the modified outcome and
2. fixes bugs in the broker which crashed if a modified message
   annotation value is an AMQP 1.0 list, map, or array.

Complex modified annotation values (list, map, array) are stored as tagged values from now on.
This means AMQP 0.9.1 consumers will not receive modified annotations of
type list, map, or array (which is okay).
2024-10-11 12:21:28 +02:00
Arnaud Cogoluègnes 0260862a27
Return error if stream consumer reference is longer than 255 characters 2024-10-11 11:29:09 +02:00
Arnaud Cogoluègnes 4e8fb46bbf
Return error if stream publisher reference is longer than 255 characters
Fixes #12499
2024-10-11 10:34:45 +02:00
Michael Klishin d9ff6a00d8
Merge pull request #12501 from rabbitmq/flake-clustering-queue-on-other-node
Tests: wait until stats are published, not just collected on the agent
2024-10-10 23:07:49 -04:00
dependabot[bot] c2c6748847
build(deps): bump kotlin.version
Bumps `kotlin.version` from 2.0.20 to 2.0.21.

Updates `org.jetbrains.kotlin:kotlin-test` from 2.0.20 to 2.0.21
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.21/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.20...v2.0.21)

Updates `org.jetbrains.kotlin:kotlin-maven-allopen` from 2.0.20 to 2.0.21

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-maven-allopen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-10 19:00:23 +00:00
Diana Parra Corbacho 7d45609b1a Tests: wait until stats are published, not just collected on the agent 2024-10-10 12:57:14 +02:00
Diana Parra Corbacho 45718fbcf6 Tests: wait until stats are published, not just collected on the agent 2024-10-10 12:34:59 +02:00
Michal Kuratczyk 6a7f8d0d1e Remove redundant copy of adjust_for_message_handling_proc/0 2024-10-09 20:08:34 -04:00
Karl Nilsson 465b19e8e8 Adjust vheap sizes for message handling processes in OTP 27
OTP 27 reset all assumptions on how the vm reacts to processes that
buffer and process a lot of large binaries.

Substantially increasing the vheap sizes for such process restores
most of the same performance by allowing processes to hold more binary
data before major garbage collections are triggered.

This introduces a new module to capture process flag configurations.

The new vheap sizes are only applied when running on OTP 27 or
above.
2024-10-09 20:08:34 -04:00
Michael Klishin 9893a2bd48
Merge pull request #12399 from rabbitmq/deprecate-oauth2-settings
Deprecate two OAuth2 settings: auth_oauth2.jwks_url and management.metadata_url
2024-10-09 11:46:58 -04:00
Marcial Rosales 0f1b8760a4 Fix issue 2024-10-09 11:01:09 -04:00
Marcial Rosales 0c8dadd662 Fix failing test cases 2024-10-09 11:01:09 -04:00
Marcial Rosales 0835c7ecf4 Resolve merge conflicts 2024-10-09 11:01:09 -04:00
Marcial Rosales c9d5ddf89f Deprecate oauth_metadata_url
If oauth_metadata_url is configured, RabbitMQ uses it.
Else it uses the discovery_endpoint url calculated from
issuer and discovery_endpoint_path
2024-10-09 11:01:09 -04:00
Marcial Rosales ee8d5f7fb0 Deprecate jwks_url but it is still supported
jwks_uri takes precedence when both are set
2024-10-09 11:01:09 -04:00
Marcial Rosales 322a9a9f9f Rename jkws_url to jwks_uri 2024-10-09 11:01:09 -04:00
Marcial Rosales b21a222abd Remove management.oauth_metadata_url 2024-10-09 11:01:09 -04:00
Marcial Rosales 423b591310 Fix failing test cases 2024-10-09 10:57:38 -04:00
Marcial Rosales ebc3dea971 Minor formatting improvement 2024-10-09 10:57:38 -04:00
Marcial Rosales b966ab7b72 Configure scope_aliases also per resource_server 2024-10-09 10:57:38 -04:00
Marcial Rosales 3e81cfa89d Handle wrong scope_aliases configuration 2024-10-09 10:57:38 -04:00
Marcial Rosales 48670a0ecf Support two modes of configuring
scope_aliases using cuttlefish
2024-10-09 10:57:38 -04:00
Marcial Rosales a30c829ec5 Test translation function of scope_aliases 2024-10-09 10:57:38 -04:00
Marcial Rosales dcb52638ab Minor refactoring 2024-10-09 10:57:38 -04:00
Marcial Rosales 5841e37804 Fix schema translation for
scope_aliases
2024-10-09 10:57:38 -04:00
Marcial Rosales cd46b406df Modify schema to include scope_aliases
WIP Add translation function
2024-10-09 10:57:38 -04:00
GitHub 5ae16631e9 bazel run gazelle 2024-10-09 04:02:38 +00:00
Michael Klishin c15f19fe83 OAuth 2: CLI is a build time dependency, not a runtime one 2024-10-08 07:11:43 -04:00
Michael Klishin e7f82a53ba OAuth 2: add a missing dependency on rabbitmq_cli 2024-10-08 07:09:08 -04:00
GitHub d63d70c36c bazel run gazelle 2024-10-08 07:09:08 -04:00
Loïc Hoguin 545abce10f CQ: Fix shared store scanner missing messages
It was still possible, although rare, to have message store
files lose message data, when the following conditions were
met:

 * the message data contains byte values 255
   (255 is used as an OK marker after a message)
 * the message is located after a 0-filled hole in the file
 * the length of the data is at least 4096 bytes and
   if we misread it (as detailed below) we encounter
   a 255 byte where we expect the OK marker

The trick for the code to previously misread the length can
be explained as follow:

A message is stored in the following format:

  <<Len:64, MsgIdAndMsg:Len/unit:8, 255>>

With MsgId always being 16 bytes in length. So Len is always
at least 16, if the message data Msg is empty. But technically
it never is.

Now if we have a zero filled hole just before this message,
we may end up with this:

  <<0, Len:64, MsgIdAndMsg:Len/unit:8, 255>>

When we are scanning we are testing bytes to see if there is
a message there or not. We look for a Len that gives us byte
255 after MsgIdAndMsg.

Len of value 4096 looks like this in binary:

  <<0:48, 16, 0>>

Problem is if we have leading zeroes, Len may look like this:

  <<0, 0:48, 16, 0>>

If we take the first 64 bits we get a potential length of 16.
We look at the byte after the next 16 bytes. If it is 255, we
think this is a message and skip by this amount of bytes, and
mistakenly miss the real message.

Solving this by changing the file format would be simple enough,
but we don't have the luxury to afford that. A different solution
was found, which is to combine file scanning with checking that
the message exists in the message store index (populated from
queues at startup, and kept up to date over the life time of
the store). Then we know for sure that the message above
doesn't exist, because the MsgId won't be found in the index.
If it is, then the file number and offset will not match,
and the check will fail.

There remains a small chance that we get it wrong during dirty
recovery. Only a better file format would improve that.
2024-10-08 07:09:08 -04:00
Marcial Rosales 743f663520 Fix bazel configuration 2024-10-08 08:17:48 +02:00
Marcial Rosales 0ec415a419 Fix bazel misconfiguration 2024-10-08 08:17:48 +02:00
Marcial Rosales d25e0f8e88 Refactoring
- Use rabbit_oauth2 prefix for modules which do not have it
- Ensure most lines stick to 80 column
2024-10-08 08:17:48 +02:00
Michael Klishin ea6f194eb3 OAuth 2 client: sync option/1 with rabbit_types, add a comment 2024-10-08 08:17:48 +02:00
Marcial Rosales f56324e72c Remove wrong file 2024-10-08 08:17:48 +02:00
Marcial Rosales 16cccd3181 Remove some spaces 2024-10-08 08:17:48 +02:00
Marcial Rosales a882f8a37c Fix error 2024-10-08 08:17:48 +02:00
Marcial Rosales 252b02c0eb Remove unnecessary log statements 2024-10-08 08:17:48 +02:00
Marcial Rosales 4142b73738 Fix issue initializing oidc-client 2024-10-08 08:17:48 +02:00
Marcial Rosales 966d5d49b1 Fix fucntion signature 2024-10-08 08:17:48 +02:00
Marcial Rosales c1e8279743 Remove function 2024-10-08 08:17:48 +02:00
Marcial Rosales 4b7f8b28e2 Fix schema mapping issues
And location of cert files when running
multioauth test suites locally
2024-10-08 08:17:48 +02:00
Marcial Rosales 6e74d8b60e Always use list() type for urls 2024-10-08 08:17:48 +02:00
Marcial Rosales 6d0e195957 Fix schema issues
And fix selenium script to run
rabbitrmq locally
2024-10-08 08:17:48 +02:00
Marcial Rosales 33da3767a3 Teet extra token parans for additioal resource servers 2024-10-08 08:17:48 +02:00
Marcial Rosales 94a9cf6729 Test authSettings with extra endpoint params 2024-10-08 08:17:48 +02:00
Marcial Rosales 0e80bfb89e Add auth and token endpoint params to authSettings 2024-10-08 08:17:48 +02:00
Marcial Rosales 81342dfbed WIP Elminate defaults and take from config
Add javascript unit tests given that amount of
javascript code it is difficult to get good coverage
with just end-to-end tests
The tests are not running yet because i need to learn
how to use Babel to convert ES5 modules into NodeJs modules
otherwise it is not possible because all the source modules
use ES5 modules whereas tests run from node.js which requires
CommonJS
2024-10-08 08:17:48 +02:00
Marcial Rosales c7681c974b Send new params to management ui 2024-10-08 08:17:48 +02:00
Marcial Rosales b2532e0c1d Modify management schema
to be able to set extra parameters
for authorize and token endpoints
2024-10-08 08:17:48 +02:00
Marcial Rosales 06edb55dbd Fix dialyzer error 2024-10-08 08:17:48 +02:00
Marcial Rosales 9ec93c98f7 Clean up ct:log statements
WIP address a dialyzer error
2024-10-08 08:17:48 +02:00
Marcial Rosales 462c7e5546 Fix test case 2024-10-08 08:17:48 +02:00
Marcial Rosales 0de61a973c WIP Build discovery_endpoint 2024-10-08 08:17:48 +02:00
Marcial Rosales eb2fbc6d9b Improve format 2024-10-08 08:17:48 +02:00
Marcial Rosales 9f11f25b9d Fix test 2024-10-08 08:17:48 +02:00
Marcial Rosales b339714bf8 Test invalid token parameter config 2024-10-08 08:17:48 +02:00
Marcial Rosales 0d4fb55cda Remove unnecessary statement 2024-10-08 08:17:48 +02:00
Marcial Rosales 5044e297d4 Add token endpoint params to schema 2024-10-08 08:17:48 +02:00
Marcial Rosales 7792b70c13 Fix dialyzer errors 2024-10-08 08:17:48 +02:00
Marcial Rosales 12b8c0db58 Fix all test in unit_SUITE 2024-10-08 08:17:48 +02:00
Marcial Rosales b9217aee48 Fix test cases and refactor rar and keycloak
functionality into their own modules
2024-10-08 08:17:48 +02:00
Marcial Rosales 54ac148daf Fix issue and test
WIP rename all token_validation
to normalize_token_scope
2024-10-08 08:17:48 +02:00
Marcial Rosales 0f5f76677f More test fixes + clean up + refactor 2024-10-08 08:17:48 +02:00
Marcial Rosales 9ecca5ae7a Fix test system test cases
And move constants to oauth2.hrl
2024-10-08 08:17:48 +02:00
Marcial Rosales c4e852116b Fix test cases 2024-10-08 08:17:48 +02:00
Marcial Rosales 8339015f80 WIP Use resource_server() type
check_token still needs some work
2024-10-08 08:17:48 +02:00
Marcial Rosales 42a1a47b7d Fix test cases 2024-10-08 08:17:47 +02:00
Marcial Rosales 5c2b90bece fix some test cases 2024-10-08 08:17:47 +02:00
Marcial Rosales 2f0faec58c Fix test cases 2024-10-08 08:17:47 +02:00
Marcial Rosales b5230f7afd Fix some test cases 2024-10-08 08:17:47 +02:00
Marcial Rosales 66d9323148 Simplify module names 2024-10-08 08:17:47 +02:00
Marcial Rosales 34f5d107d2 WIP fix more test cases 2024-10-08 08:17:47 +02:00
Marcial Rosales 158fa3b6b1 WIP fix some test cases
Pending to add more scenarios whch
combine +2 resources with and without
verify_aud and with and without audience
in token
2024-10-08 08:17:47 +02:00
Marcial Rosales aecb86d56d WIP Fix test cases 2024-10-08 08:17:47 +02:00
Marcial Rosales 4576aaa32e Refactor assertion function 2024-10-08 08:17:47 +02:00
Marcial Rosales af4ce0b1e8 WIP Fix compilation errors
Fixing test cases
2024-10-08 08:17:47 +02:00
Marcial Rosales 91e46668b0 WIP Continue refactoring + clean up 2024-10-08 08:17:47 +02:00
Marcial Rosales 9984eef2d1 WIP Fix compilation errors 2024-10-08 08:17:47 +02:00
Marcial Rosales 7064969ca5 WIP More refactoring
split rabbit_oauth2_config into
- rabbit_oauth2_resource_server
- rabbit_oauth2_oauth_provider

and their respective test modules

Signing keys is an oauth provider
concern hence it stays with the
oauth_provider module.
2024-10-08 08:17:47 +02:00
Marcial Rosales 2a3dcb3679 WIP Refactor code
before implementing oidc endpoints parameters
2024-10-08 08:17:47 +02:00
Marcial Rosales 6fb83af48e Reduce logging verbosity 2024-10-08 08:17:47 +02:00
Marcial Rosales 3cf5b7e03e Reduce verbosity of some log statements 2024-10-08 08:17:47 +02:00
Marcial Rosales 4da45996ca Minor refactor
Improve logging
Fix an issue running selenium tests locally
WIP modify schema to configure queryParameters for
oauth2 endpoints
2024-10-08 08:17:47 +02:00
Marcial Rosales 7aca1605eb Deprecate resource req parameter from authorize endpoint 2024-10-08 08:17:47 +02:00
Michael Klishin 83d094d9bf
Merge pull request #12468 from rabbitmq/rabbitmq-server-12427
4.1, by @Ayanda-D: stop QQ replicas when a QQ is forced to shrink to a single replica
2024-10-07 20:46:11 -04:00
Michael Klishin 8b54d07d2a
Merge pull request #12473 from rabbitmq/rabbitmq-server-12470
4.1, by @SimonUnge: Dependency CSV updated from 3.2.0 to 3.2.1
2024-10-07 20:45:56 -04:00
Michael Klishin 90ec855ee3
Merge pull request #12469 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/org.apache.maven.plugins-maven-surefire-plugin-3.5.1
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.0 to 3.5.1 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2024-10-07 14:42:42 -04:00
Michael Klishin 578c9f4349
Merge pull request #12472 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.apache.maven.plugins-maven-surefire-plugin-3.5.1
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.0 to 3.5.1 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2024-10-07 14:42:35 -04:00
dependabot[bot] 7fc2fcd7a5
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.0...surefire-3.5.1)

---
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>
2024-10-07 18:38:10 +00:00
dependabot[bot] 907834c70a
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.0...surefire-3.5.1)

---
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>
2024-10-07 18:38:06 +00:00
dependabot[bot] eba5246ded
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.0...surefire-3.5.1)

---
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>
2024-10-07 18:29:54 +00:00
Simon Unge 012ba79129 Dependency CSV updated from 3.2.0 to 3.2.1 2024-10-07 18:27:05 +00:00
Ayanda Dube 16170d093b
Update QQ force-shrink logging
(cherry picked from commit dd5ec3ccc0)
2024-10-07 14:26:18 -04:00
Ayanda Dube c9d97e61de
Add test for QQ force_vhost_queues_shrink_member_to_current_member/1
(cherry picked from commit de0c0dbd89)
2024-10-07 14:26:10 -04:00
Ayanda Dube b03637f8ec
Implement force_vhost_queues_shrink_member_to_current_member/1
(cherry picked from commit c26aa3b1c7)
2024-10-07 14:26:04 -04:00
Ayanda Dube 10dbde1f71
QQ tests for force-shrink to current member operations
(cherry picked from commit 60ee35ea7e)
2024-10-07 14:25:57 -04:00
Ayanda Dube d9de6d989c
Shutdown peer QQ FSMs on connected nodes on force-shrink execution for cluster
wide consistency, ensuring only the leader is active/running

(cherry picked from commit b675ce29f0)
2024-10-07 14:25:49 -04:00
Jean-Sébastien Pédron 67af27b1b0
Merge pull request #12445 from rabbitmq/accept-relative-feature-flags-list-in-RABBITMQ_FEATURE_FLAGS-env
rabbit_feature_flags: Accept "+feature1,-feature2" in `$RABBITMQ_FEATURE_FLAGS`
2024-10-07 17:20:51 +02:00
David Ansari df59a52b70
Support AMQP filter expressions (#12415)
* Support AMQP filter expressions

 ## What?

This PR implements the following property filter expressions for AMQP clients
consuming from streams as defined in
[AMQP Filter Expressions Version 1.0 Working Draft 09](https://groups.oasis-open.org/higherlogic/ws/public/document?document_id=66227):
* properties filters [section 4.2.4]
* application-properties filters [section 4.2.5]

String prefix and suffix matching is also supported.

This PR also fixes a bug where RabbitMQ would accept wrong filters.
Specifically, prior to this PR the values of the filter-set's map were
allowed to be symbols. However, "every value MUST be either null or of a
described type which provides the archetype filter."

 ## Why?

This feature adds the ability to RabbitMQ to have multiple concurrent clients
each consuming only a subset of messages while maintaining message order.

This feature also reduces network traffic between RabbitMQ and clients by
only dispatching those messages that the clients are actually interested in.

Note that AMQP filter expressions are more fine grained than the [bloom filter based
stream filtering](https://www.rabbitmq.com/blog/2023/10/16/stream-filtering) because
* they do not suffer false positives
* the unit of filtering is per-message instead of per-chunk
* matching can be performed on **multiple** values in the properties and
  application-properties sections
* prefix and suffix matching on the actual values is supported.

Both, AMQP filter expressions and bloom filters can be used together.

 ## How?

If a filter isn't valid, RabbitMQ ignores the filter. RabbitMQ only
replies with filters it actually supports and validated successfully to
comply with:
"The receiving endpoint sets its desired filter, the sending endpoint
[RabbitMQ] sets the filter actually in place (including any filters defaulted at
the node)."

* Delete streams test case

The test suite constructed a wrong filter-set.
Specifically the value of the filter-set didn't use a described type as
mandated by the spec.
Using https://azure.github.io/amqpnetlite/api/Amqp.Types.DescribedValue.html
throws errors that the descriptor can't be encoded. Given that this code
path is already tests via the amqp_filtex_SUITE, this F# test gets
therefore deleted.

* Re-introduce the AMQP filter-set bug

Since clients might rely on the wrong filter-set value type, we support
the bug behind a deprecated feature flag and gradually remove support
this bug.

* Revert "Delete streams test case"

This reverts commit c95cfeaef7.
2024-10-07 17:12:26 +02:00
Michael Klishin 6c07e70042
Merge pull request #12442 from rabbitmq/gh_12424
QQ: fix bug with discards using a consumer_id()
2024-10-07 10:38:53 -04:00
Jean-Sébastien Pédron 9b2c6d95f8
rabbit_env: Drop $RABBITMQ_LOG_FF_REGISTRY
[Why]
Its use was removed when the registry was converted from a compiled
module to a persistent_term.
2024-10-07 14:02:50 +02:00
Jean-Sébastien Pédron 6a0008b06c
rabbit_feature_flags: Accept "+feature1,-feature2" in $RABBITMQ_FEATURE_FLAGS
[Why]
Before this patch, the $RABBITMQ_FEATURE_FLAGS environment variable took
an exhaustive list of feature flags to enable. This list overrode the
default of enabling all stable feature flags.

It made it inconvenient when a user wanted to enable an experimental
feature flag like `khepri_db` while still leaving the default behavior.

[How]
$RABBITMQ_FEATURE_FLAGS now acceps the following syntax:

    RABBITMQ_FEATURE_FLAGS=+feature1,-feature2

This will start RabbitMQ with all stable feature flags, plus `feature1`,
but without `feature2`.

For users setting `forced_feature_flags_on_init` in the config, the
corresponding syntax is:

    {forced_feature_flags_on_init, {rel, [feature1], [feature2]}}
2024-10-07 14:02:50 +02:00
Loïc Hoguin 9645fb1275
Make parallel-ct properly detect test failures
The problem comes from `ct_master` which doesn't tell us
in the return value whether the tests succeeded. In order
to get that information a CT hook was created. But then
we run into another problem: despite its documentation
claiming otherwise, `ct_master` does not handle `ct_hooks`
instructions in the test spec.

So for the time being we fork `ct_master` into a new
`ct_master_fork` module and insert our hook directly
in the code. Later on we will submit patches to OTP.
2024-10-07 13:30:32 +02:00
Michael Klishin 3540541cbc
Merge pull request #12458 from rabbitmq/rabbitmq-server-12449
By @gomoripeti: Don't start invalid but enabled plugins at startup
2024-10-05 00:08:19 -04:00
Michael Klishin 88691c6f8b
Merge pull request #12457 from rabbitmq/rabbitmq-server-12454
Remove multiple mentions of global prefetch from management UI, CLI, man pages
2024-10-05 00:08:02 -04:00
Péter Gömöri 2194822b36 Don't start invalid but enabled plugins at startup
For example during the startup after RabbitMQ was upgraded but an
enabled community plugin wasn't, and the plugin's broker version
requirement isn't met any more, RabbitMQ still started the plugin
after logging an error.
2024-10-04 20:53:13 -04: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 b3d6138e48
Merge pull request #12453 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.junit.jupiter-junit-jupiter-5.11.2
build(deps-dev): bump org.junit.jupiter:junit-jupiter from 5.11.1 to 5.11.2 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2024-10-04 19:43:24 -04:00
Michael Klishin c4ad4635c8
Merge pull request #12452 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot/main/org.junit.jupiter-junit-jupiter-params-5.11.2
build(deps-dev): bump org.junit.jupiter:junit-jupiter-params from 5.11.1 to 5.11.2 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot
2024-10-04 19:43:15 -04:00
Michael Klishin ff609d25ca
Merge pull request #12451 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/junit.jupiter.version-5.11.2
build(deps-dev): bump junit.jupiter.version from 5.11.1 to 5.11.2 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2024-10-04 19:43:06 -04:00
Johan Rhodin a15e1bfee8 Remove mention of global prefetch 2024-10-04 14:38:26 -05:00
dependabot[bot] ea435ecdbd
build(deps-dev): bump org.junit.jupiter:junit-jupiter
Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.11.1 to 5.11.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2)

---
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>
2024-10-04 18:32:14 +00:00
dependabot[bot] 75cd3d6d6f
build(deps-dev): bump org.junit.jupiter:junit-jupiter-params
Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.11.1 to 5.11.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2)

---
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>
2024-10-04 18:13:14 +00:00
dependabot[bot] d9e8fc8be0
build(deps-dev): bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.1 to 5.11.2.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.1 to 5.11.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.1 to 5.11.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- 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>
2024-10-04 18:10:26 +00:00
dependabot[bot] 2d10071f02
build(deps-dev): bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.1 to 5.11.2.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.1 to 5.11.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.1 to 5.11.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- 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>
2024-10-04 18:08:08 +00:00
Jean-Sébastien Pédron f832f2732d
rabbit_feature_flags: Hide required feature flags in management UI
[Why]
They just add noise to the UI and there is nothing the user can do about
them at that point.

Given their number will only increase, let's hide them to let the user
focus on the feature flags they can act on.
2024-10-04 15:46:00 +02:00
Jean-Sébastien Pédron d8ae8afe50
rabbit_feature_flags: Fix style 2024-10-03 18:00:12 +02:00
Jean-Sébastien Pédron 160180883b
rabbit_feature_flags: Log a inventory matrix instead of dumping the map
[Why]
The inventory map is huge and difficult to read when it is logged as
is.

[How]
Logging a matrix is much more compact and to the point.

Before:
    Feature flags: inventory of node `rabbit-1@giotto`:
    #{feature_flags =>
          #{rabbit_exchange_type_local_random =>
                #{name => rabbit_exchange_type_local_random,
                  desc => "Local random exchange",stability => stable,
                  provided_by => rabbit},
            message_containers_deaths_v2 =>
                #{name => message_containers_deaths_v2,
                  desc => "Bug fix for dead letter cycle detection",
    ...

After:
    Feature flags: inventory queried from node `rabbit-2@giotto`:
                                           ,-- rabbit-2@giotto
                                           |
                         amqp_address_v1:
          classic_mirrored_queue_version:  x
                 classic_queue_mirroring:  x
     classic_queue_type_delivery_support:  x
    ...
2024-10-03 18:00:02 +02:00
Jean-Sébastien Pédron 5370370d1d
rabbit_feature_flags: Hide required feature flags from the registry init logged list
[Why]
Showing that required feature flags are enabled over and over is not
useful and only adds noise to the logs.

[How]
Required feature flags and removed deprecated features are not lists
explicitly. We just log their respective numbers to still be clear that
they exist.

Before:
    list of feature flags found:
      [x] classic_mirrored_queue_version
      [x] classic_queue_type_delivery_support
      [x] direct_exchange_routing_v2
      [x] feature_flags_v2
      [x] implicit_default_bindings
      [ ] khepri_db
      [x] message_containers_deaths_v2
      [x] quorum_queue_non_voters
      [~] rabbit_exchange_type_local_random
      [x] rabbitmq_4.0.0
      ...
    list of deprecated features found:
      [ ] amqp_address_v1
      [x] classic_queue_mirroring
      [ ] global_qos
      [ ] queue_master_locator
      [ ] ram_node_type
      [ ] transient_nonexcl_queues

After:
    list of feature flags found:
      [ ] khepri_db
      [x] message_containers_deaths_v2
      [x] quorum_queue_non_voters
      [~] rabbit_exchange_type_local_random
      [x] rabbitmq_4.0.0
    list of deprecated features found:
      [ ] amqp_address_v1
      [ ] global_qos
      [ ] queue_master_locator
      [ ] ram_node_type
      [ ] transient_nonexcl_queues
    required feature flags not listed above: 18
    removed deprecated features not listed above: 1
2024-10-03 17:56:38 +02:00
Karl Nilsson 2339401abe QQ: fix bug with discards using a consumer_id()
Fixes a pattern matching bug for discards that come in after a consumer
has been cancelled. Because the rabbit_fifo_client does not keep
the integer consumer key after cancellation, late acks, returns, and
discards use the full {CTag, Pid} consumer id version.

As this is a state machine change the machine version has been
increased to 5.

The same bug is present for the `modify` command also however as
AMQP does not allow late settlements we don't have to make this
fix conditional on the machine version as it cannot happen.
2024-10-03 13:26:41 +01:00
Jean-Sébastien Pédron e4abbfd6c2
rabbit_feature_flags: Fix copyright year
The subsystem didn't exist before 2019. The deprecated features support
was added in 2023.
2024-10-03 13:03:58 +02:00
Jean-Sébastien Pédron 2f67d19bec
rabbit_feature_flags: Lock registry once and enable many feature flags
[Why]
Before this change, the controller was looping on all feature flags to
enable, then for each:
1. it checked if it was supported
2. it acquired the registry lock
3. it enabled the feature flag
4. it released the registry lock

It was done this way to not acquire the log if the feature flag was
unsupported in the first place.

However, this put more load on the lock mechanism.

[How]
This commit changes the order. The controller acquires the registry lock
once, then loops on feature flags to enable. The support check is now
under the registry lock.
2024-10-03 13:03:42 +02:00
Michael Klishin bc1e0ad2ab
Merge pull request #12437 from rabbitmq/rabbitmq-server-12422
By @ayanda-D: make sure (non-replicated) CQs (classic queues) emit leader and members metrics, just like replicated QQs
2024-10-03 01:52:02 -04:00
Michael Klishin 232798c12a This assertion does not belong to this leader-locator test 2024-10-03 01:12:39 -04:00
Michael Davis 537fe75483
Merge pull request #12416 from rabbitmq/md/binding-deletions-map-refactor 2024-10-02 15:27:07 -04:00
Ayanda Dube 71f921c090 support members info item in classic queues, which will always be the leader 2024-10-02 14:57:30 -04:00
Ayanda Dube f9e5d349df test and assert new classic queue leader info item 2024-10-02 14:57:30 -04:00
Ayanda Dube 22b433efb4 add support for the leader info item in classic queues 2024-10-02 14:57:30 -04:00
Michael Klishin 1f98ab6026 Add a rabbit.license_line default
so that products that build on top could adjust
what's printed in the standard banner.

References #12390
2024-10-01 20:25:25 -04:00
Michael Davis 4aa68ca4dd
Represent `rabbit_binding:deletions()` with a map instead of dict
The `dict:dict()` typing of `rabbit_binding` appears to be a historical
artifact. `dict` has been superseded by `maps`. Switching to a map
makes deletions easier to inspect manually and faster. Though if
deletions grow so large that the map representation is important,
manipulation of the deletions is unlikely to be expensive compared to
any other operations that produced them, so performance is probably
irrelevant.

This commit refactors the bottom section of the `rabbit_binding` module
to switch to a map, switch the `deletions()` type to an opaque,
eliminating a TODO created when using Erlang/OTP 17.1, and the deletion
value to a record. We eliminate some historical artifacts and "cruft":

* Deletions taking multiple forms needlessly, specifically the shape
  `{X, deleted | not_deleted, Bindings, none}` no longer being
  handled. `process_deletions/2` was responsible for creating this
  shape. Instead we now use a record to clearly define the fields.
* Clauses to catch `{error, not_found}` are unnecessary after minor
  refactors of the callers. Removing them makes the type specs cleaner.
* `rabbit_binding:process_deletions/1` has no need to update or change
  the deletions. This function uses `maps:foreach/2` instead and returns
  `ok` instead of mapped deletions.
* Remove `undefined` from the typespec of deletions. This value is no
  longer possible with a refactor to `maybe_auto_delete_exchange_in_*`
  functions for Mnesia and Khepri. The value was nonsensical since you
  cannot delete bindings for an exchange that does not exist.
2024-10-01 14:36:34 -04:00
David Ansari fa5b738cbc Fix shard counts
Half of these groups moved to the rabbitmq_web_mqtt plugin.
2024-10-01 18:02:00 +02:00
David Ansari db92f48dae bazel run gazelle 2024-10-01 18:02:00 +02:00
Jean-Sébastien Pédron f69c082b58
rabbit_feature_flags: New `check_node_compatibility/2` variant
... that considers the local node as if it was reset.

[Why]
When a node joins a cluster, we check its compatibility with the
cluster, reset the node, copy the feature flags states from the remote
cluster and add that node to the cluster.

However, the compatibility check is performed with the current feature
flags states, even though they are about to be reset. Therefore, a node
with an enabled feature flag that is unsupported by the cluster will
refuse to join. It's incorrect because after the reset and the states
copy, it could have join the cluster just fine.

[How]
We introduce a new variant of `check_node_compatibility/2` that takes an
argument to indicate if the local node should be considered as a virgin
node (i.e. like after a reset).

This way, the joining node will always be able to join, regardless of
its initial feature flags states, as long as it doesn't require a
feature flag that is unsupported by the cluster.

This also removes the need to use `$RABBITMQ_FEATURE_FLAGS` environment
variable to force a new node to leave stable feature flags disabled to
allow it to join a cluster running an older version.

References #9677.
2024-10-01 10:47:50 +02:00
Jean-Sébastien Pédron 30ab653561
rabbit_{mnesia,khepri}: Skip generic compat check if `CheckNodesConsistency` is false
[Why]
`CheckNodesConsistency` is set to false when the
`check_cluster_consistency()` is called as part of a node joining a
cluster. And the generic compatibility check was already executed by
`rabbit_db_cluster`.

There is no need to run it again. This is even counter-productive with
the improvement to `rabbit_feature_flags:check_node_compatibility/2`
that follows.
2024-10-01 10:47:49 +02:00
Jean-Sébastien Pédron 8126950ade
rabbit_mnesia: Make some functions backward-compatible
... with older RabbitMQ versions which don't know about Khepri.

[Why]
When an older node wants to join a cluster, it calls `node_info/0` and
`cluster_status_from_mnesia/0` directly using RPC calls. If it does that
against a node already using Khepri, t will get an error telling it that
Mnesia is not running. The error is reported to the end user, making it
difficult to understand the problem: both nodes are simply incompatible.

It's better to leave the final decision to the Feature flags subsystem,
but for that, `rabbit_mnesia` on the newer Khepri-based node still needs
to return something the older version can accept.

[How]
`cluster_status_from_mnesia/0` and `node_info/0` are modified to verify
if Khepri is enabled and if it is, return a value based on Khepri's
status as if it was from Mnesia.

This will let the remote older node to continue all its checks and
eventually refuse to join because the Feature flags subsystem will
indicate they are incompatible.
2024-10-01 10:47:42 +02:00
Loïc Hoguin 7fe78a3af9
Better fix for a Dialyzer warning
The previous fix was leading to a badmatch in some cases,
including when trying to stop a node that was already stopped.
2024-09-30 14:25:01 +02:00
Loïc Hoguin 9fed03a6d6
Add missing suites to non-CI parallel-ct 2024-09-30 12:37:24 +02:00
Loïc Hoguin a0ee6ddb69
Bazel fixes following renaming of test suites 2024-09-30 12:35:44 +02:00
Loïc Hoguin f54e307aee
CT: No longer wait 3 minutes for node start
Reverting back to the default 1 minute. The problem with
3 minutes is that this is exceedingly long and when there
are problems the test time increases exponentially.
2024-09-30 12:35:44 +02:00
Loïc Hoguin 027700eec2
Add missing test case to web_mqtt_shared_SUITE 2024-09-30 12:35:44 +02:00
Loïc Hoguin addb0607fd
Make rabbit_global_counters:overview/0 generally available
Previously it was only available when TEST=1 was set.
2024-09-30 12:35:44 +02:00
Loïc Hoguin 4530fb5d97
make: Add new CT suites and clarify check on CT_SUITES 2024-09-30 12:35:43 +02:00
Loïc Hoguin aee0cd0079
make & make CI: Small cleanups 2024-09-30 12:35:43 +02:00
Loïc Hoguin ae984cc364
make: Set CT_LOGS_DIR to top-level logs/ directory
All CT logs will now be under <toplevel>/logs. An improved
test workflow would be to always keep the logs/all_runs.html
page open in the browser and refresh it whenever tests are
run in any of the rabbit applications.
2024-09-30 12:35:43 +02:00
Loïc Hoguin 6b3b0e5c3f
CLI: Make a test more reliable 2024-09-30 12:35:43 +02:00
Loïc Hoguin 1c797387f7
cli: Add 4.1.0 to mock plugin's versions 2024-09-30 12:35:43 +02:00
Loïc Hoguin 71ec3396f6
cli: Start a background node to run the tests 2024-09-30 12:35:43 +02:00
Loïc Hoguin b8723d6cd2
Fix some OTP-27 Dialyzer errors in rabbitmq_peer_discovery_etcd
And disable those checks in CI for now. We are getting errors
because of the eetcd dependency and we can't upgrade at this
time (see comment in the commit).
2024-09-30 12:35:43 +02:00
Loïc Hoguin 67eee5602c
Fix OTP-27 Dialyzer errors in rabbitmq_ct_helpers 2024-09-30 12:35:43 +02:00
Loïc Hoguin 5222bea44e
ldap auth backend: Drop support for pre-OTP-25 search results
The search results record change was done in OTP-25, which is
no longer supported. So we can use the modern search results
record and drop the compatibility clauses.

For more context:

* 8d8847e069
* https://github.com/erlang/otp/pull/5538
2024-09-30 12:35:43 +02:00
Loïc Hoguin c0c2c2fbd9
Fix OTP-27 Dialyzer errors in rabbitmq_trust_store 2024-09-30 12:35:42 +02:00
Loïc Hoguin aa43139192
Fix OTP-27 Dialyzer errors in trust_store_http 2024-09-30 12:35:42 +02:00
Loïc Hoguin ec95c1a88d
rabbit_common: Remove 'cover' related code from 'rabbit_misc'
This is very old code that is likely no longer used. Removing
it helps avoid depending on cover.
2024-09-30 12:35:42 +02:00
Loïc Hoguin 861943835f
Fix OTP-27 Dialyzer errors in rabbit_common 2024-09-30 12:35:42 +02:00
Loïc Hoguin 85e358642b
Fix OTP-27 Dialyzer errors in rabbit 2024-09-30 12:35:42 +02:00
Loïc Hoguin 5086553bdd
make: Correct rabbitmq_prelaunch/rabbitmq_stream_common deps 2024-09-30 12:35:42 +02:00
Loïc Hoguin 5e3942478f
amqp10_common: Don't dialyze tests or from source by default 2024-09-30 12:35:42 +02:00
Loïc Hoguin 9f8c17f587
make: Fix build errors for apps that have rabbit in TEST_DEPS
We want them to install CLI scripts only for the test build,
otherwise Dialyzer or others will fail in a clean run.
2024-09-30 12:35:42 +02:00
Loïc Hoguin f95c87082a
make: Include rabbitmq_cli ebin in code path only if in deps 2024-09-30 12:35:42 +02:00
Loïc Hoguin f4a24c7f16
make: Run rabbitmq_mqtt tests via parallel-ct 2024-09-30 12:35:41 +02:00
David Ansari f002029ebd
Do not open WebMQTT connection in MQTT plugin 2024-09-30 12:35:41 +02:00
Loïc Hoguin ddab3d523f
mqtt tests: Move v5 web_mqtt tests out of rabbitmq_mqtt 2024-09-30 12:35:41 +02:00
Loïc Hoguin 690b830e43
mqtt tests: Move web_mqtt tests out of rabbitmq_mqtt
The shared test suite was renamed only for clarity, but the
Web-MQTT test suites were renamed out of necessity: since
we are now adding the MQTT test directory to the code path
we need test suites to have different names to avoid
conflicts. We can't (easily) addpath only for this test suite
either since CT hooks don't call functions in a predictable
enough manner; it would always be hacky.
2024-09-30 12:35:41 +02:00
Loïc Hoguin f4f375c6a9
Use Make in CI
This is a proof of concept that mostly works but is missing
some tests, such as rabbitmq_mqtt or rabbitmq_cli. It also
doesn't apply to mixed version testing yet.
2024-09-30 12:35:41 +02:00
Loïc Hoguin 645942cf95
make: Move dep_osiris in rabbitmq-components.mk
Otherwise some plugins can't build if we try to run tests
directly after checkout. This is because the plugins
depend on osiris as well as rabbit, but there is no
dep_osiris defined in the plugin itself.
2024-09-30 12:35:41 +02:00
Loïc Hoguin 30a8de3287
rabbit tests: Delete some temporary files to reduce log sizes 2024-09-30 12:35:41 +02:00
Loïc Hoguin 14fe08152f
Merge feature_flags_with_unpriveleged_user_SUITE back in ff_SUITE
On GH Actions we run as an unprivileged user by default.
2024-09-30 12:35:41 +02:00
David Ansari 36a84f4cde Fix function_clause
Fixes https://github.com/rabbitmq/rabbitmq-server/issues/12398

To repro this crash:
1. Start RabbitMQ v3.13.7 with feature flag message_containers disabled:
```
make run-broker TEST_TMPDIR="$HOME/scratch/rabbit/test" RABBITMQ_FEATURE_FLAGS=quorum_queue,implicit_default_bindings,virtual_host_metadata,maintenance_mode_status,user_limits,feature_flags_v2,stream_queue,classic_queue_type_delivery_support,classic_mirrored_queue_version,stream_single_active_consumer,direct_exchange_routing_v2,listener_records_in_ets,tracking_records_in_ets
```
In the Management UI
2. Create a quorum queue with x-delivery-limit=10
3. Publish a message to this queue.
4. Requeue this message two times.
5. ./sbin/rabbitmqctl enable_feature_flag all
6. Stop the node
7. git checkout v4.0.2
8. make run-broker TEST_TMPDIR="$HOME/scratch/rabbit/test"
9. Again in the Management UI, Get Message with Automatic Ack leads to above crash:

```
[error] <0.1185.0> ** Reason for termination ==
[error] <0.1185.0> ** {function_clause,
[error] <0.1185.0>        [{mc_compat,set_annotation,
[error] <0.1185.0>             [delivery_count,2,
[error] <0.1185.0>              {basic_message,
[error] <0.1185.0>                  {resource,<<"/">>,exchange,<<>>},
[error] <0.1185.0>                  [<<"qq1">>],
[error] <0.1185.0>                  {content,60,
[error] <0.1185.0>                      {'P_basic',undefined,undefined,
[error] <0.1185.0>                          [{<<"x-delivery-count">>,long,2}],
[error] <0.1185.0>                          2,undefined,undefined,undefined,undefined,undefined,
[error] <0.1185.0>                          undefined,undefined,undefined,undefined,undefined},
[error] <0.1185.0>                      none,none,
[error] <0.1185.0>                      [<<"m1">>]},
[error] <0.1185.0>                  <<230,146,94,58,177,125,64,163,30,18,177,132,53,207,69,103>>,
[error] <0.1185.0>                  true}],
[error] <0.1185.0>             [{file,"mc_compat.erl"},{line,61}]},
[error] <0.1185.0>         {rabbit_fifo_client,add_delivery_count_header,2,
[error] <0.1185.0>             [{file,"rabbit_fifo_client.erl"},{line,228}]},
[error] <0.1185.0>         {rabbit_fifo_client,dequeue,4,
[error] <0.1185.0>             [{file,"rabbit_fifo_client.erl"},{line,211}]},
[error] <0.1185.0>         {rabbit_queue_type,dequeue,5,
[error] <0.1185.0>             [{file,"rabbit_queue_type.erl"},{line,755}]},
[error] <0.1185.0>         {rabbit_misc,with_exit_handler,2,
[error] <0.1185.0>             [{file,"rabbit_misc.erl"},{line,526}]},
[error] <0.1185.0>         {rabbit_channel,handle_method,3,
[error] <0.1185.0>             [{file,"rabbit_channel.erl"},{line,1257}]},
[error] <0.1185.0>         {rabbit_channel,handle_cast,2,
[error] <0.1185.0>             [{file,"rabbit_channel.erl"},{line,629}]},
[error] <0.1185.0>         {gen_server2,handle_msg,2,[{file,"gen_server2.erl"},{line,1056}]}]}
```

The mc annotation `delivery_count` is a new mc annotation specifically
used in the header section of AMQP 1.0 messages:
https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-header

Hence, we can ignore this annotation for the old `#basic_message{}`.
2024-09-30 11:35:22 +02:00
Arnaud Cogoluègnes 788879969e
Merge pull request #12391 from rabbitmq/anon-term-errors
Comply with §2.2.2 of Anonymous Terminus extension
2024-09-27 09:24:47 +02:00
Michael Klishin cf0a4e8e11
Merge pull request #12390 from rabbitmq/issue-12374
Remove duplicate stats keys in quorum queues
2024-09-27 01:49:58 -04:00
Michael Klishin b815902585 Make it possible to override the license line in the startup banner
This is for Tanzu RabbitMQ, nothing changes for
the open source edition.
2024-09-26 23:45:17 -04:00
David Ansari 6863ae14dd Comply with §2.2.2 of Anonymous Terminus extension
Comply with section 2.2.2 Routing Errors:
https://docs.oasis-open.org/amqp/anonterm/v1.0/cs01/anonterm-v1.0-cs01.html#doc-routingerrors
2024-09-26 16:45:18 +02:00
Diana Parra Corbacho d860efaccc Remove duplicate stats keys in quorum queues
Messages, messages_ready and messages_unacknowledged are duplicated
during management stats collection, resulting in internal errors
when sorting queues in the management UI.
These should not be part of rabbit_core_metrics:queue_stats/2
2024-09-26 12:52:08 +02:00
Michael Klishin ea5673e4db
Merge pull request #12386 from stefanmoser/main
rabbitmqadmin v1: add default-queue-type to vhost declaration
2024-09-25 16:58:45 -04:00
Michael Klishin d31e930218
Merge pull request #12385 from rabbitmq/dependabot/maven/deps/rabbitmq_stream_management/test/http_SUITE_data/main/junit.jupiter.version-5.11.1
build(deps-dev): bump junit.jupiter.version from 5.11.0 to 5.11.1 in /deps/rabbitmq_stream_management/test/http_SUITE_data
2024-09-25 16:58:15 -04:00
Michael Klishin 855414d30c
Merge pull request #12384 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/junit.jupiter.version-5.11.1
build(deps-dev): bump junit.jupiter.version from 5.11.0 to 5.11.1 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2024-09-25 16:58:07 -04:00
Michael Klishin 9f444b6927
Merge pull request #12383 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.junit.jupiter-junit-jupiter-5.11.1
build(deps-dev): bump org.junit.jupiter:junit-jupiter from 5.11.0 to 5.11.1 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2024-09-25 16:58:00 -04:00
Stefan Moser c3f218d1b7 add default-queue-type to vhost declaration 2024-09-25 13:21:14 -07:00
dependabot[bot] 3d1bac4d1d
build(deps-dev): bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.0 to 5.11.1.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.0 to 5.11.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.0 to 5.11.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- 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>
2024-09-25 18:40:56 +00:00
dependabot[bot] 0ddb303d54
build(deps-dev): bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.0 to 5.11.1.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.0 to 5.11.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.0 to 5.11.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- 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>
2024-09-25 18:40:34 +00:00
dependabot[bot] 1db0d1f758
build(deps-dev): bump org.junit.jupiter:junit-jupiter
Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.11.0 to 5.11.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.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>
2024-09-25 18:34:34 +00:00
dependabot[bot] a25fcb46b2
build(deps-dev): bump org.junit.jupiter:junit-jupiter-params
Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.11.0 to 5.11.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.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>
2024-09-25 18:25:30 +00:00
David Ansari c0fbc1a805 Fix AMQP 1.0 shovel
The shovel violated the AMQP 1.0 spec by sending transfers with settled=true
under sender settle mode unsettled (in case of shovel ack-mode being
on-publish).
2024-09-25 18:06:22 +02:00
David Ansari 9d7ebf32a9 Enforce correct transfer settled flag
For messages published to RabbitMQ, RabbitMQ honors the transfer `settled`
field, no matter what value the sender settle mode was set to in the attach
frame.

Therefore, prior to this commit, a client could send a transfer with
`settled=true` even though sender settle mode was set to `unsettled` in the
attach frame.

This commit enforces that the publisher sets only transfer `settled` fields
that are valid with the spec.

If sender settle mode is:
* `unsettled`, the transfer `settled` flag must be `false`.
* `settled`, the transfer `settled` flag must be `true`.
* `mixed`, the transfer `settled` flag can be `true` or `false`.
2024-09-25 18:06:22 +02:00
David Ansari 1245119972 Delete unsupported setting
see https://github.com/rabbitmq/rabbitmq-server/pull/11999 for context
2024-09-25 17:53:35 +02:00
David Ansari 1e3f4e5db9 Emit histogram metric for received message sizes per protocol (#12342)
* Add global histogram metrics for received message sizes per-protocol

fixup: add new files to bazel

fixup: expose message_size_bytes as prometheus classic histogram type

`rabbit_msg_size_metrics` does not use `seshat` any more, but
`counters` directly.

fixup: add msg_size_metrics unit test

* Improve message size histogram

1.
Avoid unnecessary time series emitted for stream protocol
The stream protocol cannot observe message sizes.
This commit ensures that the following time series are omitted:
```
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="64"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="256"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="1024"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="4096"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="16384"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="65536"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="262144"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="1048576"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="4194304"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="16777216"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="67108864"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="268435456"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="+Inf"} 0
rabbitmq_global_message_size_bytes_count{protocol="stream"} 0
rabbitmq_global_message_size_bytes_sum{protocol="stream"} 0
```

This reduces the number of time series by 15.

2.
Further reduce the number of time series by reducing the number of
buckets. Instead of 13 bucktes, emit only 9 buckets. Buckets are not
free, each is an extra time series stored.

Prior to this commit:
```
curl -s -u guest:guest localhost:15692/metrics | ag message_size | wc -l
      92
```

After this commit:
```
curl -s -u guest:guest localhost:15692/metrics | ag message_size | wc -l
      57
```

3.
The emitted metric should be called
`rabbitmq_message_size_bytes_bucket` instead of `rabbitmq_global_message_size_bytes_bucket`.
The latter is poor naming. There is no need to use `global` in
the metric name given that this metric doesn't exist in the old flawed
aggregated metrics.

4.
This commit simplies module `rabbit_global_counters`.

5.
Avoid garbage collecting the 10-elements list of buckets per message
being received.

---------

Co-authored-by: Péter Gömöri <peter@84codes.com>
2024-09-25 09:00:44 -04:00
Lois Soto Lopez 8377eda336 Comment added label clause to clarify need for it 2024-09-25 11:04:25 +02:00
David Ansari 960808e6b2
Emit histogram metric for received message sizes per protocol (#12342)
* Add global histogram metrics for received message sizes per-protocol

fixup: add new files to bazel

fixup: expose message_size_bytes as prometheus classic histogram type

`rabbit_msg_size_metrics` does not use `seshat` any more, but
`counters` directly.

fixup: add msg_size_metrics unit test

* Improve message size histogram

1.
Avoid unnecessary time series emitted for stream protocol
The stream protocol cannot observe message sizes.
This commit ensures that the following time series are omitted:
```
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="64"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="256"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="1024"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="4096"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="16384"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="65536"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="262144"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="1048576"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="4194304"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="16777216"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="67108864"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="268435456"} 0
rabbitmq_global_message_size_bytes_bucket{protocol="stream",le="+Inf"} 0
rabbitmq_global_message_size_bytes_count{protocol="stream"} 0
rabbitmq_global_message_size_bytes_sum{protocol="stream"} 0
```

This reduces the number of time series by 15.

2.
Further reduce the number of time series by reducing the number of
buckets. Instead of 13 bucktes, emit only 9 buckets. Buckets are not
free, each is an extra time series stored.

Prior to this commit:
```
curl -s -u guest:guest localhost:15692/metrics | ag message_size | wc -l
      92
```

After this commit:
```
curl -s -u guest:guest localhost:15692/metrics | ag message_size | wc -l
      57
```

3.
The emitted metric should be called
`rabbitmq_message_size_bytes_bucket` instead of `rabbitmq_global_message_size_bytes_bucket`.
The latter is poor naming. There is no need to use `global` in
the metric name given that this metric doesn't exist in the old flawed
aggregated metrics.

4.
This commit simplies module `rabbit_global_counters`.

5.
Avoid garbage collecting the 10-elements list of buckets per message
being received.

---------

Co-authored-by: Péter Gömöri <peter@84codes.com>
2024-09-24 18:08:24 +02:00
Lois Soto Lopez 79f04c23f3 Avoid duplicate vhost label for prometh. queue-exchange metrics
Adds a specific clause on the
`prometheus_rabbitmq_core_metrics_collector:labels` function when the
associated metric item is a Queue + Exchange combo (`{Queue, Exchange}`)
2024-09-24 10:38:38 +02:00
Jean-Sébastien Pédron 8268a11eb2
Merge pull request #12357 from rabbitmq/fix-non-canonical-links
Fix non-canonical and broken links
2024-09-24 09:27:10 +02:00
Karl Nilsson 2ae4dbeb1a QQ: fix off-by-one bug in release cursor effects.
{release_cursor, Idx} effects promote checkpoints with an index
lower or _equal_ to the release cursor index. rabbit_fifo is emitting
the smallest active raft index instead which could cause the log to truncate
one index too many after a checkpoint promotion.
2024-09-23 17:20:17 +01:00
Jean-Sébastien Pédron 5158460cc6
rabbitmqctl.8: Point to 3.13.x mirroring guide
[Why]
Classic queue mirroring was removed from RabbitMQ 4.0.x.
2024-09-23 13:25:39 +02:00
Jean-Sébastien Pédron fe10cd88c3
rabbit/Makefile: Delete `.html` from local URL in manpages 2024-09-23 13:24:54 +02:00
Jean-Sébastien Pédron 89fc33a0f2
Use the new URLs of the `www.rabbitmq.com` website
They changed with the switch to Docusaurus. This avoids a redirect and
gives cleaner search results.
2024-09-23 11:34:54 +02:00
Jean-Sébastien Pédron e7784df169
Use the canonical `www.rabbitmq.com` domain
Using `rabbitmq.com` works and redirects to `www.rabbitmq.com`, but it
is preferable to use the canonical domain to have cleaner search
results.

This is important for manpages because we have an HTML copy in the
website.
2024-09-23 11:13:08 +02:00
Michael Klishin bf4d573110
Merge pull request #12348 from rabbitmq/cmq-silent-ff
Make rabbit_table:wait/2 silent when checking if cmq are used
2024-09-22 15:59:42 -04:00
David Ansari bddc54613f Decrease default MQTT Maximum Packet Size
Given that the default max_message_size got decreased from 128 MiB to 16
MiB in RabbitMQ 4.0 in https://github.com/rabbitmq/rabbitmq-server/pull/11455,
it makes sense to also decrease the default MQTT Maximum Packet Size from 256 MiB to 16 MiB.
Since this change was missed in RabbitMQ 4.0, it is scheduled for RabbitMQ 4.1.
2024-09-20 16:11:21 +02:00
Michael Klishin 2cc4b4381c
Merge pull request #12351 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot_kotlin/main/org.springframework.boot-spring-boot-starter-parent-3.3.4
build(deps): bump org.springframework.boot:spring-boot-starter-parent from 3.3.3 to 3.3.4 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot_kotlin
2024-09-19 17:08:47 -04:00
dependabot[bot] d6094b0f78
build(deps): bump org.springframework.boot:spring-boot-starter-parent
Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.3.3 to 3.3.4.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.3...v3.3.4)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-19 19:09:10 +00:00
dependabot[bot] ab34b17d98
build(deps): bump org.springframework.boot:spring-boot-starter-parent
Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.3.3 to 3.3.4.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.3...v3.3.4)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-19 19:00:40 +00:00
Diana Parra Corbacho 430a6b469b Make rabbit_table:wait/2 silent when checking if cmq are used 2024-09-19 17:23:28 +02:00
David Ansari b1eb354385 Strictly validate annotations 2024-09-18 12:42:27 +02:00
David Ansari cd600bef8b Fix modified annotations
```
<field name="message-annotations" type="fields"/>
```

Prior to this commit integration tests succeeded because both Erlang
client and RabbitMQ server contained a bug.

This bug was noticed by a Java client test suite.
2024-09-18 09:38:44 +02: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
Michael Klishin 27dac87a20
Khepri feature flag: add a documentation URL
That links to the vNext version of the site for
now. In 4.0.x, we can change it to the vCurrent
version.
2024-09-17 03:38:26 -04:00
Michael Klishin 4805e31e37
Merge pull request #12317 from rabbitmq/md/khepri/mqtt-fixes
Handle database timeouts in MQTT queue deletion
2024-09-16 19:00:09 -04:00
Michael Davis a65ceb6372
rabbit_amqqueue: Catch exits when reading classic Q `consumers/1`
`delegate:invoke/2` catches errors but not exits of the delegate
process. Another process might query for a classic queue's consumers
while the classic queue is being deleted or otherwise terminating and
that would result in an exit of the calling process previously.
2024-09-16 14:43:27 -04:00
Michael Davis a9c48ef951
rabbit_mqtt_processor: Handle failures to delete a queue 2024-09-16 14:43:27 -04:00
Michael Davis 9627903716
rabbit_queue_type: Add `{error,timeout}` to delete/4 callback spec
This return value was already possible since a classic queue will return
it during termination if `rabbit_amqqueue:internal_delete/2` fails with
that value.

`rabbit_amqqueue:delete/4` already handles this value and converts it
into a protocol error and channel exit. The other caller (MQTT
processor) will be updated in a child commit.

This commit also replaces eager conversions to protocol errors in
rabbit_classic_queue, rabbit_quorum_queue and rabbit_stream_coordinator:
we should return `{error, timeout}` consistently and not hide it in
protocol errors.
2024-09-16 14:43:24 -04:00
dependabot[bot] 0d6916e3c5
build(deps-dev): bump com.rabbitmq:amqp-client
Bumps [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) from 5.21.0 to 5.22.0.
- [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases)
- [Commits](https://github.com/rabbitmq/rabbitmq-java-client/compare/v5.21.0...v5.22.0)

---
updated-dependencies:
- dependency-name: com.rabbitmq:amqp-client
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 18:42:53 +00:00
Diana Parra Corbacho 05f0e03c38 Quorum queues: unblock publishers when clearing max-length policy 2024-09-16 12:19:01 +02:00
Michal Kuratczyk ea976e5b86 Failing test for max-length policy deletion
Clearing a max-length policy doesn't unblock existing
publishers. When a new publisher connects, it can publish
to the queue.
2024-09-16 12:19:01 +02:00
Michael Klishin 4ec0f5e300
Merge pull request #12303 from rabbitmq/issue-1049
forget_cluster_node: delete all local classic queues when using Khepri store
2024-09-13 15:39:36 -04:00
Michael Klishin 731fb2fd15 container-id help message wording #12302 2024-09-13 15:12:17 -04:00
Michal Kuratczyk b64ebf1a91
Fix formatter crash
Before:
```
FORMATTER CRASH: {"Waiting for ~ts queues and streams to have quorum+1 replicas online.You can list them with `rabbitmq-diagnostics check_if_node_is_quorum_critical`","\t"}
```
After:
```
Waiting for 9 queues and streams to have quorum+1 replicas online. You can list them with `rabbitmq-diagnostics check_if_node_is_quorum_critical`
```
2024-09-13 18:09:08 +02:00
Michal Kuratczyk f0f7500f6a
Revert "Log errors from `ranch:handshake`" (#12304)
This reverts commit 620fff22f1.

It intoduced a regression in another area - a TCP health check,
such as the default (with cluster-operator) readinessProbe,
on a TLS-enabled instance would log a `rabbit_reader` crash
every few seconds:
```
tls-server-0 rabbitmq 2024-09-13 09:03:13.010115+00:00 [error] <0.999.0>   crasher:
tls-server-0 rabbitmq 2024-09-13 09:03:13.010115+00:00 [error] <0.999.0>     initial call: rabbit_reader:init/3
tls-server-0 rabbitmq 2024-09-13 09:03:13.010115+00:00 [error] <0.999.0>     pid: <0.999.0>
tls-server-0 rabbitmq 2024-09-13 09:03:13.010115+00:00 [error] <0.999.0>     registered_name: []
tls-server-0 rabbitmq 2024-09-13 09:03:13.010115+00:00 [error] <0.999.0>     exception error: no match of right hand side value {error, handshake_failed}
tls-server-0 rabbitmq 2024-09-13 09:03:13.010115+00:00 [error] <0.999.0>       in function  rabbit_reader:init/3 (rabbit_reader.erl, line 171)
```
2024-09-13 17:07:57 +02:00
David Ansari f78f14ab1d Display container-id in the UI and CLI 2024-09-13 17:05:46 +02:00
Michael Klishin a1893fb28a
Tweak a log message when all classic queues on a node are being removed 2024-09-13 10:52:11 -04:00
Diana Parra Corbacho 29bfaa9ac7 Test remove classic queues when node is removed 2024-09-13 15:01:24 +02:00
Michal Kuratczyk 1db3fd391a
Log when deleting all queues on a forgotten node 2024-09-13 14:48:35 +02:00
Diana Parra Corbacho 990e6d2dc7 forget_cluster_node: delete all local classic queues when using Khepri store
When a cluster node is removed, all classic queues hosted on it should be
removed. This was done for Mnesia but not for the new Khepri metadata store
2024-09-13 13:46:53 +02:00
Michael Klishin bc8d3fdf19
More copywriting tweaks around the Khepri feature flag
Per discussion with most of the core team.
2024-09-12 11:00:34 -04:00
Michael Klishin ad7c58abf1
Merge pull request #12286 from rabbitmq/mk-4.0-khepri-ff-wording
Tweak wording around experimental feature flags (Khepri)
2024-09-12 09:09:34 -04:00
Michael Klishin caad8a51a7
Merge pull request #12276 from rabbitmq/slow-vhost-deletion-many-permissions
Increase the timeout when batch deleting permissions
2024-09-12 09:09:07 -04:00
Diana Parra Corbacho 2981782161 cluster_minority_SUITE: use a timeout for vhost deletion 2024-09-12 08:34:44 +02:00
Michael Klishin 29fcb33a6b Tweak wording around experimental feature flags (Khepri)
This updates Khepri FF description to be more correct
and to the point.

It also tweaks the management UI copywriting so
that it does not recommend against the use of
Khepri in production as it is much more mature
in 4.0.
2024-09-11 20:35:42 -04:00
Michael Klishin 4fbb2efcae
Merge pull request #12270 from rabbitmq/su_aws/dont_use_default_openssl_dir
Use openssl.cnf config when generating new CSR
2024-09-11 17:03:43 -04:00
Michael Davis 4eee769b54
Merge pull request #12280 from rabbitmq/md/khepri/fence-init-timeout 2024-09-11 14:16:34 -05:00
Michael Davis 3afb379f0e
rabbit_khepri: Retry fence in init/1 in cases of timeout 2024-09-11 13:26:36 -04:00
Michael Davis 4f0da67420
Handle Khepri timeouts when attempting to delete crashed classic Qs 2024-09-11 13:10:10 -04:00
Michael Davis c37b192beb
Handle Khepri timeouts when deleting MQTT QOS0 queues 2024-09-11 12:18:13 -04:00
Michael Davis 09c8aacb55
minor: Delete duplicate "queue" in QQ deletion error message
`rabbit_misc:rs/1` formats as "queue '<name>' in vhost '<vhost>'" so the
extra "queue" can be removed.
2024-09-11 12:17:24 -04:00
Diana Parra Corbacho f849a605ee Increase the timeout when batch deleting permissions 2024-09-11 09:07:32 +02:00
Michael Klishin e48079381e amqp_client_SUITE: drop a non-essential flakey test
interference from other tests sometimes makes
it fail because there is more than one connection.

Compared to most other AMQP 1.0 tests, this one can be
dropped.
2024-09-10 14:01:33 -04:00
Simon Unge b2904404da Use openssl.cnf config when generating new CSR 2024-09-10 17:20:41 +00:00
Michael Davis fcb90e4016
rabbit_khepri: Add debug logs in khepri_db enable callback
Without these there is no indication of unregistering and registering
projections.
2024-09-10 13:06:38 -04:00
Michael Davis ac1696bb16
Merge pull request #12266 from rabbitmq/md/khepri/singular-projection-names 2024-09-10 11:30:46 -05:00
Michael Klishin 192426dc68
Merge pull request #12267 from rabbitmq/mgmt-remove-disk-io
Management UI: remove disk read and write metrics from overview page.
2024-09-10 11:43:55 -04:00
Loïc Hoguin aa56e1097f
Merge pull request #12264 from rabbitmq/loic-small-make-fixes
make: Fix regressions following make plugins cleanup
2024-09-10 17:06:43 +02:00
Karl Nilsson f37b9f3f20 MGMT: remove disk read and write metrics from overview page.
These metrics do not include most of the disk io that RabbitMQ does
so are effectively useless.
2024-09-10 15:52:25 +01:00
Michael Davis c363ae0add
Consistently use singular names for Khepri projections
Previously about half of the Khepri projection names were pluralized.
2024-09-10 10:37:36 -04:00
Michael Davis 43b7fc1e53
rabbit_khepri: Rename legacy projection unregistration function, add docs
This function is meant to remove any projections which were mistakenly
registered in 3.13.x rather than all existing projections.
2024-09-10 10:34:55 -04:00
Michael Klishin 0c2e589ce9
Merge pull request #12250 from rabbitmq/delivery-limit-disable
QQ: a delivery-limit of -1 disables the delivery limit.
2024-09-10 10:01:05 -04:00
Loïc Hoguin 4a118c25f9
make: Fix regressions following make plugins cleanup 2024-09-10 15:42:28 +02:00
Karl Nilsson 67304ab910 Update description of delivery limit in management UI.
To mention that the default can be set to unlimited if the delivery-limit
is set to -1.
2024-09-10 13:56:15 +01:00
Karl Nilsson e81feb556f QQ: a delivery-limit of -1 disables the delivery limit.
For cases where users want to live a bit more dangerously this commit
maps a delivery limit of -1 (or any negative value) such that it
disables the delivery limit and restores the 3.13.x behaviour.
2024-09-10 10:48:03 +01:00
Michael Davis ce729038d6
rabbit_khepri: "fence" during `init/1`
`khepri:fence/0,1,2` queries the leader's Raft index and blocks the
caller for the given (or default) timeout until the local member has
caught up in log replication to that index. We want to do this during
Khepri init to ensure that the local Khepri store is reasonably up to
date before continuing in the boot process and starting listeners.

This is conceptually similar to the call to `mnesia:wait_for_tables/2`
during `rabbit_mnesia:init/0` and should have the same effect.
2024-09-09 09:06:39 -04:00
Michael Davis e8d267591d
rabbit_khepri: Register projections during virgin `init/1`
This covers a specific case where we need to register projections not
covered by the enable callback of the `khepri_db` feature flag. The
feature flag may be enabled if a node has been part of a cluster which
enabled the flag, but the metadata store might be reset. Upon init the
feature flag will be enabled but the store will be empty and the
projections will not exist, so operations like inserting default data
will fail when asserting that a vhost exists for example.

This fixes the `cluster_management_SUITE:forget_cluster_node_in_khepri/1`
case when running the suite with `RABBITMQ_METADATA_STORE=khepri`, which
fails as mentioned above.

We could run projection registration always when using Khepri but once
projections are registered the command is idempotent so there's no need
to, and the commands are somewhat large.
2024-09-09 09:06:39 -04:00
Michael Davis 67031e3c3d
Ensure projections are registered in metadata_store_phase1_SUITE 2024-09-09 09:06:39 -04:00
Michael Davis a3ca1bba6c
Explicitly match skips when setting metadata store in CT
This causes a clearer error when the `enable_feature_flags/2` function
returns something not in the shape `ok | {skip, any()}`.
2024-09-09 09:06:39 -04:00
Michael Davis 72fab069f5
rabbit_khepri: Use `?STORE_ID` for projection registration functions
This is a cosmetic change. `?RA_CLUSTER_NAME` is equivalent but is used
for clustering commands. Commands sent via the `khepri`/`khepri_adv`
APIs consistently use the `?STORE_ID` macro instead.
2024-09-09 09:06:39 -04:00
Michael Davis 3353242693
rabbit_khepri: Remove projection registration from setup/0 2024-09-09 09:06:38 -04:00
Michael Davis 9741af4672
rabbit_khepri: Unregister all projections when enabling khepri_db ff 2024-09-09 09:06:38 -04:00
Michael Davis 89971d5698
rabbit_khepri: Add projection registration to khepri_db ff enable fun 2024-09-09 09:06:38 -04:00
Michael Davis 0e4e12da2e
rabbit_khepri: Avoid throws in `register_projection/0`
Previously this function threw errors. With this minor refactor we
return them instead so that `register_projection/0` is easier for
callers to work with. (In the child commit we will add another caller.)
2024-09-09 09:06:38 -04:00
David Ansari 7baff37f65 Simplify session reply frames
This commit is only refactoring.

To avoid confusion with reply and noreply gen_server return values, this
commit uses different return values for handle_frame/2.
2024-09-09 12:40:24 +02:00
David Ansari b2db6355bc Support handle-max
## What?
1. Support `handle-max` field in the AMQP 1.0 `begin` frame
2. Add a new setting `link_max_per_session` which defaults to 256.
3. Rename `session_max` to `session_max_per_connection`

 ## Why?
1. Operators might want to limit the number of links per session. A
   similar setting `consumer_max_per_channel` exists for AMQP 0.9.1.
2. We should use RabbitMQ 4.0 as an opportunity to set a sensible
   default as to how many links can be active on a given session simultaneously.
   The session code does iterate over every link in some scenarios (e.g.
   queue was deleted). At some point, it's better to just open 2nd
   session instead of attaching hundreds or thousands of links to a single session.
   A default `link_max_per_session` of 256 should be more than enough given
   that `session_max_per_connection` is 64. So, the defaults allow
   `256 * 64 = 16,384` links to be active on an AMQP 1.0 connection.
   (Operators might want to lower both defaults.)
3. The name is clearer given that we might introduce
   `session_max_per_node` in the future since
   `channel_max_per_node` exists for AMQP 0.9.1.

 ### Additional Context
> Link handles MAY be reused once a link is closed for both send and receive.

> To make it easier to monitor AMQP link attach frames, it is RECOMMENDED that
> implementations always assign the lowest available handle to this field.
2024-09-06 17:18:08 +02:00
David Ansari 4fe7adc39a Add test 2024-09-06 13:48:48 +00:00
Karl Nilsson c68c9a48c3 Fix message resend bug in rabbit_stream_queue 2024-09-06 14:34:37 +01:00
Michael Davis 2f6a0ced9b
Merge pull request #12214 from rabbitmq/md/simplify-vhost-exchange-deletion 2024-09-05 14:45:37 -05:00
David Ansari c2ce905797
Enforce AMQP 1.0 channel-max (#12221)
* Enforce AMQP 1.0 channel-max

Enforce AMQP 1.0 field `channel-max` in the `open` frame by introducing
a new more user friendly setting called `session_max`:
> The channel-max value is the highest channel number that can be used on the connection.
> This value plus one is the maximum number of sessions that can be simultaneously active on the connection.

We set the default value of `session_max` to 64 such that, by
default, RabbitMQ 4.0 allows maximum 64 AMQP 1.0 sessions per AMQP 1.0 connection.

More than 64 AMQP 1.0 sessions per connection make little sense.
See also https://www.rabbitmq.com/blog/2024/09/02/amqp-flow-control#session

Limiting the maximum number of sessions per connection can be useful to
protect against
* applications that accidentally open new sessions without ending old sessions
  (session leaks)
* too many metrics being exposed, for example in the future via the
  "/metrics/per-object" Prometheus endpoint with timeseries per session
  being emitted.

This commit does not make use of the existing `channel_max` setting
because:
1. Given that `channel_max = 0` means "no limit", there is no way for an
   operator to limit the number of sessions per connections to 1.
2. Operators might want to set different limits for maximum number of
   AMQP 0.9.1 channels and maximum number of AMQP 1.0 sessions.
3. The default of `channel_max` is very high: It allows using more than
   2,000 AMQP 0.9.1 channels per connection. Lowering this default might
   break existing AMQP 0.9.1 applications.

This commit also fixes a bug in the AMQP 1.0 Erlang client which, prior
to this commit used channel number 1 for the first session. That's wrong
if a broker allows maximum 1 session by replying with `channel-max = 0`
in the `open` frame. Additionally, the spec recommends:
> To make it easier to monitor AMQP sessions, it is RECOMMENDED that implementations always assign the lowest available unused channel number.

Note that in AMQP 0.9.1, channel number 0 has a special meaning:
> The channel number is 0 for all frames which are global to the connection and 1-65535 for frames that
refer to specific channels.

* Apply PR feedback
2024-09-05 17:45:27 +02:00
Michael Davis d98e0f2dd2
rabbitmq_event_exchange: Test for parameters in exchange deletion
With the change in the parent commit we no longer set and clear a
runtime parameter when deleting an exchange as part of vhost deletion.
We need to adapt the `audit_vhost_internal_parameter` test case to test
that the parameter is set and cleared when the exchange is deleted
instead.
2024-09-05 11:42:13 -04:00
Michael Davis 17f6a2aaf6
Transactionally delete all exchanges during vhost deletion
Currently we delete each exchange one-by-one which requires three
commands: the delete itself plus a put and delete for a runtime
parameter that acts as a lock to prevent a client from declaring an
exchange while it's being deleted. The lock is unnecessary during vhost
deletion because permissions are cleared for the vhost before any
resources are deleted.

We can use a transaction to delete all exchanges and bindings for a
vhost in a single command against the Khepri store. This minimizes the
number of commands we need to send against the store and therefore the
latency of the deletion.

In a quick test with a vhost containing only 10,000 exchanges (no
bindings, queues, users, etc.), this is an order of magnitude speedup:
the prior commit takes 22s to delete the vhost while with this commit
the vhost is deleted in 2s.
2024-09-05 11:42:13 -04:00
Michael Davis e02f232dff
rabbit_db_binding: Prefer khepri_tx_adv:delete_many/1 to delete bindings
Currently we use a combination of `khepri_tx:get_many/1` and then either
`khepri_tx:delete/1` or `khepri_tx:delete_many/1`. This isn't a
functional change: switching to `khepri_tx_adv:delete_many/1` is
essentially equivalent but performs the deletion and lookup all in one
command and one traversal of the tree. This should improve performance
when deleting many bindings in an exchange.
2024-09-05 11:42:13 -04:00
Jean-Sébastien Pédron 6af9625e63
rabbitmq_recent_history_exchange: Respect RABBITMQ_METADATA_STORE in system_SUITE 2024-09-05 15:31:35 +02:00
Jean-Sébastien Pédron 94b8689284
Reorganize data in the Khepri store
[Why]

The previous layout followed the flat structure we have in Mnesia:
* In Mnesia, we have tables named after each purpose (exchanges, queues,
  runtime parameters and so on).
* In Khepri, we had about the same but the table names were replaced by
  a tree node in the tree. We ended up with one tree node per purpose
  at the root of the tree.

Khepri implements a tree. We could benefit from this and organize data
to reflect their relationship in RabbitMQ.

[How]

Here is the new hierarchy implemented by this commit:

    rabbitmq
    |-- users
    |   `-- $username
    |-- vhosts
    |   `-- $vhost
    |       |-- user_permissions
    |       |   `-- $username
    |       |-- exchanges
    |       |   `-- $exchange
    |       |       |-- bindings
    |       |       |   |-- queue
    |       |       |   |   `-- $queue
    |       |       |   `-- exchange
    |       |       |       `-- $exchange
    |       |       |-- consistent_hash_ring_state
    |       |       |-- jms_topic
    |       |       |-- recent_history
    |       |       |-- serial
    |       |       `-- user_permissions
    |       |           `-- $username
    |       |-- queues
    |       |   `-- $queue
    |       `-- runtime_params
    |           `-- $param_name
    |-- runtime_params
    |   `-- $param_name
    |-- mirrored_supervisors
    |   `-- $group
    |       `-- $id
    `-- node_maintenance
        `-- $node

We first define a root path in `rabbit/include/khepri.hrl` as
`[rabbitmq]`. This could be anything, including an empty path.

All paths are constructed either from this root path definition (users
and vhosts paths do that), or from a parent resource's path (exchanges
and queues paths are based on a vhost path).
2024-09-05 15:31:29 +02:00
Jean-Sébastien Pédron 98c2cd03da
Merge pull request #11795 from rabbitmq/unify-khepri-paths-api
Unify Khepri paths API
2024-09-05 15:29:30 +02:00
David Ansari 21b9515c3b Use snake case instead of camel case 2024-09-05 15:13:27 +02:00
Jean-Sébastien Pédron 1383c0c415
rabbt_db: Unify Khepri paths API
[Why]

Currently, `rabbit_db_*` modules use and export the following kind of
functions to return the path to the resources they manage:

    khepri_db_thing:khepri_things_path(),
    khepri_db_thing:khepri_thing_path(Identifier).

Internally, `khepri_db_thing:khepri_thing_path(Identifier)` appends
`Identifier` to the list returned by
`khepri_db_thing:khepri_things_path()`. This works for the organization
of the records we have today in Khepri:

    |-- thing
    |   |-- <<"identifier1">>
    |   |   <<"identifier2">>
    `-- other_thing
	`-- <<"other_identifier1">>

However, with the upcoming organization that leverages the tree in
Khepri, identifiers may be in the middle of the path instead of a leaf
component. We may also put `other_thing` under `thing` in the tree.

That's why, we can't really expose a parent directory for `thing` and
`other_thing`. Therefore, `khepri_db_thing:khepri_things_path/0` needs
to go away. Only `khepri_db_thing:khepri_thing_path/1` should be
exported and used.

In addition to that, there are several places where paths are hard-coded
(i.e. their definition is duplicated).

[How]

The patch does exactly that. Uses of
`khepri_db_thing:khepri_things_path()` are generally replaced by
`rabbit_db_thing:khepri_thing_path(?KHEPRI_WILDCARD_STAR)`.

Places where the path definitions were duplicated are fixed too by
calling the path building functions.

In the future, for a resource that depends on another one, the
corresponding module will call the `rabbit_db_thing:khepri_thing_path/1`
for that other resource and build its path on top of that.
2024-09-05 13:58:04 +02:00
Jean-Sébastien Pédron bc416757e8
Bump Khepri from 0.14.0 to 0.15.0
Release notes:
https://github.com/rabbitmq/khepri/releases/tag/v0.15.0
2024-09-05 11:36:45 +02:00
Michael Klishin b9eebc4487
Merge pull request #12215 from rabbitmq/add-connection-duration-to-closing-message
Add connection duration to "closing AMQP connection..." msgs
2024-09-04 22:50:32 -04:00
Michael Klishin a866ad3fd5 Revert "Do not quote connection duration"
This reverts commit 4299e1ddc3.

It can contain spaces as it is formatted to human-readable
values such as '4m, 36s'
2024-09-04 22:02:49 -04:00
Michael Klishin 4299e1ddc3 Do not quote connection duration
It cannot contain spaces like username,
virtual host and user-provided connection
name can.
2024-09-04 21:33:38 -04:00
Michael Davis c0a1c0cded
Merge pull request #12148 from rabbitmq/md/raft-cluster-prometheus-tag 2024-09-04 15:38:22 -05:00
Luke Bakken 3440e374d0
Add connection duration to "closing AMQP connection..." msgs
A while back, @mkuratczyk noted that we keep the timestamp of when a
connection is established in the connection state and related ETS table.

This PR uses the `connected_at` timestamp to calculate the duration of
the connection, to make it easier to identify short-running connections
via the log files.
2024-09-04 11:54:55 -07:00
Marcial Rosales a1206dc801 Move selenium to the root of the repo 2024-09-04 14:59:58 +01:00
Marcial Rosales 77b63d6799 Run selenium test suite against 3-node cluster 2024-09-04 10:06:54 +01:00
Michael Klishin 94baa7cfd4
Merge pull request #11702 from rabbitmq/mqtt-extract-client-id-from-cert
Extract MQTT client_id from client certificate and propagate to authnz backends
2024-09-03 10:53:19 -04:00
Michael Klishin 606a65169f Style, wording 2024-09-03 01:31:44 -04:00
GitHub f95527d6b5 bazel run gazelle 2024-09-03 04:02:30 +00:00
Arnaud Cogoluègnes 56964a8f28
Merge pull request #12074 from rabbitmq/issue-11915
Cancel AMQP stream consumer when local stream member is deleted
2024-09-02 16:07:58 +02:00
Loïc Hoguin f0932e3d42
Merge pull request #11778 from rabbitmq/loic-make-it-big
Make cleanups and ct-master introduction
2024-09-02 13:54:39 +02:00
Loïc Hoguin 05b701b3f4
rabbit tests: Don't fail if rabbit already loaded
Seems that this can happen if multiple test suites are running
one after the other and a previous test suite did not clean up
perfectly.
2024-09-02 11:44:16 +02:00
Michael Klishin c831ae46d1
Fix a typo in rabbit_oauth2_config_SUITE, references #11965 2024-09-01 04:50:56 -04:00
Jean-Sébastien Pédron fa6d89212a
Merge pull request #12163 from rabbitmq/fix-node-state-after-failure-to-join-cluster
rabbit_db_cluster: Reset feature flags immediately after a failure to join
2024-08-31 13:38:46 +02:00
Michael Davis 512f8838fd
Add prometheus tags for raft_cluster to non-QQ raft metrics
By default Ra will use the cluster name as the metrics key. Currently
atom values are ignored by the prometheus plugin's tag rendering
functions, so if you have a QQ and Khepri running and request the
`/metrics/per-object` or `/metrics/detailed` endpoints you'll see values
that don't have labels set for the `ra_metrics` metrics:

    # TYPE rabbitmq_raft_term_total counter
    # HELP rabbitmq_raft_term_total Current Raft term number
    rabbitmq_raft_term_total{vhost="/",queue="qq"} 9
    rabbitmq_raft_term_total 10

With this change we map the name of the Ra cluster to a "raft_cluster"
tag, so instead an example metric might be:

    # TYPE rabbitmq_raft_term_total counter
    # HELP rabbitmq_raft_term_total Current Raft term number
    rabbitmq_raft_term_total{vhost="/",queue="qq"} 9
    rabbitmq_raft_term_total{raft_cluster="rabbitmq_metadata"} 10

This affects metrics for Khepri and the stream coordinator.
2024-08-30 12:41:37 -04:00
Jean-Sébastien Pédron bfc6f83306
rabbit_db_cluster: Reset feature flags immediately after a failure to join
[Why]
If a node failed to join a cluster, `rabbit` was restarted then the
feature flags were reset and the error returned. I.e., the error
handling was in a single place at the end of the function.

We need to reset feature flags after a failure because the feature flags
states were copied from the remote node just before the join.

However, resetting them after restarting `rabbit` was incorrect because
feature flags were initialized in a way that didn't match the rest of
the state. This led to crashes during the start of `rabbit`.

[How]
The feature flags are now reset after the failure to join but before
starting `rabbit`.

A new testcase was added to test this scenario.
2024-08-30 17:41:25 +02:00
Péter Gömöri 29a5e7965c Document request and connection timeout configs of the http auth backend 2024-08-30 17:13:04 +02:00
Michael Klishin ec0d24b706
Merge pull request #12182 from rabbitmq/use-dotnet-8.0
Update .NET to 8.0
2024-08-30 10:23:06 -04:00
Michal Kuratczyk 0885ba757a
Remove queue-version CQ argument
It is no longer possible to set the version
when declaring a queue/policy, since only v2 is supported.
2024-08-30 14:02:02 +02:00
Marcial Rosales 1abc4ed02f Extract client_id from client cert 2024-08-30 11:39:48 +01:00
Michal Kuratczyk 301424235c
Update .NET to 8.0 2024-08-30 08:42:53 +02:00
GitHub ef1ca774ff bazel run gazelle 2024-08-30 04:02:30 +00:00
Michael Klishin e03664def9
Merge pull request #12172 from rabbitmq/SimonUnge-fix_shovel_get
Minor fix: GET/HEAD method on non existing shovel crash
2024-08-29 17:15:00 -04:00
Simon Unge 16463e72cc Minor fix: GET/HEAD method on non existing shovel crash 2024-08-29 20:05:47 +00:00
Marcial Rosales 17ca51dcc5 Test merge signing keys when using oauth_providers 2024-08-29 15:19:03 +01:00
Loïc Hoguin a17fb13a03
make: Initial work on using ct_master to run tests
Because `ct_master` is yet another Erlang node, and it is used
to run multiple CT nodes, meaning it is in a cluster of CT
nodes, the tests that change the net_ticktime could not
work properly anymore. This is because net_ticktime must
be the same value across the cluster.

The same value had to be set for all tests in order to solve
this. This is why it was changed to 5s across the board. The
lower net_ticktime was used in most places to speed up tests
that must deal with cluster failures, so that value is good
enough for these cases.

One test in amqp_client was using the net_ticktime to test
the behavior of the direct connection timeout with varying
net_ticktime configurations. The test now mocks the
`net_kernel:get_net_ticktime()` function to achieve the
same result.
2024-08-29 15:23:31 +02:00
Loïc Hoguin c66e8740e8
rabbit tests: Redirect logs to ct always
Doing it on a per test suite basis leads to issues if multiple
suites try to configure it, and there's no cleanup performed
anyway.
2024-08-29 15:22:40 +02:00
Loïc Hoguin 7ad8e2856b
make: Restrict Erlang.mk plugin inclusion
This has no real impact on performance[1] but should
make it clear which application can run the broker
and/or publish to Hex.pm. In particular, applications
that we can't run the broker from will now give up
early if we try to.

Note that while the broker can't normally run from the
amqp_client application's directory, it can run from
tests and some of the tests start the broker.

[1] on my machine
2024-08-29 15:19:50 +02:00
Loïc Hoguin 445f3c9270
make: Move rabbitmq-early-test.mk to rabbitmq-early-plugin.mk
No real need to have two files, especially since it contains
only a few variable definitions. Plan is to only keep
separate files for larger features such as dist or run.
2024-08-29 15:19:50 +02:00