Commit Graph

24893 Commits

Author SHA1 Message Date
Alexey Lebedeff 7676ed9685 Use `rabbitmq_cluster_` prefix for cluster-wide metrics 2021-11-24 16:49:43 +01:00
Michael Klishin 4f09fd109c
quorum_queue_SUITE: bump some timeouts 2021-11-24 18:04:35 +03:00
Michael Klishin 6a08e143e9
quorum_queue_SUITE: drop a debug line 2021-11-24 16:47:20 +03:00
Michael Klishin 38d64a54b1
Wording 2021-11-24 14:19:57 +03:00
Michael Klishin a1c0cd3785
Wording 2021-11-24 14:02:10 +03:00
Alexey Lebedeff 6e3012aaf9 Add optional metrics for vhost and exchange count
These can make sense in some scenarios, e.g. when vhost/exchanges are
+created using self-service automation
2021-11-24 11:00:41 +01:00
Luke Bakken 6d545447b9
Fix quorum queue crash during consumer cancel with return
Fixes #3729
2021-11-23 08:59:47 -08:00
Michael Klishin e22e667a10
Do not count unroutable message in global totals 2021-11-23 16:37:46 +03:00
Michael Klishin 0f0da778d0
Merge pull request #3708 from rabbitmq/filter-out-queues-from-global-stats
Use a pattern to filter out some queues from global stats
2021-11-23 15:01:40 +03:00
Luke Bakken bd2858c208
Compile the regex 2021-11-22 08:30:17 -08:00
Fushan Wen 23d5073dcb Add systemd hardening parameters in rabbitmq-server.service.example
systemd offers various options to harden services. To see details please
visit https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
2021-11-19 19:06:21 +08:00
Philip Kuryloski 11fd866247 Add the bazel target :package-generic-unix
Which can be used to build the artifact with bazel
2021-11-18 14:38:41 +01:00
Michael Klishin 665d100e39
Merge pull request #3752 from rabbitmq/stream-flakes
Stream flake fixes
2021-11-18 15:37:56 +03:00
Michal Kuratczyk acf474e056 Fix cuttlefish config for oauth2
The structure of the signing_keys map should be `<<"id">> => {pem, <<"key">>}`.
Previously it was mapped directly as `<<"id">> => <<"key">>`.
2021-11-18 12:58:57 +01:00
Karl Nilsson 8542b54f7e Stream coordinator: only initialise queue record if stream id matches 2021-11-17 16:16:37 +00:00
Karl Nilsson 3b62665b34 Stream coordinator: log member deletions 2021-11-17 09:04:35 +00:00
dcorbacho a7c9b66653 Use own key to exclude queues 2021-11-16 16:53:17 +01:00
Luke Bakken 6aaf7ec597
Merge pull request #3740 from rabbitmq/rabbitmq-server-3739
Distribution listener settings support in rabbitmq.conf
2021-11-16 06:36:48 -08:00
Philip Kuryloski ae45ab54a5
Merge pull request #3738 from rabbitmq/cleanup-symlink-private-log-message
Fixup the "Failed to symlink private_log directory." error in bazel
2021-11-16 06:12:22 -08:00
Michael Klishin f47de00910
Merge pull request #3731 from rabbitmq/stream-mnesia-update
Stream coordinator: only update amqqueue record if stream id matches
2021-11-16 16:53:54 +03:00
Michael Klishin 8a30cf1c86
Distribution listener settings support in rabbitmq.conf
* distribution.listener.interface
 * distribution.listener.port_range.min
 * distribution.listener.port_range.max

Closes #3739
2021-11-16 16:37:28 +03:00
Karl Nilsson bc7b339e7a Stream coordinator: only update amqqueue record if stream id matches
From the coordinator's POV each stream has a unique id consisting of the
vhost, queuename and a high resolution timestamp even if several stream ids
relate to the same queue record.

When performing the mnesia update the coordinator now checks that the current stream id
matches that of the update_mnesia action and does not change the queue record if
the stream id is not the same.

