Commit Graph

4657 Commits

Author SHA1 Message Date
Marcial Rosales b4d3712df7
Fix gaxelle issues around oauth2 dependencies 2024-02-29 15:14:52 -05:00
Marcial Rosales f971524dc3
Fix test case 2024-02-29 15:14:49 -05:00
Marcial Rosales c9d7c2449f
Fix test when idp is down 2024-02-29 15:14:49 -05:00
Marcial Rosales 823d488ed3
Do not use tls with uaa
Because uaa is not exposing https
2024-02-29 15:14:49 -05:00
Marcial Rosales be5399b49c
Remove noisy log statement 2024-02-29 15:14:49 -05:00
Marcial Rosales 23a024f8c8
Fix issue looking up logout button 2024-02-29 15:14:49 -05:00
Marcial Rosales cfdaf18c18
Fix url of keycloak 2024-02-29 15:14:48 -05:00
Marcial Rosales a8ca7177ef
Fix issue waiting for oauth2 section 2024-02-29 15:14:48 -05:00
Marcial Rosales 66d90e3e9b
Fix issue retrieve WebElement Text 2024-02-29 15:14:47 -05:00
Marcial Rosales 1efa03b3f1
Fix url when using tls 2024-02-29 15:14:47 -05:00
Marcial Rosales aa8fb1abcf
Fix issue mounting certs and import folders
+
2024-02-29 15:14:47 -05:00
Marcial Rosales d1cb4aa9be
Add tests to verify negative case 2024-02-29 15:14:47 -05:00
Marcial Rosales e294c88b1c
Add missing suite 2024-02-29 15:14:47 -05:00
Marcial Rosales 5f23a5c458
Warn when some oauth resource is not available 2024-02-29 15:14:46 -05:00
Marcial Rosales 1d2a5e0f1b
Show warning messages and disable resources
which are not available
2024-02-29 15:14:46 -05:00
Marcial Rosales 5e401c4da8
Add ensure-others command
starts only those components which are
down rather than restarting them
2024-02-29 15:14:46 -05:00
Marcial Rosales 06788f39b3
Add additional scopes 2024-02-29 15:14:44 -05:00
Marcial Rosales 05dacfacc4
Use resource's id as label
when label is not configured
2024-02-29 15:14:44 -05:00
Marcial Rosales bbf30d5ab6
Fix test that verifies amqp10 with oauth2 2024-02-29 15:14:42 -05:00
Marcial Rosales 120d7ba94c
WIP Add selenium tests to
verify oauth with multi providers and resources
against various messaging protocol
2024-02-29 15:14:42 -05:00
Marcial Rosales b5189e4c3d
Fix issue initializing mock http server 2024-02-29 15:14:42 -05:00
Marcial Rosales 7e83ea4acf
Fix multi oauth test cases
And refactor function to
assert options
2024-02-29 15:14:42 -05:00
Marcial Rosales 0d046e58c0
Fix issue with multi-oauth
It turns out the rabbitmq url
configured in keycloak was not
rendered but fixed to localhost
2024-02-29 15:14:41 -05:00
Marcial Rosales bc49b31678
Apply part of fix from pr #10438
And update test case to ensure that
there are no warning popup shown
after the user logs in and/or visits
all the tabs
2024-02-29 15:14:41 -05:00
Marcial Rosales 1a9e189148
Fix typo 2024-02-29 15:14:41 -05:00
Marcial Rosales 136a8b474e
Test multi oauth without basic auth 2024-02-29 15:14:41 -05:00
Marcial Rosales be41e3d00f
Fix landing.js 2024-02-29 15:14:41 -05:00
Marcial Rosales c7b131e4b1
Fix unauthorized.js test 2024-02-29 15:14:41 -05:00
Marcial Rosales 331ecea690
Verify oauth resources are listed 2024-02-29 15:14:40 -05:00
Marcial Rosales c53483235d
Fix issue with test
it is not possible to simply check if an elemnet
exists, as it is not rendered right away hence
we have to wait for it
2024-02-29 15:14:40 -05:00
Marcial Rosales 6a8bc28d24
Fix bug checking if element was visible 2024-02-29 15:14:40 -05:00
Marcial Rosales b59b9d4bc4
Add multi-oauth suite 2024-02-29 15:14:40 -05:00
Marcial Rosales ef8085e11c
Fix issue loading user definitions
when running rabbitmq local
2024-02-29 15:14:40 -05:00
Marcial Rosales fec5b68725
Create dedicate multi-oauth setup 2024-02-29 15:14:39 -05:00
Marcial Rosales e53d50bbea
Fix name issue
It should be oauth_resource_servers
not resource_servers
2024-02-29 15:14:39 -05:00
Marcial Rosales 4d6c808844
Simplify auth_settings
just an array of oauth_resource_servers
regardless whether we have just resource_server_id
or many resource servers
2024-02-29 15:14:39 -05:00
Marcial Rosales 122d4bdaec
Fix issue initialzing logon_type 2024-02-29 15:14:39 -05:00
Marcial Rosales 194ce710c7
Fix dialyzer warning 2024-02-29 15:14:39 -05:00
Marcial Rosales 23557a7706
Configure uaa with Cors and
fix issue initializing client_secret
2024-02-29 15:14:39 -05:00
Marcial Rosales 7b4d663967
Fix schema issue 2024-02-29 15:14:38 -05:00
Marcial Rosales 081335e84c
Add prefix oauth to all resource server settings 2024-02-29 15:14:38 -05:00
Marcial Rosales 59709ecde8
Fix text case failures 2024-02-29 15:14:38 -05:00
Marcial Rosales c70c95fe6d
Refactor test case
Extract functions that validate setting
and configure resource server settings
2024-02-29 15:14:38 -05:00
Marcial Rosales 98ac1d39d0
Complete coverage of authSettings 2024-02-29 15:14:38 -05:00
Marcial Rosales 06f116e9c2
Add more cases 2024-02-29 15:14:38 -05:00
Marcial Rosales f79cf55b07
Fix remaining test cases 2024-02-29 15:14:37 -05:00
Marcial Rosales 49b0c87598
Fix more test cases 2024-02-29 15:14:37 -05:00
Marcial Rosales 26669c1d42
Reimplement how authSettings is calculated
WIP rename and simplify test cases
2024-02-29 15:14:37 -05:00
Marcial Rosales 0be5ac1c85
Add reproducer test 2024-02-29 15:14:37 -05:00
Marcial Rosales d8bc533f2f
Refactor tests 2024-02-29 15:14:37 -05:00
Marcial Rosales 7e5b19b0b3
Refactor more test cases and add new ones 2024-02-29 15:14:36 -05:00
Marcial Rosales c30f3b6989
Refactor unit tests of auth_settings() 2024-02-29 15:14:36 -05:00
Marcial Rosales 6d2292c0cb
Change strategy that checks if an element exists 2024-02-29 15:14:35 -05:00
Marcial Rosales 993720e1b8
Update bazel instructions 2024-02-29 15:14:34 -05:00
Marcial Rosales 34b3b1248e
Create Oauth2 client 2024-02-29 15:14:34 -05:00
Karl Nilsson 5b0faf5d8c
Streams: Soft remove policy configuration of max_segment_size_bytes
This configuration is not guaranteed to be safe to change after a stream has bee n
declared and thus we'll remove the ability to change it after the initial
declaration. Users should favour the x- queue arg for this config but it will still
be possible to configure it as a policy but it will only be evaluated at
declara tion time.