This should avoid "old" incarnations of a stream queue updating newer ones
with incorrect information.
2021-11-16 12:32:33 +00:00
Philip Kuryloski 3b48ebabf7 Fixup the "Failed to symlink private_log directory." error in bazel
While it doesn't cause any tests to fail, it's confusing to see it in
the logs
2021-11-16 13:25:53 +01:00
Philip Kuryloski e5a4907a60 Update exchange_SUITE timeouts
When the suite passes, it's about 120 seconds total, so 5 minutes per
case seems to be too much. Additionally, if the suite times out at the
bazel level, we get no logs, so the cause of the timeout is unclear.
2021-11-16 12:03:20 +01:00
dcorbacho 242cb539b3 Exclude queues from aggregated metrics in prometheus collector
Uses same exclusion pattern as the management agent
2021-11-16 10:23:39 +01:00
Luke Bakken 939673b31d
Merge pull request #3685 from rabbitmq/lukebakken/core-started-before-postlaunch-phase
Set core_started before running postlaunch phase
2021-11-15 07:04:25 -08:00
dcorbacho e299178471 Store collector pattern in process memory
Avoids multiple calls to `application:get_env` which can be very expensive.
Also limits filter to vhost_msg_stats, as queue_msg_stats are required for
individual queue metrics
2021-11-15 11:53:50 +01:00
Philip Kuryloski 1f7db0fa35 Update rabbit_ct_broker_helpers:force_vhost_failure/4 for erpc
https://www.erlang.org/doc/man/erpc.html#call-5
2021-11-15 10:53:10 +01:00
Michael Klishin 01f68b80c9
Merge pull request #3723 from wrobell/rabbitmq-streams-doc-protocol-deliver-fix
Fix description of "deliver" command in RabbitMQ Streams protocol documentation
2021-11-14 21:59:12 +03:00
wrobell b4f39031f6 Fix description of "deliver" command in RabbitMQ Streams protocol documentation
Add missing fields - chunk type, timestamp, trailer length and reserved.
The fields are added after looking at

    3fd348d225/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java (L267)
    https://github.com/qweeze/rstream/blob/master/rstream/schema.py#L376

Change type of "version" field - it shall be uint16 like in other
commands.
2021-11-14 14:51:35 +00:00
Michael Klishin 38982e2c67
Merge pull request #3714 from rabbitmq/mqtt-crash-log
Prevent crash logs when mqtt user is missing permissions
2021-11-13 04:28:57 +03:00
Karl Nilsson 7e4a33708b Stream coordinator: reset reply_to for delete_stream command
So that a reply is sent to the caller immediately after the command has
been processed as intended. Previously it was possible if reply_to was
already set that a reply never was sent to the caller and the caller
times out. This should improve some flakyness in the rabbit_stream_queue suite
as well.

Strictly this is a change that introduces indeterminism in the coordinator
state machine as during an upgrade different members may run different code
for this command. But as this state only affects side effects (replies) and
the state for the streams affected will shortly be removed this is very
unlikely to cause any real issues.
2021-11-12 17:27:34 +00:00
Alexey Lebedeff e0723d5e66 Prevent crash logs when mqtt user is missing permissions
Fixes #2941

This adds proper exception handlers in the right places. And tests
ensure that it indeed provides nice neat logs without large
stacktraces for every amqp operation.

Unnecessary checking for subscribe permissions on topic was dropped,
as `queue.bind` does exactly the same check. Topic permissions tests
were also added, and they indeed confirm that there was no change in
behaviour.

Ideally the same explicit topic permission check should be dropped for
publishing, but it's more complicated - so for now there only a
detailed comment in the source code explaining it.

A few other things were also optimized away:
- Using amqp client to test for queue existence
- Creating queues/starting consumptions too eagerly, even if not yet
  requested by client
2021-11-12 18:03:05 +01:00
Philip Kuryloski 115b951b9c
Merge pull request #3710 from rabbitmq/generate-rabbitmqadmin-cli-bazel
Generate the rabbitmqadmin cli under bazel
2021-11-12 07:24:37 -08:00
Michael Klishin 9fc298dffa
Merge pull request #3656 from rabbitmq/qq-messages-pending-fixes
Expose pending enqueues in quorum queue overview
2021-11-12 17:08:16 +03:00
Karl Nilsson bf6c747607 Expose pending enqueues in overview output to allow
debugging of situation where messages may be stuck.

Also cancel rabbit_fifo_client timer after message resend to avoid
resending them again when the timer triggers.
2021-11-12 13:37:15 +00:00
Michael Klishin 267558b9eb
Merge pull request #3676 from rabbitmq/qq-init-opts
Avoid slow mnesia transaction on QQ init
2021-11-12 15:52:02 +03:00
dcorbacho 055581f33d Use a pattern to filter out some queues from global stats
Some plugins might create internal queues that should not be accounted
for the total number of messages on the system. These can now be filtered
out using a regular expression on the queue name. Individual queue stats
are still available
2021-11-12 13:07:19 +01:00
Michael Klishin 25a08e6a54
Log it when a boot step finishes running 2021-11-12 14:20:06 +03:00
Philip Kuryloski 9c70b3220a Generate the rabbitmqadmin cli under bazel 2021-11-12 11:34:19 +01:00
Luke Bakken 223581f6fb
Set core_started before running postlaunch phase
Since the postlaunch phase is async there is a slight chance that rabbit_direct connections will not see core_started if attempted during postlaunch
2021-11-11 08:51:02 -08:00
Luke Bakken 13e62b0939
Merge pull request #3552 from rabbitmq/improve-amqp-10-stream-support
Improve consuming from a stream using AMQP 1.0
2021-11-11 06:29:47 -08:00
Michael Klishin 1b7a8f869e
Merge pull request #3587 from rabbitmq/prometheus-label-pre-render-optimization
Pre-render prometheus labels
2021-11-11 13:00:31 +03:00
Michael Klishin 8e180c581a
Use a for loop here because IE 11 does not support lambdas
Closes #3688
2021-11-11 00:31:32 +03:00
Sagi Sarussi eff5c063cb
Grammar 2021-11-10 15:31:06 +02:00
Karl Nilsson d2fde27b56 Avoid slow mnesia transaction on QQ init
As we only need to make sure the rabbit_queues table is populated
use a dirty write function that only does this instead. This could potentially
half recovery times for many QQ scenarios.
2021-11-10 09:10:55 +00:00
Philip Kuryloski e4505bea3d Use unique group names in rabbit_stream_SUITE
Technically duplicate names is supported by common test, but we have
seen it contribute to flakiness in our suite in practice

(cherry picked from commit 513446b6d1)
2021-11-09 13:52:41 +01:00
Alexey Lebedeff 8598c51579 Pre-render prometheus labels
This makes per-object metrics twice as fast.

Depends on https://github.com/deadtrickster/prometheus.erl/pull/137
2021-11-09 13:04:39 +01:00
Karl Nilsson e721ab291f Fix metric active value when consuming from a QQ
Introduced in 1c6e45257d
2021-11-08 14:28:42 +00:00
Karl Nilsson 3d7edcea92 Log recovery time by queue type 2021-11-08 11:07:41 +00:00
Karl Nilsson 1c6e45257d QQ: set better timeouts for commands
Refactor how the single active consumer check is performed when consuming.

Improve timeouts in rabbit_fifo_client.
2021-11-08 11:07:41 +00:00
Karl Nilsson 2fb1291c73 Handle quorum queue "queue pids"
In a function called if a queue declare returns 'absent'.
2021-11-08 11:07:40 +00:00
Karl Nilsson 3f4a7caf76 QQ: try all servers when registering enqueuer
This should avoid channel crashes when the leader has recently changed
and the amqqueue record hasn't yet been updated.

Also catch errors in the QQ tick temporary process that updates metrics.
During shutdown the metrics ETS table may disappear before this process has finished
which would result in a noisy error in the logs.
2021-11-08 11:07:40 +00:00
Michael Klishin dace33e9aa
Merge pull request #3658 from rabbitmq/lukebakken/update-comments-about-dummy-supervisors
Update link in comment
2021-11-05 06:36:25 +03:00
Luke Bakken 160a74862a
Update link in comment
It is a useful comment, so update all the links to the correct place on the internet:
http://erlang.org/pipermail/erlang-questions/2010-April/050508.html
2021-11-04 15:45:17 -07:00
Michael Klishin e544b51800
Merge pull request #3615 from rabbitmq/relax-msg-store-assertion-around-dup-writes-from-same-queue
rabbit_msg_store: Accept duplicate writes from the same queue
2021-11-04 02:28:29 +03:00
Arnaud Cogoluègnes ba5cfb1bae
Use version range for stream client Maven dependency
In test suite. Note a snapshot for 1.0-SNAPSHOT has been
pushed by mistake a while ago, so this one must be
excluded. It's unlikely it will be erased, as the snapshots
for the first stable version should be 1.0.0-SNAPSHOT.
2021-11-03 14:05:23 +01:00
Arnaud Cogoluègnes b71f1fd7e1
Bump Java dependencies in stream management test suite 2021-11-03 14:00:24 +01:00
Michal Kuratczyk 3f8925954c Turn down logging from queue rebalancing
With many queues, rebalancing can log hundreds of lines at warning/info
level, even though nothing exciting happened. I think we can tune that
down - if there is nothing to do - that's a debug level,
if things go well - that's info, not a warning.
2021-11-03 11:26:15 +01:00
Michal Kuratczyk a92a5327d5 Use erlang:system_info(creation) as GUID
Node GUID allows to differentiate between different incarnations of a node.
However, since rabbit may take some time to start (many queues/bindings, etc),
there could be a significant difference between Erlang VM being up and
responding to RPC requests and the new GUID being announced. During that
time, node monitor could incorrectly assume there was a network
partition, while in fact a node was simply restarted. With this change,
as soon as the Erlang VM is up, we can tell whether it was restarted and
avoid false positives.