This means that if a policy is set for a stream that re-configures the
`stream-m ax-segment-size-bytes` key it will show in the UI as updated but
the pre-existing stream will not use the updated configuration.

The key has been removed from the UI but for backwards compatibility it is still
 settable.

NB: this PR adds a new command `update_config` to the stream coordinator state
machine. Strictly speaking this should require a new machine version but we're by
passing that by relying on the feature flag instead which avoids this command
being committed before all nodes have the new code version. A new machine version
can lower the availability properties during a rolling cluster upgrade so in
this case it is preferable to avoid that given the simplicity of the change.
2024-02-29 15:14:33 -05:00
Michael Klishin 44d4e584d5
More missed license header updates #9969 2024-02-29 15:14:30 -05:00
Michael Klishin f045662e60
More missed license header updates #9969 2024-02-29 15:14:30 -05:00
Michael Klishin a68eec6a29
Drive-by change: naming 2024-02-29 15:14:26 -05:00
Diana Parra Corbacho 226c45748a
Allow management users to query feature flags and deprecated features
The new banner to warn about not-enabled feature flags requires access
to this endpoint, and it must be visible for all users.
2024-02-29 15:14:25 -05:00
Michael Klishin 5d41ede8cd
An alternative to #10415, closes #10330
Per discussion in #10415, this introduces a new module,
rabbit_mgmt_nodes, which provides a couple of helpers
that can be used to implement Cowboy REST's
resource_exists/2 in the modules that return
information about cluster members.
2024-02-29 15:14:22 -05:00
Michael Klishin 438b5a0700
More missed (c) header updates 2024-02-29 15:14:19 -05:00
Loïc Hoguin b5b6cd7866
Update expected CQ version in tests 2024-02-29 15:14:08 -05:00
Diana Parra Corbacho e0a60c1d3c
Remove FF warning as soon as all features are enabled
The warning in the header needs a full refresh, just updating
the page content will not clear the warning.
2024-02-29 15:14:08 -05:00
Michael Klishin 1d62d8ba49
(c) year bumps 2024-02-29 15:14:01 -05:00
Ariel Otilibili 09640e5f4d
Defined "tags" as list
Typo spotted in #4050
2024-02-29 15:13:59 -05:00
Marcial Rosales 414ad58de5
Use correct user to authenticate
depending on the backend we want to
exercise
2024-02-29 15:13:58 -05:00
Michael Klishin 46b923cc3a
Selenium: update run-suites.sh argument to match #10200 2024-02-29 15:13:57 -05:00
Marcial Rosales 6776594328
Clean up 2024-02-29 15:13:56 -05:00
Marcial Rosales bb23719f74
Propagate all credentials to http backend 2024-02-29 15:13:56 -05:00
Michael Klishin adf59fd8b4
Add a test originally introduced in #10062 2024-02-29 15:13:56 -05:00
Ariel Otilibili f4b09f63e3
Replaced true | false by boolean() 2024-02-29 15:13:55 -05:00
Michael Klishin e6a9be75db
Revert "HTTP API: DELETE /api/queues/{vhost}/{name} use internal API call"
This reverts commit 78f901a224.
2024-02-29 15:13:51 -05:00
Péter Gömöri bbec2dfa02
Prevent formatter crash in mgmt_util
`rabbit_mgmt_util:direct_request/6` is always called with an
`ErrorMsg` which expects one format argument as a string. Convert the
arbitrary reason term into a string to avoid a crash like the below:

```
warning: FORMATTER CRASH: {"Delete exchange error: ~ts",[{'EXIT',{{badmatch,{error,...
```
2024-02-29 15:13:51 -05:00
Péter Gömöri 9480486852
Tolerate race condition when starting management db cache process
This prevents the below harmless crash when multiple parallel API
requests arrive soon after starting the node.

```
exception error: no match of right hand side value
                 {error,{already_started,<0.1593.0>}}
  in function  rabbit_mgmt_db_cache:fetch/4 (rabbit_mgmt_db_cache.erl, line 68)
  in call from rabbit_mgmt_db:submit_cached/4 (rabbit_mgmt_db.erl, line 756)
  in call from rabbit_mgmt_util:augment/2 (rabbit_mgmt_util.erl, line 412)
  in call from rabbit_mgmt_util:run_augmentation/2 (rabbit_mgmt_util.erl, line 389)
  in call from rabbit_mgmt_util:augment_resources0/6 (rabbit_mgmt_util.erl, line 378)
  in call from rabbit_mgmt_util:with_valid_pagination/3 (rabbit_mgmt_util.erl, line 302)
  in call from rabbit_mgmt_wm_queues:to_json/2 (rabbit_mgmt_wm_queues.erl, line 44)
  in call from cowboy_rest:call/3 (src/cowboy_rest.erl, line 1583)
```
2024-02-29 15:13:50 -05:00
David Ansari 3a906c407b
Fix crash when closing connection
Avoid the following crash
```
** Reason for termination ==
** {mqtt_unexpected_cast,{shutdown,"Closed via management plugin"}}

  crasher:
    initial call: rabbit_mqtt_reader:init/1
    pid: <0.1096.0>
    registered_name: []
    exception exit: {mqtt_unexpected_cast,
                        {shutdown,"Closed via management plugin"}}
      in function  gen_server:handle_common_reply/8 (gen_server.erl, line 1208)
```
when closing MQTT or Stream connections via HTTP API endpoint
```
/connections/username/:username
```
2024-02-29 15:13:46 -05:00
Diana Parra Corbacho 3583980643
Management: introduce deprecated features API endpoints, UI page and warnings 2024-02-29 15:13:45 -05:00
Diana Parra Corbacho c418a02591
Add experimental/disabled warning in State column 2024-02-29 15:13:44 -05:00
Diana Parra Corbacho a70a48df52
Add a warning banner if any stable feature flags is not enabled
Add an experimental tag on the description to experimental features
2024-02-29 15:13:44 -05:00
Michael Klishin 2adb2e0c5b
Definition import: more logging improvements 2024-02-29 15:13:40 -05:00
Michael Klishin 1849db00a9
Another take at #10068
Scan queues, exchanges and bindings before attempting
to import anything on boot. If they miss the virtual
host field, fail early and log a sensible message.
2024-02-29 15:13:39 -05:00
Johan Rhodin 67a0cb465f
Fix wrong link 2024-02-29 15:13:30 -05:00
Johan Rhodin dc5ce8a73a
fix info item, and behavior->behaviour 2024-02-29 15:13:07 -05:00
Michael Klishin 1f77610525
Fixes #9983 2024-02-29 15:04:02 -05:00
Michael Klishin fa7f402e26
Update (c) according to [1]
1. https://investors.broadcom.com/news-releases/news-release-details/broadcom-and-vmware-intend-close-transaction-november-22-2023
2024-02-29 15:04:00 -05:00
Michael Klishin d85eadcca0
Management UI: link to GitHub Discussions and not the Google group 2024-02-29 15:03:58 -05:00
Michael Klishin 813b2d2b2c
Merge pull request #10624 from rabbitmq/fixes-10612
Fix issue #10612
2024-02-28 22:37:15 -05:00
Johan Rhodin 331c736128 Fix operator policy separators 2024-02-28 16:01:16 -06:00
David Ansari 8cb313d5a1 Support AMQP 1.0 natively
## What