Additionally, we now log if any queues were deleted on behalf of the
restarted node. This can take quite a long time if there are many transient
queues (eg. auto-delete queues). The longer this takes, the higher were the
odds of a restarted node being up again by the time
check_partial_partition was called. We may need to reconsider this logic
as well but for now - we just log this activity.

Co-authored-by: Loïc Hoguin <lhoguin@vmware.com>
2021-11-03 09:21:00 +00:00
Michael Klishin 686dccf410 Introduce a target cluster size hint setting
This is meant to be used by deployment tools,
core features and plugins
that expect a certain minimum
number of cluster nodes
to be present.

For example, certain setup steps
in distributed plugins might require
at least three nodes to be available.

This is just a hint, not an enforced
requirement. The default value is 1
so that for single node clusters,
there would be no behavior changes.
2021-11-03 08:42:58 +00:00
Michael Klishin 40db671e0b
Merge pull request #3633 from wrobell/rabbitmq-streams-doc-protocol-hex
Use hex values in RabbitMQ Streams protocol description
2021-11-02 21:58:42 +03:00
wrobell 08c417fdb7 Use hex values in RabbitMQ Streams protocol description
The protocol documentation uses decimal values for error and request key
codes.

Let's use hex values instead. This helps when looking at a request and
its response - 0x0006 and 0x8006 vs. 6 and 32774.

Also, when looking at output of protocol analysis tools like Wireshark,
a hexadecimal value will be printed, for example:

    "Nov  1, 2021 23:05:19.395825508 GMT","60216,5552","00000009000600010000000701"
    "Nov  1, 2021 23:05:19.396069528 GMT","5552,60216","0000000a80060001000000070001"

Above, we can visually identify delete publisher request and response
(0x0006 and 0x8006) and easily match them in the documentation of the
protocol.

Finally, above argument applies to logging as it is common to log
hex values, not decimal.
2021-11-02 18:31:30 +00:00
Philip Kuryloski 76287fb30c format with bazel files with buildifier 2021-11-02 18:24:26 +01:00
Philip Kuryloski aa666133b6 Maybe reduce flakiness of the exchange_SUITE 2021-11-02 18:23:54 +01:00
Philip Kuryloski 8c0eece3cd Adjustments for the latest bazel-erlang 2021-11-02 16:24:26 +01:00
Karl Nilsson 10372427dc Type spec fixes
So that dialyzer can pass.
2021-11-02 14:47:51 +00:00
Arnaud Cogoluègnes 56de49c007
Add Osiris to Bazel dependencies in prelaunch 2021-11-02 14:48:56 +01:00
Arnaud Cogoluègnes 6d23b2846c
Use Osiris helper to configure stream replication over TLS
References rabbitmq/osiris#16
2021-11-02 11:57:56 +01:00
Arnaud Cogoluègnes 7d57a5e7fb
Redact password in logs when applying default configuration 2021-11-02 11:57:56 +01:00
wrobell e74823d68c Fix use of "RabbitMQ Streams" in protocol documentation
The following RabbitMQ page uses "RabbitMQ Streams" or "streams",
therefore use it in the protocol documentation as well

    https://blog.rabbitmq.com/posts/2021/07/rabbitmq-streams-overview
2021-10-29 19:06:06 +01:00
wrobell 57ff5dbf4a Fix RabbitMQ Streams protocol documentation
1. Response for publisher declaration request does not contain
   publisher id.

2. Add mechanism entry to the details of SASL handshake request.

3. SASL handshake response contains list of mechanisms, not just single
   mechanism.
2021-10-28 17:53:22 +01:00
Jean-Sébastien Pédron 49c733be3a
rabbit_msg_store: Accept duplicate writes from the same queue
The situation is this one: if for some reason (i.e. a bug) a queue has
the same message referenced twice (or more) in its index and this
message is eligible for the message store (as opposed to being entirely
stored in the queue index), it will send it multiple times to the
message store.

Until now, the code of the message store had two assertions:
* one verified in the context of the queue process to make sure there
  was no two writes or two removes in a row;
* one verified in the context of the message store process, doing
  exactly the same.

Consider the following order of events:
1. the queue sends the first copy to the message store
2. the message store handles the first copy
3. the queue sends the second copy to the message
4. the message store handles the second copy

In this scenario, none of the assertions are triggered and the message
goes through the message store as if it was coming from different queues
(i.e. a fan-out use case).

Now consider this order of events:
1. the queue sends the first copy to the message store
2. the queue sends the second copy to the message store
3. the message store handles the first copy

This time, the code will hit both assertions, leading to the crash of
the queue, the crash of the message store and as a consequence, the
crash of the entire vhost.

In the case of two consecutive writes, those assertions are useless
because the message store already knows how to handle multiple copies of
the same message. However, the consequence are catastrophic: a single
queue with a duplicate message could take down an entire vhost.

This patch relaxes the assertion in the case of two consecutive writes.
Now, both scenarii described above will be consistent: the copies from
the same queue will be handled as any copies and the message store and
the vhost will continue to work as usual.

Note that this patch doesn't cover the reason why there were multiple
copies in the queue in the first place! So the initial reason for this
to happen is still there lurking somewhere. The user who saw this
problem had duplicate messages in a dead-letter queue. Perhaps something
related to the lack of publisher-confirms between the initial queue and
the dead-letter one?
2021-10-27 11:39:50 +02:00
Michael Klishin 7f0c1982a3
Merge pull request #3599 from rabbitmq/mgmt-ui-prometheus-port-fix
Prometheus plugin: fix TLS port handling
2021-10-21 02:47:07 +03:00
Michael Klishin 8ad8afac38
Merge pull request #3576 from rabbitmq/coordinator-error-handling
Handling of `stream_not_found` return value when init a stream client
2021-10-21 00:38:11 +03:00
Michael Klishin 52492da327
Merge pull request #3598 from rabbitmq/mgmt-ui-persistent-messages-fix
Fix persistent message count display in mgmt UI
2021-10-21 00:34:25 +03:00
Arnaud Cogoluègnes c0f1e23b17
Disable stream test in mixed versions mode
Not worth testing in this mode, as the stream plugin
does not start without the stream_queue feature flag.
2021-10-20 15:16:45 +02:00
Arnaud Cogoluègnes 030a08fa54
Enable stream_queue flag with env variable in test suite
For mixed version mode, where feature flags are
not explictely enabled.
2021-10-20 15:08:05 +02:00
Arnaud Cogoluègnes d87fa91a52
Enable stream_queue flag in test suite
For mixed version mode, where feature flags are
not explictely enabled.
2021-10-20 14:55:54 +02:00
Alexey Lebedeff b9ebfb8980 Fix ssl port handling in prometheus plugin
All ssl options were stored in the same proplist, and the code was
then trying to determine whether an option actually belongs to ranch
ssl options or not.

Some keys landed in the wrong place, like it did happen in #2975 -
different ports were mentioned in listener config (default at
top-level, and non-default in `ssl_opts`). Then `ranch` and
`rabbitmq_web_dispatch` were treating this differently.

This change just moves all ranch ssl opts into proper place using
schema, removing any need for guessing in code.

The only downside is that advanced config compatibility is broken.
2021-10-20 14:55:33 +02:00
Arnaud Cogoluègnes 6aabfdbbb4
Format stream plugin 2021-10-20 14:53:08 +02:00
Alexey Lebedeff a3b02bd01c Fix persistent message count display in mgmt UI
Fixes #3396

As can be seen in
9cf18e83f2/deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs (L171)
there should be 3 colums for a classic queue.

While it's possible to share the same field with the quorum queues
case, I did it this way so that conditions for the labels and for the
values will have the same shape.
2021-10-20 13:00:26 +02:00
Michael Klishin 87325b09f7
Improve a comment 2021-10-19 23:03:47 +03:00
Falcon Taylor-Carter 43b10615be Fix binding deletion in duplicate-binding scenarios 2021-10-18 23:25:27 -04:00
Falcon Taylor-Carter 4dab02289d Add tests for duplicate binding scenarios 2021-10-18 23:25:06 -04:00
Michael Klishin e64c316716
Merge pull request #3586 from rabbitmq/declare-stream-with-node-down-fix
Declare stream with node down fix
2021-10-18 18:34:38 +03:00
Karl Nilsson 691de2bea4 Take all clustered nodes into account when declaring stream.
Deriving a max-cluster-size only from running nodes would create situations where
in a three-node with only two nodes running cluster it would select an non-running
node as follower.
2021-10-18 15:44:53 +01:00
Michael Klishin 4c2c4bc9b3
Merge pull request #3574 from rabbitmq/fix-stream-coordinator-log
Fix stream coordinator log message
2021-10-15 16:27:39 +03:00
Michael Klishin 732e72b0da
Merge pull request #3582 from luos/channel-q-pid-leak-fix-v39x
Fix an Erlang monitor leak when queue churn is high