Similar to Native MQTT in #5895, this commits implements Native AMQP 1.0.
By "native", we mean do not proxy via AMQP 0.9.1 anymore.

  ## Why

Native AMQP 1.0 comes with the following major benefits:
1. Similar to Native MQTT, this commit provides better throughput, latency,
   scalability, and resource usage for AMQP 1.0.
   See https://blog.rabbitmq.com/posts/2023/03/native-mqtt for native MQTT improvements.
   See further below for some benchmarks.
2. Since AMQP 1.0 is not limited anymore by the AMQP 0.9.1 protocol,
   this commit allows implementing more AMQP 1.0 features in the future.
   Some features are already implemented in this commit (see next section).
3. Simpler, better understandable, and more maintainable code.

Native AMQP 1.0 as implemented in this commit has the
following major benefits compared to AMQP 0.9.1:
4. Memory and disk alarms will only stop accepting incoming TRANSFER frames.
   New connections can still be created to consume from RabbitMQ to empty queues.
5. Due to 4. no need anymore for separate connections for publishers and
   consumers as we currently recommended for AMQP 0.9.1. which potentially
   halves the number of physical TCP connections.
6. When a single connection sends to multiple target queues, a single
   slow target queue won't block the entire connection.
   Publisher can still send data quickly to all other target queues.
7. A publisher can request whether it wants publisher confirmation on a per-message basis.
   In AMQP 0.9.1 publisher confirms are configured per channel only.
8. Consumers can change their "prefetch count" dynamically which isn't
   possible in our AMQP 0.9.1 implementation. See #10174
9. AMQP 1.0 is an extensible protocol

This commit also fixes dozens of bugs present in the AMQP 1.0 plugin in
RabbitMQ 3.x - most of which cannot be backported due to the complexity
and limitations of the old 3.x implementation.

This commit contains breaking changes and is therefore targeted for RabbitMQ 4.0.

 ## Implementation details

1. Breaking change: With Native AMQP, the behaviour of
```
Convert AMQP 0.9.1 message headers to application properties for an AMQP 1.0 consumer
amqp1_0.convert_amqp091_headers_to_app_props = false | true (default false)
Convert AMQP 1.0 Application Properties to AMQP 0.9.1 headers
amqp1_0.convert_app_props_to_amqp091_headers = false | true (default false)
```
will break because we always convert according to the message container conversions.
For example, AMQP 0.9.1 x-headers will go into message-annotations instead of application properties.
Also, `false` won’t be respected since we always convert the headers with message containers.

2. Remove rabbit_queue_collector

rabbit_queue_collector is responsible for synchronously deleting
exclusive queues. Since the AMQP 1.0 plugin never creates exclusive
queues, rabbit_queue_collector doesn't need to be started in the first
place. This will save 1 Erlang process per AMQP 1.0 connection.

3. 7 processes per connection + 1 process per session in this commit instead of
   7 processes per connection + 15 processes per session in 3.x
Supervision hierarchy got re-designed.

4. Use 1 writer process per AMQP 1.0 connection
AMQP 0.9.1 uses a separate rabbit_writer Erlang process per AMQP 0.9.1 channel.
Prior to this commit, AMQP 1.0 used a separate rabbit_amqp1_0_writer process per AMQP 1.0 session.
Advantage of single writer proc per session (prior to this commit):
* High parallelism for serialising packets if multiple sessions within
  a connection write heavily at the same time.

This commit uses a single writer process per AMQP 1.0 connection that is
shared across all AMQP 1.0 sessions.
Advantages of single writer proc per connection (this commit):
* Lower memory usage with hundreds of thousands of AMQP 1.0 sessions
* Less TCP and IP header overhead given that the single writer process
  can accumulate across all sessions bytes before flushing the socket.

In other words, this commit decides that a reader / writer process pair
per AMQP 1.0 connection is good enough for bi-directional TRANSFER flows.
Having a writer per session is too heavy.
We still ensure high throughput by having separate reader, writer, and
session processes.

5. Transform rabbit_amqp1_0_writer into gen_server
Why:
Prior to this commit, when clicking on the AMQP 1.0 writer process in
observer, the process crashed.
Instead of handling all these debug messages of the sys module, it's better
to implement a gen_server.
There is no advantage of using a special OTP process over gen_server
for the AMQP 1.0 writer.
gen_server also provides cleaner format status output.

How:
Message callbacks return a timeout of 0.
After all messages in the inbox are processed, the timeout message is
handled by flushing any pending bytes.

6. Remove stats timer from writer
AMQP 1.0 connections haven't emitted any stats previously.

7. When there are contiguous queue confirmations in the session process
mailbox, batch them. When the confirmations are sent to the publisher, a
single DISPOSITION frame is sent for contiguously confirmed delivery
IDs.
This approach should be good enough. However it's sub optimal in
scenarios where contiguous delivery IDs that need confirmations are rare,
for example:
* There are multiple links in the session with different sender
  settlement modes and sender publishes across these links interleaved.
* sender settlement mode is mixed and sender publishes interleaved settled
  and unsettled TRANSFERs.

8. Introduce credit API v2
Why:
The AMQP 0.9.1 credit extension which is to be removed in 4.0 was poorly
designed since basic.credit is a synchronous call into the queue process
blocking the entire AMQP 1.0 session process.

How:
Change the interactions between queue clients and queue server
implementations:
* Clients only request a credit reply if the FLOW's `echo` field is set
* Include all link flow control state held by the queue process into a
  new credit_reply queue event:
  * `available` after the queue sends any deliveries
  * `link-credit` after the queue sends any deliveries
  * `drain` which allows us to combine the old queue events
    send_credit_reply and send_drained into a single new queue event
    credit_reply.
* Include the consumer tag into the credit_reply queue event such that
  the AMQP 1.0 session process can process any credit replies
  asynchronously.

Link flow control state `delivery-count` also moves to the queue processes.

The new interactions are hidden behind feature flag credit_api_v2 to
allow for rolling upgrades from 3.13 to 4.0.

9. Use serial number arithmetic in quorum queues and session process.

10. Completely bypass the rabbit_limiter module for AMQP 1.0
flow control. The goal is to eventually remove the rabbit_limiter module
in 4.0 since AMQP 0.9.1 global QoS will be unsupported in 4.0. This
commit lifts the AMQP 1.0 link flow control logic out of rabbit_limiter
into rabbit_queue_consumers.

11. Fix credit bug for streams:
AMQP 1.0 settlements shouldn't top up link credit,
only FLOW frames should top up link credit.

12. Allow sender settle mode unsettled for streams
since AMQP 1.0 acknowledgements to streams are no-ops (currently).

13. Fix AMQP 1.0 client bugs
Auto renewing credits should not be related to settling TRANSFERs.
Remove field link_credit_unsettled as it was wrong and confusing.
Prior to this commit auto renewal did not work when the sender uses
sender settlement mode settled.