(cherry picked from commit a78b76afcd)
2021-10-15 16:25:24 +03:00
Michael Klishin 45a654c929
Merge pull request #3579 from tvhong-amazon/tvhong/log_error
Log response body of failed AWS requests
2021-10-15 00:59:07 +03:00
Michael Klishin 2140562209
Merge pull request #3562 from rabbitmq/disable_stream_plugin_3557
Disable the stream_plugin if stream feature flag is not enabled
2021-10-14 18:45:26 +03:00
Michael Klishin 78e18afd57
Wording 2021-10-14 18:24:52 +03:00
Arnaud Cogoluègnes 6d0dc3f6b4
Attach add/delete super stream command to streams scope only
Not to ctl.

References #3503
2021-10-14 17:09:18 +02:00
Michael Klishin 2fbc5fab25
Formatting, wording 2021-10-14 17:20:59 +03:00
dcorbacho 5f1ec61b50 Fix stream coordinator log message 2021-10-14 11:14:41 +02:00
Arnaud Cogoluègnes 75b2a53f52
Merge pull request #3503 from rabbitmq/super-stream-cli
Add functions to create/delete super stream in manager
2021-10-14 11:01:58 +02:00
dcorbacho 141f95598e Handling of `stream_not_found` return value when init a stream client
This error probably shouldn't happen if the system is correct, however
`stream_not_found` is a valid return value for the functions called
- it comes from `register_listener`.
Not handling it causes a case_clause (and long stacktrace) that is sent
to the client as an internal error, instead of a known protocol error.
Seen while debugging another issue.
2021-10-13 17:51:00 +02:00
Karl Nilsson 3f667a3cb8 amqp10_client: make shutdown scenarios a bit less noisy
by handling specific EXIT and DOWN messages that may occur during
certain connection closure cases.
2021-10-13 14:30:46 +01:00
Loïc Hoguin 0ee8a0612e
Fix memory_breakdown for connection procs
Instead of trying to read the ranch_server ETS table directly,
use an internal Ranch function that does the same. While neither
are documented, the latter is less likely to change.
2021-10-13 15:20:01 +02:00
Michael Klishin d48ed6dfb6
Merge pull request #3560 from rabbitmq/lh-fix-mandatory-flag
Fix memory leak when using mandatory flag in CQs
2021-10-13 16:16:31 +03:00
Loïc Hoguin 7ffb154787
Fix memory leak when using mandatory flag in CQs
MsgNo is defined for both mandatory flags and confirms,
but only confirms need to be kept track of in this module.
2021-10-13 14:13:56 +02:00
Michael Klishin 84b0ade5de
Merge pull request #3566 from rabbitmq/run-broker-more-plugin-ports
Allow having multiple `make run-broker` simulatneously
2021-10-13 13:39:59 +03:00
Michael Klishin d5b71e04b3
Merge pull request #3565 from rabbitmq/stream-queue-handle-unsupported-header-values
Stream queue: handle unsupported header value types
2021-10-13 13:17:10 +03:00
Gabriele Santomaggio f2df98aef9 change message 2021-10-13 12:01:21 +02:00
Gabriele Santomaggio 2eb625531d Disable the stream_plugin and stream management if the feature flag
is not enabled.
fixes https://github.com/rabbitmq/rabbitmq-server/issues/3557
2021-10-13 11:59:11 +02:00
Karl Nilsson 5520c6cafe Stream queue: handle unsupported header value types
As AMQP 0.9.1 headers are translated into AMQP 1.0 application properties
they are not able to contain complex values such as arrays or tables.

RabbitMQ federation does use array and table values so to avoid crashing when
delivering a federated message to a stream queue we drop them. These header values
should be considered internal however so dropping them before a final queue deliver should not be a huge problem.
2021-10-13 10:27:00 +01:00
Alexey Lebedeff 23be565a38 Allow having multiple `make run-broker` simulatneously
It was automatically happening for e.g. `make start-cluster`.

But some plugins were not covered by default generated config, and
running rabbit from 2 different worktrees was a bit complicated.
2021-10-13 10:52:02 +02:00
Michael Klishin 3826a0df25
Compile #3561 2021-10-13 01:27:16 +03:00
Michael Klishin 670f240537
Compile #3561 2021-10-12 20:17:51 +03:00
Gabriele Santomaggio c270ebf037 Disable the stream_plugin if the feature flag
is not enabled.
fixes https://github.com/rabbitmq/rabbitmq-server/issues/3557
2021-10-12 19:09:34 +02:00
Michael Klishin e087403e1a
Merge pull request #3554 from johanneswuerbach/expose-cluster-id
feat(prom): expose cluster id in identity
2021-10-12 17:48:46 +03:00
Johannes Würbach 84de860b4c
feat(prom): expose cluster id in identity 2021-10-12 15:43:46 +02:00
Arnaud Cogoluègnes 6b9589bae4
Handle stream arguments in add_super_stream command
max-age, leader-locator, etc.
2021-10-11 16:50:03 +02:00
Arnaud Cogoluègnes ecbd969834
Embed RPC call function in test 2021-10-11 16:50:02 +02:00
Arnaud Cogoluègnes 8ae60bef73
Fix group spec in test 2021-10-11 16:50:02 +02:00
Arnaud Cogoluègnes b0bd5f8a00
Add delete_super_stream CLI command 2021-10-11 16:50:02 +02:00
Arnaud Cogoluègnes a73b1a3d0d
Add add_super_stream CLI command 2021-10-11 16:50:01 +02:00
Arnaud Cogoluègnes 147659093f
Add functions to create/delete super stream in manager 2021-10-11 16:50:01 +02:00
Karl Nilsson 92f83a1af0 Improve consuming from a stream using AMQP 1.0
Allow an offset spec to be used to attach at an appropriate point in the
stream. This is done by specifying a source filter with the key rabbitmq:stream-offset-spec.

The offset is also included as a message annotation with the key x-stream-offset.

When a link is detached we also issue a basic.cancel to the 0.9.1 channel. If this wasn't done
and you detached then re-attached a link for the same queue you'd get a consumer-tag offset
error from the 0.9.1 channel.
2021-10-11 13:32:38 +01:00
Vy Hong a1a22b2a3c Log response body of failed AWS requests 2021-10-08 14:48:40 -07:00
Karl Nilsson db3944cfc4 Stream queue: use local pid for offset listeners
When a consumer reaches the end of a stream it need to register an
offset listener with the local stream member so that it can be notified
when new stream messages are committed. The stream queue implementation
for some reason registered offset listeners with the leader, not the local
member.
2021-10-07 14:31:09 +01:00
Philip Kuryloski 49a47586b0 Simplify erlc opts for rabbitmq_peer_discovery_common 2021-10-07 09:53:11 +02:00
Michael Klishin 798be7dcaf
Peer discovery AWS, K8S: more Dialyzer fixes 2021-10-07 03:42:44 +03:00
Luis Cusihuaman 5f81fff959 fix: list exchanges only by current vhost in topic-permissions 2021-10-06 19:06:00 -03:00
Philip Kuryloski 862917955b Adopt new default branch for ra 2021-10-06 13:36:32 +02:00
Philip Kuryloski 41d6172bf4 Adopt renamed default branch for osiris 2021-10-06 13:31:19 +02:00
GitHubPang 0f2a6123df
Fix typo in UI help hint 2021-10-04 08:01:43 +08:00
Michael Klishin 72c2e152ef
Merge pull request #3499 from rabbitmq/cla-url
Update CLA URL
2021-10-01 00:16:03 +03:00
Alexey Lebedeff 8c243c592d
Merge pull request #3520 from rabbitmq/alebedeff/opp-92
Emit identity info in prometheus /metrics/detailed endpoint
2021-09-30 13:45:26 +02:00
Philip Kuryloski ab0a9cd700
Merge pull request #3516 from rabbitmq/move-ct-helpers-to-monorepo
Move CT helpers to monorepo
2021-09-30 11:29:26 +02:00
Alexey Lebedeff 46df4f1689 Update makefiles/bazel to reflect CT helpers repo merge-in 2021-09-30 10:48:11 +02:00
Philip Kuryloski 9c9fb7ffb0 Shard cluster_management_SUITE by testcase to better manage timeouts
The suite level timeout the .erl I've learned is actually per
case. By sharding bu testcase, we can better match the common test
level and bazel level timeouts, such that we can get logs from remote
test run failures.
2021-09-30 10:38:39 +02:00
Vy Hong 7090199330 Reuse list of nodes in peer discovery plugins that use Erlang global locks
AWS, Kubernetes and Classic peer discovery plugins use list_nodes and
Erlang global:set_lock to create a mutex lock. To unlock, these plugins
get the latest list with list_nodes and call global:del_lock.