14. Fix AMQP 1.0 client bugs
The wrong outdated Link was passed to function auto_flow/2

15. Use osiris chunk iterator
Only hold messages of uncompressed sub batches in memory if consumer
doesn't have sufficient credits.
Compressed sub batches are skipped for non Stream protocol consumers.

16. Fix incoming link flow control
Always use confirms between AMQP 1.0 queue clients and queue servers.
As already done internally by rabbit_fifo_client and
rabbit_stream_queue, use confirms for classic queues as well.

17. Include link handle into correlation when publishing messages to target queues
such that session process can correlate confirms from target queues to
incoming links.

18. Only grant more credits to publishers if publisher hasn't sufficient credits
anymore and there are not too many unconfirmed messages on the link.

19. Completely ignore `block` and `unblock` queue actions and RabbitMQ credit flow
between classic queue process and session process.

20. Link flow control is independent between links.
A client can refer to a queue or to an exchange with multiple
dynamically added target queues. Multiple incoming links can also fan
in to the same queue. However the link topology looks like, this
commit ensures that each link is only granted more credits if that link
isn't overloaded.

21. A connection or a session can send to many different queues.
In AMQP 0.9.1, a single slow queue will lead to the entire channel, and
then entire connection being blocked.
This commit makes sure that a single slow queue from one link won't slow
down sending on other links.
For example, having link A sending to a local classic queue and
link B sending to 5 replica quorum queue, link B will naturally
grant credits slower than link A. So, despite the quorum queue being
slower in confirming messages, the same AMQP 1.0 connection and session
can still pump data very fast into the classic queue.

22. If cluster wide memory or disk alarm occurs.
Each session sends a FLOW with incoming-window to 0 to sending client.
If sending clients don’t obey, force disconnect the client.

If cluster wide memory alarm clears:
Each session resumes with a FLOW defaulting to initial incoming-window.

23. All operations apart of publishing TRANSFERS to RabbitMQ can continue during cluster wide alarms,
specifically, attaching consumers and consuming, i.e. emptying queues.
There is no need for separate AMQP 1.0 connections for publishers and consumers as recommended in our AMQP 0.9.1 implementation.

24. Flow control summary:
* If queue becomes bottleneck, that’s solved by slowing down individual sending links (AMQP 1.0 link flow control).
* If session becomes bottleneck (more unlikely), that’s solved by AMQP 1.0 session flow control.
* If connection becomes bottleneck, it naturally won’t read fast enough from the socket causing TCP backpressure being applied.
Nowhere will RabbitMQ internal credit based flow control (i.e. module credit_flow) be used on the incoming AMQP 1.0 message path.

25. Register AMQP sessions
Prefer local-only pg over our custom pg_local implementation as
pg is a better process group implementation than pg_local.
pg_local was identified as bottleneck in tests where many MQTT clients were disconnected at once.

26. Start a local-only pg when Rabbit boots:
> A scope can be kept local-only by using a scope name that is unique cluster-wide, e.g. the node name:
> pg:start_link(node()).
Register AMQP 1.0 connections and sessions with pg.

In future we should remove pg_local and instead use the new local-only
pg for all registered processes such as AMQP 0.9.1 connections and channels.