However, if list_nodes within unlock fails, RabbitMQ will throw an
uncaught exception and the lock will not be released until the node
holding the lock is restarted. This prevents new nodes from joining the
cluster.

This failure can be avoided by passing the list of nodes from lock to
unlock. If a node goes away (and comes back) between the lock and unlock
calls, del_lock could still successfully remove the lock. Similarly, if
a new node starts up between the lock and unlock calls, del_lock
wouldn't need to inform the new node.
2021-09-29 16:22:37 -07:00
Alexey Lebedeff b9072b5ac8 Merge rabbitmq_ct_client_helpers1 into monorepo 2021-09-28 19:53:20 +02:00
Alexey Lebedeff c292d04384 Merge rabbitmq_ct_helpers into monorepo with the whole history 2021-09-28 19:47:51 +02:00
Alexey Lebedeff 989a299720 Emit identity info in prometheus /metrics/detailed endpoint
This is needed to make filtering metrics on a cluster name possible.
2021-09-28 19:35:02 +02:00
Arnaud Cogoluègnes e8d0d380a2
Bump dependencies in stream Java tests 2021-09-28 14:02:10 +02:00
Arnaud Cogoluègnes fc80138204
Fallback to rabbit_stream:host/0 if advertised_tls_host not set
The advertised_host must also be tried for TLS connections.

References #3514
2021-09-28 14:00:41 +02:00
Carl Hörberg 52791c677b
Support for advertising different hostname for TLS stream connections
Use case: Allow plain connections over one (internal IP), and TLS
connections over another IP (eg. internet routable IP). Without this
patch a cluster can only support access over one or the other IP, not
both.

(cherry picked from commit b9e6aad035)
2021-09-28 13:47:22 +02:00
Philip Kuryloski f932c3e0bc bump a test timeout 2021-09-28 11:27:45 +02:00
Michael Klishin 04ae4ede5b
Merge pull request #3509 from rabbitmq/rabbitmq-server-3508-web-stomp-stream-consuming
Handle no-context delivery in web stomp
2021-09-27 22:28:16 +03:00
Ayanda Dube 3bce36b667 Preserve stacktraces in propagated unexpected internal auth backend
exceptions.
2021-09-27 19:19:30 +01:00
Arnaud Cogoluègnes b758edc642
Handle no-context delivery in web stomp
To support messages from streams, which do not have a
context (for credit flow).

References rabbitmq/rabbitmq-stomp#138

Fixes #3508
2021-09-27 09:52:48 +02:00
Ayanda Dube 78145d880a Extract SingleActiveConsumer channel-pid and consumer refs only once 2021-09-24 18:15:36 +01:00
Ayanda Dube fb0b1ec75a Remove code repetion in rabbit_auth_backend_internal catch statements
by matching and reusing the raised exception class
2021-09-24 18:15:36 +01:00
Michal Kuratczyk 1a2126676d Update CLA URL 2021-09-23 14:29:36 +02:00
Philip Kuryloski 89c96a5616 Adjust the federation_mgmt_SUITE timeout at the ct level
Set a timeout at the common test level that is less than 30
minutes. There is a 10 minute timeout at the bazel level, but if that
is reached, logs are not captured.
2021-09-23 13:59:00 +02:00
Philip Kuryloski 860653c97a Adjust the clustering_management_SUITE timeout at the ct level
Previously the bazel timeout and common test timeout were equal, which
meant that in practice the bazel timeout was often reached first, in
which case we don't receive the test logs
2021-09-23 13:55:18 +02:00
Philip Kuryloski 7fc60bae70
Merge pull request #3479 from rabbitmq/use-ct-helpers-for-prometheus-port
Use rabbitmq_ct_helpers to allocate prometheus port
2021-09-23 08:36:31 +02:00
Philip Kuryloski 7dc0c29227 Use only 3 nodes for feature_flags_with_unpriveleged_user_SUITE
The test does not appear reliable when it runs in Github actions. This
is currently the only test that does so. Other tests run of BuildBuddy workers.
2021-09-22 17:22:49 +02:00