27. Requeue messages if link detached
Although the spec allows to settle delivery IDs on detached links, RabbitMQ does not respect the 'closed'
field of the DETACH frame and therefore handles every DETACH frame as closed. Since the link is closed,
we expect every outstanding delivery to be requeued.
In addition to consumer cancellation, detaching a link therefore causes in flight deliveries to be requeued.
Note that this behaviour is different from merely consumer cancellation in AMQP 0.9.1:
"After a consumer is cancelled there will be no future deliveries dispatched to it. Note that there can
still be "in flight" deliveries dispatched previously. Cancelling a consumer will neither discard nor requeue them."
[https://www.rabbitmq.com/consumers.html#unsubscribing]
An AMQP receiver can first drain, and then detach to prevent "in flight" deliveries

28. Init AMQP session with BEGIN frame
Similar to how there can't be an MQTT processor without a CONNECT
frame, there can't be an AMQP session without a BEGIN frame.
This allows having strict dialyzer types for session flow control
fields (i.e. not allowing 'undefined').

29. Move serial_number to AMQP 1.0 common lib
such that it can be used by both AMQP 1.0 server and client

30. Fix AMQP client to do serial number arithmetic.

31. AMQP client: Differentiate between delivery-id and transfer-id for better
understandability.

32. Fix link flow control in classic queues
This commit fixes
```
java -jar target/perf-test.jar -ad false -f persistent -u cq -c 3000 -C 1000000 -y 0
```
followed by
```
./omq -x 0 amqp -T /queue/cq -D 1000000 --amqp-consumer-credits 2
```
Prior to this commit, (and on RabbitMQ 3.x) the consuming would halt after around
8 - 10,000 messages.

The bug was that in flight messages from classic queue process to
session process were not taken into account when topping up credit to
the classic queue process.
Fixes #2597

The solution to this bug (and a much cleaner design anyway independent of
this bug) is that queues should hold all link flow control state including
the delivery-count.

Hence, when credit API v2 is used the delivery-count will be held by the
classic queue process, quorum queue process, and stream queue client
instead of managing the delivery-count in the session.

33. The double level crediting between (a) session process and
rabbit_fifo_client, and (b) rabbit_fifo_client and rabbit_fifo was
removed. Therefore, instead of managing 3 separate delivery-counts (i. session,
ii. rabbit_fifo_client, iii. rabbit_fifo), only 1 delivery-count is used
in rabbit_fifo. This is a big simplification.

34. This commit fixes quorum queues without bumping the machine version
nor introducing new rabbit_fifo commands.

Whether credit API v2 is used is solely determined at link attachment time
depending on whether feature flag credit_api_v2 is enabled.

Even when that feature flag will be enabled later on, this link will
keep using credit API v1 until detached (or the node is shut down).

Eventually, after feature flag credit_api_v2 has been enabled and a
subsequent rolling upgrade, all links will use credit API v2.

This approach is safe and simple.

The 2 alternatives to move delivery-count from the session process to the
queue processes would have been:

i. Explicit feature flag credit_api_v2 migration function
* Can use a gen_server:call and only finish migration once all delivery-counts were migrated.
Cons:
* Extra new message format just for migration is required.
* Risky as migration will fail if a target queue doesn’t reply.

ii. Session always includes DeliveryCountSnd when crediting to the queue:
Cons:
* 2 delivery counts will be hold simultaneously in session proc and queue proc;
could be solved by deleting the session proc’s delivery-count for credit-reply
* What happens if the receiver doesn’t provide credit for a very long time? Is that a problem?

35. Support stream filtering in AMQP 1.0 (by @acogoluegnes)
Use the x-stream-filter-value message annotation
to carry the filter value in a published message.
Use the rabbitmq:stream-filter and rabbitmq:stream-match-unfiltered
filters when creating a receiver that wants to filter
out messages from a stream.

36. Remove credit extension from AMQP 0.9.1 client

37. Support maintenance mode closing AMQP 1.0 connections.

38. Remove AMQP 0.9.1 client dependency from AMQP 1.0 implementation.

39. Move AMQP 1.0 plugin to the core. AMQP 1.0 is enabled by default.
    The old rabbitmq_amqp1_0 plugin will be kept as a no-op plugin to prevent deployment
    tools from failing that execute:
```
rabbitmq-plugins enable rabbitmq_amqp1_0
rabbitmq-plugins disable rabbitmq_amqp1_0
```

40. Breaking change: Remove CLI command `rabbitmqctl list_amqp10_connections`.
Instead, list both AMQP 0.9.1 and AMQP 1.0 connections in `list_connections`:
```
rabbitmqctl list_connections protocol
Listing connections ...
protocol
{1, 0}
{0,9,1}
```

 ## Benchmarks

 ### Throughput & Latency

Setup:
* Single node Ubuntu 22.04
* Erlang 26.1.1

Start RabbitMQ:
```
make run-broker PLUGINS="rabbitmq_management rabbitmq_amqp1_0" FULL=1 RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="+S 3"
```

Predeclare durable classic queue cq1, durable quorum queue qq1, durable stream queue sq1.

Start client:
https://github.com/ssorj/quiver
https://hub.docker.com/r/ssorj/quiver/tags (digest 453a2aceda64)
```
docker run -it --rm --add-host host.docker.internal:host-gateway ssorj/quiver:latest
bash-5.1# quiver --version
quiver 0.4.0-SNAPSHOT
```

1. Classic queue
```
quiver //host.docker.internal//amq/queue/cq1 --durable --count 1m --duration 10m --body-size 12 --credit 1000
```

This commit:
```
Count ............................................. 1,000,000 messages
Duration ............................................... 73.8 seconds
Sender rate .......................................... 13,548 messages/s
Receiver rate ........................................ 13,547 messages/s
End-to-end rate ...................................... 13,547 messages/s

Latencies by percentile:

          0% ........ 0 ms       90.00% ........ 9 ms
         25% ........ 2 ms       99.00% ....... 14 ms
         50% ........ 4 ms       99.90% ....... 17 ms
        100% ....... 26 ms       99.99% ....... 24 ms
```

RabbitMQ 3.x (main branch as of 30 January 2024):
```
---------------------- Sender -----------------------  --------------------- Receiver ----------------------  --------
Time [s]      Count [m]  Rate [m/s]  CPU [%]  RSS [M]  Time [s]      Count [m]  Rate [m/s]  CPU [%]  RSS [M]  Lat [ms]
-----------------------------------------------------  -----------------------------------------------------  --------
     2.1        130,814      65,342        6     73.6       2.1          3,217       1,607        0      8.0       511
     4.1        163,580      16,367        2     74.1       4.1          3,217           0        0      8.0         0
     6.1        229,114      32,767        3     74.1       6.1          3,217           0        0      8.0         0
     8.1        261,880      16,367        2     74.1       8.1         67,874      32,296        8      8.2     7,662
    10.1        294,646      16,367        2     74.1      10.1         67,874           0        0      8.2         0
    12.1        360,180      32,734        3     74.1      12.1         67,874           0        0      8.2         0
    14.1        392,946      16,367        3     74.1      14.1         68,604         365        0      8.2    12,147
    16.1        458,480      32,734        3     74.1      16.1         68,604           0        0      8.2         0
    18.1        491,246      16,367        2     74.1      18.1         68,604           0        0      8.2         0
    20.1        556,780      32,767        4     74.1      20.1         68,604           0        0      8.2         0
    22.1        589,546      16,375        2     74.1      22.1         68,604           0        0      8.2         0
receiver timed out
    24.1        622,312      16,367        2     74.1      24.1         68,604           0        0      8.2         0
quiver:  error: PlanoProcessError: Command 'quiver-arrow receive //host.docker.internal//amq/queue/cq1 --impl qpid-proton-c --duration 10m --count 1m --rate 0 --body-size 12 --credit 1000 --transaction-size 0 --timeout 10 --durable --output /tmp/quiver-otujr23y' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/usr/local/lib/quiver/python/quiver/pair.py", line 144, in run
    _plano.wait(receiver, check=True)
  File "/usr/local/lib/quiver/python/plano/main.py", line 1243, in wait
    raise PlanoProcessError(proc)
plano.main.PlanoProcessError: Command 'quiver-arrow receive //host.docker.internal//amq/queue/cq1 --impl qpid-proton-c --duration 10m --count 1m --rate 0 --body-size 12 --credit 1000 --transaction-size 0 --timeout 10 --durable --output /tmp/quiver-otujr23y' returned non-zero exit status 1.
```

2. Quorum queue:
```
quiver //host.docker.internal//amq/queue/qq1 --durable --count 1m --duration 10m --body-size 12 --credit 1000
```
This commit:
```
Count ............................................. 1,000,000 messages
Duration .............................................. 101.4 seconds
Sender rate ........................................... 9,867 messages/s
Receiver rate ......................................... 9,868 messages/s
End-to-end rate ....................................... 9,865 messages/s

Latencies by percentile:

          0% ....... 11 ms       90.00% ....... 23 ms
         25% ....... 15 ms       99.00% ....... 28 ms
         50% ....... 18 ms       99.90% ....... 33 ms
        100% ....... 49 ms       99.99% ....... 47 ms
```

RabbitMQ 3.x:
```
---------------------- Sender -----------------------  --------------------- Receiver ----------------------  --------
Time [s]      Count [m]  Rate [m/s]  CPU [%]  RSS [M]  Time [s]      Count [m]  Rate [m/s]  CPU [%]  RSS [M]  Lat [ms]
-----------------------------------------------------  -----------------------------------------------------  --------
     2.1        130,814      65,342        9     69.9       2.1         18,430       9,206        5      7.6     1,221
     4.1        163,580      16,375        5     70.2       4.1         18,867         218        0      7.6     2,168
     6.1        229,114      32,767        6     70.2       6.1         18,867           0        0      7.6         0
     8.1        294,648      32,734        7     70.2       8.1         18,867           0        0      7.6         0
    10.1        360,182      32,734        6     70.2      10.1         18,867           0        0      7.6         0
    12.1        425,716      32,767        6     70.2      12.1         18,867           0        0      7.6         0
receiver timed out
    14.1        458,482      16,367        5     70.2      14.1         18,867           0        0      7.6         0
quiver:  error: PlanoProcessError: Command 'quiver-arrow receive //host.docker.internal//amq/queue/qq1 --impl qpid-proton-c --duration 10m --count 1m --rate 0 --body-size 12 --credit 1000 --transaction-size 0 --timeout 10 --durable --output /tmp/quiver-b1gcup43' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/usr/local/lib/quiver/python/quiver/pair.py", line 144, in run
    _plano.wait(receiver, check=True)
  File "/usr/local/lib/quiver/python/plano/main.py", line 1243, in wait
    raise PlanoProcessError(proc)
plano.main.PlanoProcessError: Command 'quiver-arrow receive //host.docker.internal//amq/queue/qq1 --impl qpid-proton-c --duration 10m --count 1m --rate 0 --body-size 12 --credit 1000 --transaction-size 0 --timeout 10 --durable --output /tmp/quiver-b1gcup43' returned non-zero exit status 1.
```

3. Stream:
```
quiver-arrow send //host.docker.internal//amq/queue/sq1 --durable --count 1m -d 10m --summary --verbose
```

This commit:
```
Count ............................................. 1,000,000 messages
Duration ................................................ 8.7 seconds
Message rate ........................................ 115,154 messages/s
```

RabbitMQ 3.x:
```
Count ............................................. 1,000,000 messages
Duration ............................................... 21.2 seconds
Message rate ......................................... 47,232 messages/s
```

 ### Memory usage

Start RabbitMQ:
```
ERL_MAX_PORTS=3000000 RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="+P 3000000 +S 6" make run-broker PLUGINS="rabbitmq_amqp1_0" FULL=1 RABBITMQ_CONFIG_FILE="rabbitmq.conf"
```

```
/bin/cat rabbitmq.conf

tcp_listen_options.sndbuf  = 2048
tcp_listen_options.recbuf  = 2048
vm_memory_high_watermark.relative = 0.95
vm_memory_high_watermark_paging_ratio = 0.95
loopback_users = none
```

Create 50k connections with 2 sessions per connection, i.e. 100k session in total:

```go
package main

import (
	"context"
	"log"
	"time"

	"github.com/Azure/go-amqp"
)

func main() {
	for i := 0; i < 50000; i++ {
		conn, err := amqp.Dial(context.TODO(), "amqp://nuc", &amqp.ConnOptions{SASLType: amqp.SASLTypeAnonymous()})
		if err != nil {
			log.Fatal("dialing AMQP server:", err)
		}
		_, err = conn.NewSession(context.TODO(), nil)
		if err != nil {
			log.Fatal("creating AMQP session:", err)
		}
		_, err = conn.NewSession(context.TODO(), nil)
		if err != nil {
			log.Fatal("creating AMQP session:", err)
		}
	}
	log.Println("opened all connections")
	time.Sleep(5 * time.Hour)
}
```

This commit:
```
erlang:memory().
[{total,4586376480},
 {processes,4025898504},
 {processes_used,4025871040},
 {system,560477976},
 {atom,1048841},
 {atom_used,1042841},
 {binary,233228608},
 {code,21449982},
 {ets,108560464}]

erlang:system_info(process_count).
450289
```
7 procs per connection + 1 proc per session.
(7 + 2*1) * 50,000 = 450,000 procs

RabbitMQ 3.x:
```
erlang:memory().
[{total,15168232704},
 {processes,14044779256},
 {processes_used,14044755120},
 {system,1123453448},
 {atom,1057033},
 {atom_used,1052587},
 {binary,236381264},
 {code,21790238},
 {ets,391423744}]

erlang:system_info(process_count).
1850309
```
7 procs per connection + 15 per session
(7 + 2*15) * 50,000 = 1,850,000 procs

50k connections + 100k session require
with this commit: 4.5 GB
in RabbitMQ 3.x: 15 GB

 ## Future work

1. More efficient parser and serializer
2. TODO in mc_amqp: Do not store the parsed message on disk.
3. Implement both AMQP HTTP extension and AMQP management extension to allow AMQP
clients to create RabbitMQ objects (queues, exchanges, ...).
2024-02-28 14:15:20 +01:00
Marcial Rosales 81fc7d14ef Add selenium test that verifies use of verify-none 2024-02-28 10:04:51 +01:00
Michal Kuratczyk 2c69380acb
Use default sorting when `?sort=` in MGMT API
crash repro:
curl -u guest:guest -v 'http://localhost:15672/api/nodes/?sort='
2024-02-26 15:14:09 +01:00
Marcial Rosales 41237fbb3b Fix gaxelle issues around oauth2 dependencies 2024-02-14 18:55:39 +01:00
Marcial Rosales 0d78f931d3 Fix test case 2024-02-12 08:55:48 +01:00
Marcial Rosales 31ac7922da Fix test when idp is down 2024-02-12 07:38:25 +01:00
Marcial Rosales 9d9b2f2134 Do not use tls with uaa
Because uaa is not exposing https
2024-02-10 21:24:45 +01:00
Marcial Rosales 447effd455 Remove noisy log statement 2024-02-10 21:17:57 +01:00
Marcial Rosales e4e0ece31d Fix issue looking up logout button 2024-02-10 20:54:17 +01:00
Marcial Rosales 57358acde6 Fix url of keycloak 2024-02-10 20:12:21 +01:00
Marcial Rosales 22aa5172b9 Fix issue waiting for oauth2 section 2024-02-10 20:12:20 +01:00
Marcial Rosales ad9fc504fb Fix issue retrieve WebElement Text 2024-02-10 20:12:19 +01:00
Marcial Rosales dfb41cb92e Fix url when using tls 2024-02-10 20:12:19 +01:00
Marcial Rosales 5aa59aa992 Fix issue mounting certs and import folders
+
2024-02-10 20:12:19 +01:00
Marcial Rosales 16dbb5d77c Add tests to verify negative case 2024-02-10 20:12:18 +01:00
Marcial Rosales 82d852927d Add missing suite 2024-02-10 20:12:18 +01:00
Marcial Rosales 91089feb7b Warn when some oauth resource is not available 2024-02-10 20:12:18 +01:00
Marcial Rosales ec18b170fc Show warning messages and disable resources
which are not available
2024-02-10 20:12:17 +01:00
Marcial Rosales 7998dbab1b Add ensure-others command
starts only those components which are
down rather than restarting them
2024-02-10 20:12:17 +01:00
Marcial Rosales a1ea410cd1 Add additional scopes 2024-02-10 20:12:14 +01:00
Marcial Rosales 06bef0af41 Use resource's id as label
when label is not configured
2024-02-10 20:12:14 +01:00
Marcial Rosales 868234de3a Fix test that verifies amqp10 with oauth2 2024-02-10 20:12:12 +01:00
Marcial Rosales ebcea3e055 WIP Add selenium tests to
verify oauth with multi providers and resources
against various messaging protocol
2024-02-10 20:12:12 +01:00
Marcial Rosales 9cf1c40d4a Fix issue initializing mock http server 2024-02-10 20:12:12 +01:00
Marcial Rosales fc2d1ae763 Fix multi oauth test cases
And refactor function to
assert options
2024-02-10 20:12:11 +01:00
Marcial Rosales 773b13eb36 Fix issue with multi-oauth
It turns out the rabbitmq url
configured in keycloak was not
rendered but fixed to localhost
2024-02-10 20:12:11 +01:00
Marcial Rosales 1bdfb1f8f9 Apply part of fix from pr #10438
And update test case to ensure that
there are no warning popup shown
after the user logs in and/or visits
all the tabs
2024-02-10 20:12:11 +01:00
Marcial Rosales 5c665141a3 Fix typo 2024-02-10 20:12:11 +01:00
Marcial Rosales def5b37b9c Test multi oauth without basic auth 2024-02-10 20:12:11 +01:00
Marcial Rosales 0e759efdf7 Fix landing.js 2024-02-10 20:12:10 +01:00
Marcial Rosales d69fc0e8b9 Fix unauthorized.js test 2024-02-10 20:12:10 +01:00
Marcial Rosales 16bdeff55a Verify oauth resources are listed 2024-02-10 20:12:10 +01:00
Marcial Rosales 27f3e0b5f2 Fix issue with test
it is not possible to simply check if an elemnet
exists, as it is not rendered right away hence
we have to wait for it
2024-02-10 20:12:10 +01:00
Marcial Rosales eaba7abb6d Fix bug checking if element was visible 2024-02-10 20:12:10 +01:00
Marcial Rosales e1d5fcaeb7 Add multi-oauth suite 2024-02-10 20:12:09 +01:00
Marcial Rosales 9e20ed835a Fix issue loading user definitions
when running rabbitmq local
2024-02-10 20:12:09 +01:00
Marcial Rosales 2a3c8ec1e9 Create dedicate multi-oauth setup 2024-02-10 20:12:09 +01:00
Marcial Rosales 982e8a237b Fix name issue
It should be oauth_resource_servers
not resource_servers
2024-02-10 20:12:09 +01:00
Marcial Rosales a253a8cc31 Simplify auth_settings
just an array of oauth_resource_servers
regardless whether we have just resource_server_id
or many resource servers
2024-02-10 20:12:09 +01:00
Marcial Rosales fa3653acb1 Fix issue initialzing logon_type 2024-02-10 20:12:08 +01:00
Marcial Rosales 87c309ad0b Fix dialyzer warning 2024-02-10 20:12:08 +01:00
Marcial Rosales aad98037bd Configure uaa with Cors and
fix issue initializing client_secret
2024-02-10 20:12:08 +01:00
Marcial Rosales 89c1bff84b Fix schema issue 2024-02-10 20:12:08 +01:00
Marcial Rosales b6ac76a6f3 Add prefix oauth to all resource server settings 2024-02-10 20:12:08 +01:00
Marcial Rosales 0f7d859cc3 Fix text case failures 2024-02-10 20:12:08 +01:00
Marcial Rosales 341529c57a Refactor test case
Extract functions that validate setting
and configure resource server settings
2024-02-10 20:12:07 +01:00
Marcial Rosales c07aa378a6 Complete coverage of authSettings 2024-02-10 20:12:07 +01:00
Marcial Rosales b0f124a5c6 Add more cases 2024-02-10 20:12:07 +01:00
Marcial Rosales 3925c4cbd0 Fix remaining test cases 2024-02-10 20:12:07 +01:00
Marcial Rosales 1a1147c471 Fix more test cases 2024-02-10 20:12:07 +01:00
Marcial Rosales c995fb8867 Reimplement how authSettings is calculated
WIP rename and simplify test cases
2024-02-10 20:12:07 +01:00
Marcial Rosales 8c84d123f6 Add reproducer test 2024-02-10 20:12:07 +01:00
Marcial Rosales 2f431a62a6 Refactor tests 2024-02-10 20:12:06 +01:00
Marcial Rosales ee7fb32e7e Refactor more test cases and add new ones 2024-02-10 20:12:06 +01:00
Marcial Rosales 1f11349060 Refactor unit tests of auth_settings() 2024-02-10 20:12:06 +01:00
Marcial Rosales 68a8de95ad Change strategy that checks if an element exists 2024-02-10 20:12:05 +01:00
Marcial Rosales cc1f9171e9 Update bazel instructions 2024-02-10 20:12:05 +01:00
Marcial Rosales d827b72ce1 Create Oauth2 client 2024-02-10 20:12:04 +01:00
Karl Nilsson 5317f958fb Streams: Soft remove policy configuration of max_segment_size_bytes
This configuration is not guaranteed to be safe to change after a stream has bee n
declared and thus we'll remove the ability to change it after the initial
declaration. Users should favour the x- queue arg for this config but it will still
be possible to configure it as a policy but it will only be evaluated at
declara tion time.

This means that if a policy is set for a stream that re-configures the
`stream-m ax-segment-size-bytes` key it will show in the UI as updated but
the pre-existing stream will not use the updated configuration.

The key has been removed from the UI but for backwards compatibility it is still
 settable.

NB: this PR adds a new command `update_config` to the stream coordinator state
machine. Strictly speaking this should require a new machine version but we're by
passing that by relying on the feature flag instead which avoids this command
being committed before all nodes have the new code version. A new machine version
can lower the availability properties during a rolling cluster upgrade so in
this case it is preferable to avoid that given the simplicity of the change.
2024-02-07 11:06:10 +00:00
Michael Klishin 9c79ad8d55 More missed license header updates #9969 2024-02-05 12:26:25 -05:00
Michael Klishin f414c2d512
More missed license header updates #9969 2024-02-05 11:53:50 -05:00
Michael Klishin f8401df53e
Drive-by change: naming 2024-01-29 12:21:45 -05:00
Diana Parra Corbacho dc3b6fb5bc Allow management users to query feature flags and deprecated features
The new banner to warn about not-enabled feature flags requires access
to this endpoint, and it must be visible for all users.
2024-01-29 15:51:21 +01:00
Michael Klishin 0c0e2ca932 An alternative to #10415, closes #10330
Per discussion in #10415, this introduces a new module,
rabbit_mgmt_nodes, which provides a couple of helpers
that can be used to implement Cowboy REST's
resource_exists/2 in the modules that return
information about cluster members.
2024-01-25 18:41:56 -05:00
Michael Klishin 7b151a7651 More missed (c) header updates 2024-01-22 23:44:47 -05:00
Michael Klishin 838cb93142
Merge pull request #10337 from rabbitmq/loic-revert-cqv2-default
Revert "Default to classic queues v2"
2024-01-15 08:03:05 -05:00
Loïc Hoguin a0c8dab057
Update expected CQ version in tests 2024-01-15 12:08:08 +01:00
Diana Parra Corbacho 5a3584beea Remove FF warning as soon as all features are enabled
The warning in the header needs a full refresh, just updating
the page content will not clear the warning.
2024-01-15 08:41:36 +01:00
Michael Klishin 01092ff31f
(c) year bumps 2024-01-01 22:02:20 -05:00
Ariel Otilibili 0b24d3c0bb Defined "tags" as list
Typo spotted in #4050
2023-12-27 22:47:52 +01:00
Marcial Rosales b9f3771f2d Use correct user to authenticate
depending on the backend we want to
exercise
2023-12-27 14:03:26 +00:00
Michael Klishin 5af5f0cf3d
Selenium: update run-suites.sh argument to match #10200 2023-12-23 20:33:21 -05:00
Michael Klishin a374f40303
Merge pull request #10200 from rabbitmq/propagate_credentials_to_http_backend
Propagate all credentials to http backend
2023-12-23 19:09:48 -05:00
Michael Klishin 920c664fa3
Add a test originally introduced in #10062 2023-12-23 19:09:35 -05:00
Ariel Otilibili e1d09fbba6 Replaced true | false by boolean() 2023-12-22 17:28:31 +01:00
Marcial Rosales f3c4355cfb Clean up 2023-12-22 14:29:53 +00:00
Marcial Rosales 2fc8d2b3ae Propagate all credentials to http backend 2023-12-22 13:54:34 +00:00
Michael Klishin 7ebaae7ef0
Revert "HTTP API: DELETE /api/queues/{vhost}/{name} use internal API call"
This reverts commit 78f901a224.
2023-12-20 04:13:11 -05:00
Péter Gömöri 0a144e7698 Prevent formatter crash in mgmt_util
`rabbit_mgmt_util:direct_request/6` is always called with an
`ErrorMsg` which expects one format argument as a string. Convert the
arbitrary reason term into a string to avoid a crash like the below:

```
warning: FORMATTER CRASH: {"Delete exchange error: ~ts",[{'EXIT',{{badmatch,{error,...
```
2023-12-20 00:11:26 +01:00
Péter Gömöri f4a9edfd2f Tolerate race condition when starting management db cache process
This prevents the below harmless crash when multiple parallel API
requests arrive soon after starting the node.

```
exception error: no match of right hand side value
                 {error,{already_started,<0.1593.0>}}
  in function  rabbit_mgmt_db_cache:fetch/4 (rabbit_mgmt_db_cache.erl, line 68)
  in call from rabbit_mgmt_db:submit_cached/4 (rabbit_mgmt_db.erl, line 756)
  in call from rabbit_mgmt_util:augment/2 (rabbit_mgmt_util.erl, line 412)
  in call from rabbit_mgmt_util:run_augmentation/2 (rabbit_mgmt_util.erl, line 389)
  in call from rabbit_mgmt_util:augment_resources0/6 (rabbit_mgmt_util.erl, line 378)
  in call from rabbit_mgmt_util:with_valid_pagination/3 (rabbit_mgmt_util.erl, line 302)
  in call from rabbit_mgmt_wm_queues:to_json/2 (rabbit_mgmt_wm_queues.erl, line 44)
  in call from cowboy_rest:call/3 (src/cowboy_rest.erl, line 1583)
```
2023-12-19 18:07:22 +01:00
David Ansari f44c851293 Fix crash when closing connection
Avoid the following crash
```
** Reason for termination ==
** {mqtt_unexpected_cast,{shutdown,"Closed via management plugin"}}

  crasher:
    initial call: rabbit_mqtt_reader:init/1
    pid: <0.1096.0>
    registered_name: []
    exception exit: {mqtt_unexpected_cast,
                        {shutdown,"Closed via management plugin"}}
      in function  gen_server:handle_common_reply/8 (gen_server.erl, line 1208)
```
when closing MQTT or Stream connections via HTTP API endpoint
```
/connections/username/:username
```
2023-12-14 12:35:51 +01:00
Diana Parra Corbacho 5aa35e0570 Management: introduce deprecated features API endpoints, UI page and warnings 2023-12-13 07:39:37 +01:00
Diana Parra Corbacho ee84038ef5 Add experimental/disabled warning in State column 2023-12-12 18:07:36 +01:00
Diana Parra Corbacho ada8083d0d Add a warning banner if any stable feature flags is not enabled
Add an experimental tag on the description to experimental features
2023-12-12 18:07:36 +01:00
Michael Klishin 26aa534e40 Definition import: more logging improvements 2023-12-09 20:20:56 -05:00
Michael Klishin 62fffb6634 Another take at #10068
Scan queues, exchanges and bindings before attempting
to import anything on boot. If they miss the virtual
host field, fail early and log a sensible message.
2023-12-08 01:39:47 -05:00
Johan Rhodin 8ea1f8fc49
Merge branch 'rabbitmq:main' into FixInfoItems 2023-11-27 15:59:34 -06:00
Michael Klishin cc3084dfbf Fixes #9983 2023-11-25 18:59:51 -05:00
Michael Klishin 1b642353ca
Update (c) according to [1]
1. https://investors.broadcom.com/news-releases/news-release-details/broadcom-and-vmware-intend-close-transaction-november-22-2023
2023-11-21 23:18:22 -05:00
Michael Klishin 28ad76467e Management UI: link to GitHub Discussions and not the Google group 2023-11-19 19:35:49 -05:00
Johan Rhodin 851fddcad2 Fix wrong link 2023-11-17 16:48:39 -06:00
Johan Rhodin 226e7d138d fix info item, and behavior->behaviour 2023-11-17 11:01:47 -06:00
Ayanda Dube 324debe6cf add a test case for mgmt API deletion of crashed queues 2023-11-15 17:43:47 +00:00
Ayanda Dube 1ce75c7aae handle different queue states on deletion from the mgmt API 2023-11-15 17:43:47 +00:00
Karl Nilsson baff660ab4 use right dummy type 2023-11-07 11:53:57 +00:00
Karl Nilsson ff12d3b6b4 HTTP API /queues optimise resource_exists
There is no need to list all queues to check if the vhost
exists.
2023-11-07 11:27:11 +00:00
Karl Nilsson c2cd60b18d Optimise mgmt HTTP API /queues endpoint
Listing queues with the HTTP API when there are many (1000s) of
quorum queues could be excessively slow compared to the same scenario
with classic queues.

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

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

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

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

Also the quorum queue may transiently enter the down state when a node
goes down and before its elected a new leader.
2023-11-06 15:34:26 +00:00
Emerson Almeida 9c87e1902d remove test to idp-initiated 2023-11-01 10:23:02 -03:00
Emerson Almeida 64ded4632d make the baseUrl equal when run with prefix 2023-11-01 09:52:27 -03:00
Duke ca5e7e34d7
Merge branch 'main' into improve-login-exp 2023-10-31 13:35:20 -03:00
Marcial Rosales 7c58649942 Reduce by 5 seconds every oauth2 test
clickToLogin sbould only check that the
login button exists and not that the
warning messages is not visible
2023-10-31 16:31:37 +01:00
Marcial Rosales b409d97927 Bump up chromedriver version 2023-10-31 14:07:38 +01:00
Marcial Rosales c169f6ef50 Fix issue in run-scripts 2023-10-31 12:55:31 +01:00
Duke cd680bc568
move store pref to startWithOAuthLogin 2023-10-30 12:02:29 -03:00
Duke 9060941fc2
Remove overview var from redirection-after-login.js 2023-10-30 11:51:59 -03:00
Duke 0e757f394a
remove unused overview var 2023-10-30 11:50:23 -03:00
Emerson Almeida 7bf452c522 fix pref default 2023-10-29 18:34:42 -03:00
Emerson Almeida 7525ccc236 add tests 2023-10-29 18:34:42 -03:00
Duke 3e0ca9ede7 add oauth-return-to 2023-10-29 18:34:42 -03:00
Diana Parra Corbacho 07196e297b Reduce the number of metrics served by GET /api/queues
Introduce GET /api/queues/detailed endpoint

Just removed garbage_collection, idle_since and any 'null' value

/api/queues with 10k classic queues returns 7.4MB of data
/api/queues/detailed with 10k classic queues returns 11MB of data

This sits behind a new feature flag, required to collect data from
all nodes: detailed_queues_endpoint
2023-10-23 19:49:37 -04:00
Karl Nilsson 1ba62a90f2 Actually nack when using 'Nack message requeue true'
Option in mgmt UI.
2023-10-17 14:12:09 +01:00
Michael Klishin 6009a4973f
Merge pull request #9708 from rabbitmq/mk-limit-max-http-api-payload-size
Introduce a configurable limit to HTTP API request body size
2023-10-16 21:49:50 -04:00