Commit Graph

510 Commits

Author SHA1 Message Date
Michael Klishin cb694ef55a
Correct type spec for infer_extra_bcc/1 2021-05-20 13:58:45 +03:00
Arnaud Cogoluègnes 04d0114526
Merge pull request #3052 from rabbitmq/stream-rename-max-segment-size
Rename max-segment-size to stream-max-segment-size-bytes
2021-05-20 11:06:00 +02:00
Arnaud Cogoluègnes c30e013d7a
Rename max-segment-size to stream-max-segment-size-bytes 2021-05-20 10:16:19 +02:00
Loïc Hoguin 895060b3f5
Merge pull request #3041 from rabbitmq/cq-dont-deliver-immediately-before-ack
CQ: don't deliver right before acking in the index
2021-05-20 10:04:27 +02:00
Michael Klishin 040f8cc912
Replace a few more leftover MPLv1.1 license headers
Most files have been using the MPLv2 headers for months now.
These were detected by the OSL process.
2021-05-19 21:20:47 +03:00
Philip Kuryloski 6e895d892a Mark //deps/rabbit:rabbit_stream_queue_SUITE-cluster_size_3 flaky 2021-05-19 18:03:23 +02:00
Karl Nilsson aa9f01d4bf Remove unused function
For starting stream coordinator. The stream coordinator is now started on
demand and detects itself when new members need to be added.
2021-05-19 16:30:33 +01:00
Michael Klishin 09a4ad411e
Merge pull request #3046 from rabbitmq/mk-extra-bcc-routing-target-in-queue-metadata
Make it possible for queues to have extra BCC targets specified as options
2021-05-19 17:56:39 +03:00
Philip Kuryloski a931a74b84 Ignore xref warnings for two deprecated calls 2021-05-19 15:49:55 +02:00
Philip Kuryloski 9053d96ca0 Fix call to deprecated function
https://erlang.org/doc/general_info/deprecations.html#otp-22
2021-05-19 13:38:17 +02:00
Karl Nilsson ef52b92390 Make stream consumer arg parsing return error
when receiving unexpected input
2021-05-19 12:00:10 +01:00
Philip Kuryloski 667f5e0a22 Add basic xref for deps/rabbit 2021-05-19 12:43:25 +02:00
Karl Nilsson a96670b6c6 Fix stream x-stream-offset regression
x-stream-offset supports "friendly" relative timebase specifications
such as 100s. A recent change introduced a validation of the x-stream-offset
that disallowed such specs.
2021-05-19 11:23:37 +01:00
Philip Kuryloski 0b53760929 Shard the clustering_management_SUITE by group 2021-05-18 23:16:27 +02:00
Michael Klishin 38c15d691d
Make it possible for queues to have extra BCC targets specified as options
This introduces a backup mechanism that can be controlled
by plugins via policies.

Benchmarks suggest the cost of this change on
Erlang 24 is well under 1%. With a stream target, it is less
than routing to one extra queue of the same type (e.g. a quorum queue).
2021-05-18 22:22:16 +03:00
Arnaud Cogoluègnes f6d4c4f55d
Merge pull request #3012 from rabbitmq/stream-move-messages
Move messages from stream queues on the management UI
2021-05-18 15:33:19 +02:00
Loïc Hoguin 3ef858746c
CQ: don't deliver right before acking in the index 2021-05-14 14:25:11 +02:00
Philip Kuryloski e506e24a2d Fix bats shell testing in RBE 2021-05-14 10:45:43 +02:00
Philip Kuryloski 6d59d5d597 Run the "bats" tests for deps/rabbit in bazel 2021-05-14 10:39:25 +02:00
dcorbacho 75b11bea5b Make init callbacks of queue types return {ok, State} 2021-05-12 17:12:09 +01:00
dcorbacho acddc0ea9d Catch deliver errors in rabbit_queue_type 2021-05-12 17:12:09 +01:00
dcorbacho 733f5fb367 Report stream coordinator unavailable as an amqp error
Uses code 506: resource_error
2021-05-12 17:12:09 +01:00
Philip Kuryloski f965cf8dde Additional compiler flag normalization under bazel 2021-05-12 12:37:08 +02:00
Michael Klishin 13a31a49f3
Introduce amqqueue:set_options/2 2021-05-12 09:06:20 +03:00
Michael Klishin 6d8a3ff7b0
More rabbit_amqqueue:list_* functions 2021-05-12 01:56:12 +03:00
Michael Klishin 6cd4d62cef
Mention delivery ack timeout configurability
in the logs and consumer channel error message.

References #2990, #3032.
2021-05-11 23:13:59 +03:00
Michael Klishin 2793f5ee9b
Bump consumer acknowledgement timeout default to 30 minutes
Apparently 15 minutes is not enough for some. 1 hour seems to be
unreasonably long to our team, though.

References #2990, #3032
2021-05-11 20:25:29 +03:00
Philip Kuryloski 39198413e3 Normalize compiler opts for rabbit test_util.erl 2021-05-11 16:49:18 +02:00
Karl Nilsson 94e943692b
Merge pull request #3022 from rabbitmq/relative-time-offset
Support relative time based offset specs
2021-05-11 13:50:00 +01:00
dcorbacho 5a5042521d Rename variable 2021-05-11 12:27:37 +02:00
Philip Kuryloski c13c2af614 Bazel file refactoring 2021-05-11 12:03:27 +02:00
Loïc Hoguin d9344b2b58
Set segment_entry_count per vhost and use a better default
The new default of 2048 was chosen based on various scenarios.
It provides much better memory usage when many queues are used
(allowing one host to go from 500 queues to 800+ queues) and
there seems to be none or negligible performance cost (< 1%)
for single queues.
2021-05-11 10:45:28 +02:00
Philip Kuryloski d194341cb8 Bazel file refactoring 2021-05-11 10:44:28 +02:00
Philip Kuryloski 418cffc9f3 Add rabbit_common to the deps in rabbitmq_integration_suite macro
While not all suites strictly require it, those same suites depend on
it via the broker dependency anyway. Thus, there is no penalty, but it
shortens the BUILD.bazel file for deps/rabbit
2021-05-11 09:40:22 +02:00
Philip Kuryloski 13793e039b Bazel file refactoring for rabbit
Also `bazel run broker` now includes all plugins to better match
`make run-broker`
2021-05-10 17:55:27 +02:00
Michael Klishin ef1afa44c4
Introduce vhost:is_tagged_with/2 2021-05-09 00:16:09 +03:00
Michael Klishin 715b417ace
erts 11.1 ships with Erlang/OTP 23.2
which is provided by Ubuntu Hiresute and Debian Bullseye.
Older distributions are still supported by our own Erlang packages
for Debian and RPM-based distributions.
2021-05-04 01:04:19 +03:00
dcorbacho 464bf69cc4 Support relative time based offset specs 2021-05-03 17:55:43 +02:00
Michael Klishin 5010742f3f
Merge pull request #3016 from rabbitmq/delete-last-stream-replica
Disallow removal of the last stream member
2021-05-01 23:50:59 +03:00
Michael Klishin a5373d71d6
Make it possible to update virtual host tags
Currently they can only be specified at creation time
2021-05-01 21:48:50 +03:00
Michael Klishin 6539ad7fb1
Introduce functions that update virtual host metadata
specifically tags
2021-05-01 07:14:29 +03:00
dcorbacho bcac37d442 Disallow removal of the last stream member 2021-04-30 17:25:06 +02:00
Michael Klishin fc7501c309
Convert policy event keys to atoms
so that they are easier to match on
2021-04-28 12:57:06 +03:00
Michael Klishin b341cedc76
Merge pull request #3006 from rabbitmq/mk-emit-policy-update-event-after-schema-db-changes
Emit policy update event after schema database changes
2021-04-28 00:27:23 +03:00
Michael Klishin 62df3b7ebc
Reduce log output 2021-04-28 00:24:06 +03:00
Michael Klishin 57a4106531
Emit an internal event about policy change last
That is, after all schema DB changes were completed.
This way handlers won't run into heavy lock congestion the
updates entail.

Per discussion with @kjnilsson.
2021-04-27 18:34:14 +03:00
Karl Nilsson 30f3e5e13a
Merge pull request #2992 from rabbitmq/stream-coord-safe-restart
Capture and log crashes on the stream coordinator machine
2021-04-27 16:11:49 +01:00
kjnilsson 37275c4115 streams: improve stream_status command
To show all reachable replicas and their state
2021-04-27 12:24:43 +01:00
dcorbacho de8dd5fb69 Move messages from stream queues on the UI
Requires support of consumer args in shovel
2021-04-27 12:07:23 +02:00
Karl Nilsson 3dea868441
Merge pull request #3005 from rabbitmq/osiris-tracking-types
Adapt stream code to osiris tracking types introduction
2021-04-27 10:54:07 +01:00
Arnaud Cogoluègnes 4b71c34927
Make tracking status more generic
Type and value won't always be offset.
2021-04-27 11:52:29 +02:00
Arnaud Cogoluègnes d963e036de
Report offset and offset type in tracking status 2021-04-27 11:44:38 +02:00
Karl Nilsson 63e33aef6d
Merge pull request #2996 from rabbitmq/stream-add-replica-check
Streams: safer replica addition
2021-04-27 10:37:57 +01:00
kjnilsson a827275a43 Streams: safer replica addition
Disallow replica additions if any of the existing replicas are more than
10 seconds out of date.
2021-04-27 09:38:39 +01:00
Arnaud Cogoluègnes e4307b6180
Adapt stream code to osiris tracking types introduction 2021-04-27 09:44:59 +02:00
Michal Kuratczyk 76e060474b Revert "Increase ra:members/1 timeout to 60s"
It did not solve the problem and made the failure slower.

This reverts commit 510230302e.
2021-04-22 14:14:41 +02:00
Michael Klishin d62ebea692 Merge pull request #2973 from luos/mirror-sync-reduce-memory-use
Classic queue mirrors should also continue pushing messages to disk when syncing

(cherry picked from commit a728662fd7)
2021-04-22 12:49:20 +02:00
kjnilsson 55176066cf Set a default for consumer_timeout
So that faulty consumers that will never ack a pending messages have
their channels closed after 15 minutes.
2021-04-22 12:49:19 +02:00
Michal Kuratczyk d203364678 Change consistent to a dirty read
This is executed once per queue so potentially many, many, times
and a dirty read is much faster. The state of maintenance mode
on the nodes is unlikely to change during rebalancing.
2021-04-21 15:03:54 +02:00
dcorbacho 510230302e Increase ra:members/1 timeout to 60s
Transfer leadership is a slow command, it's acceptable to wait until
the ra cluster is ready to answer
2021-04-21 14:57:12 +02:00
dcorbacho eabdd8cdc1 Capture and log crashes on the stream coordinator machine 2021-04-21 13:00:04 +02:00
Michal Kuratczyk 1c13bb00f1 Ignore drained nodes when rebalancing
When running `rabbitmq-queues rebalance`, drained nodes (nodes in maintenance mode) should not recive QQ leaders nor CMQ masters.
2021-04-21 09:17:11 +02:00
Ayanda-D d78e14ad3b Allow #amqp_error{} responses in channel interceptors 2021-04-20 14:57:55 +01:00
Michael Klishin 1d794a5f95
Drop some Erlang 21-specific code
We no longer support it even in v3.8.x.
2021-04-19 14:11:19 +03:00
Michael Klishin 1587501733
Pass Dialyzer
x.509 certificate extensions do not really have types in
OTP's public_key, so our hands are tied.
2021-04-19 13:56:39 +03:00
Michael Klishin 21a6b1ba05
x.509 certificate auth mechanism: support (some) SANS of type otherName
Note that the type by definition contains arbitrary values. According
to the OTP types, they are triplets that represent effectively
a key/value pair. So we assume the pair is a string that needs a bit
massaging, namely stripping the UTF encoding prefix OTP AnotherName
decoder leaves in.

Kudos to @Thibi2000 for providing an example value.

Closes #2983.
2021-04-19 02:33:26 +03:00
Michael Klishin f948c73d57
Squash a warning that breaks CI compilation 2021-04-16 21:22:58 +03:00
Michael Klishin bb8464d425
Cosmetics 2021-04-16 18:37:13 +03:00
Michael Klishin d147a08aee
Correct parse tags provided as a list
Discovered while testing a PR for rabbit-hole
2021-04-16 18:35:47 +03:00
kjnilsson ac6b4ddc3a rabbit_fifo: fix failing tests
That regressed after refactoring how delivery effects are emitted.
2021-04-16 11:05:46 +01:00
Philip Kuryloski 33e95a03b3 Mark feature_flags_SUITE case flaky in bazel 2021-04-16 10:29:14 +02:00
Philip Kuryloski 50e4e17c93 buildifier 2021-04-16 10:28:53 +02:00
Philip Kuryloski 072a1c0462 Refactor and dedupe .bazel file content 2021-04-16 10:22:44 +02:00
Philip Kuryloski 9641261524 Make a smaller subset of the rabbit feature_flags_SUITE "exclusive"
This should alleviate lack of disk space in github actons
2021-04-16 09:17:21 +02:00
Michael Klishin 26159cc6a5
Merge pull request #2976 from rabbitmq/qq-in-memory-limit-bug-fix
QQ: ensure that messages are delivered in order
2021-04-15 22:01:13 +03:00
Philip Kuryloski 273622bea9 Mark rabbit_stream_queue_SUITE-cluster_size_3_1 as flaky 2021-04-15 17:43:14 +02:00
kjnilsson b35c29d7b2 QQ: ensure that messages are delivered in order
In the case where there are some messages kept in memory mixed with
some that are not it is possible that a messages are delivered to the
consuming channel with gaps/out of order which would in some cases cause
the channel to treat them as re-sends it has already seen and just
discard them. When this happens the messages get stuck in the consumer
state inside the queue and are never seen by the client consumer and
thus never acked. When this happen the release cursors can't be emitted
as the smallest raft index will be one of the stuck messages.
2021-04-15 15:01:22 +01:00
Philip Kuryloski ba017d743a Add missing groups in rabbit_stream_queue_SUITE 2021-04-14 13:52:31 +02:00
Philip Kuryloski b859246a9a shard the dynamic_ha_SUITE by testcase to pinpoint flakes 2021-04-14 10:02:06 +02:00
kjnilsson c975457199 rabbit_fifo: add smallest raft index to overview
This is useful information when debugging snapshotting issues.
2021-04-13 17:24:16 +01:00
dcorbacho 2f1f7c5288 Catch exception when remote node is up but rabbit app is stopped
It returns a badarg that crashes the queues API
2021-04-13 16:42:09 +01:00
dcorbacho d325daf052 Report number of readers for stream queues 2021-04-13 16:41:32 +01:00
dcorbacho b5f38b0f0f Report stream writer memory on queue stats 2021-04-13 16:40:29 +01:00
kjnilsson 4ff23ba699 Adjust stream status format
And remove not so useful fields.
2021-04-13 16:30:29 +01:00
dcorbacho 310a483221 CLI command to for stream details
rabbitmq-queues stream_status [--tracking] <queue>
If the --tracking option is enabled, it returns a table with all offset tracking
for that queue.
2021-04-13 15:29:40 +01:00
kjnilsson 9bd02b3510 Make streams compatible with osiris API changes
In osiris:init_reader
2021-04-13 15:02:32 +01:00
Jean-Sébastien Pédron f49bb000d1 Logging: Fix Cuttlefish schema mappings
I abused copy-pasting apparently: some Cuttlefish variables do not match
the application environment variables they are mapped to.
2021-04-13 14:35:31 +02:00
Michael Klishin 3eee69abf4
binary_to_atom/1 is not available in Erlang 22.3
so use rabbit_data_coercion:to_atom/1.

References 2968
2021-04-13 14:49:01 +03:00
Philip Kuryloski 078c897d2a Add rabbitmq_federation to bazel 2021-04-13 11:45:09 +02:00
kjnilsson ad7c0ef502 Stream coord: increase sleep on certain failures 2021-04-13 09:31:41 +01:00
dcorbacho bfdc1a46da Force a faster coordinator tick to flush data quicker
On restart it replays some old effects unnecessary, this change reduces
the risk of it
2021-04-12 22:41:22 +02:00
Philip Kuryloski 1cb2a0f403 Adjust timeouts for feature flags suite 2021-04-12 22:01:45 +02:00
Philip Kuryloski 4078ce17f3 Mark portions of the peer_discovery_classic_config_SUITE flaky 2021-04-12 19:18:22 +02:00
Philip Kuryloski 0dffb0356b Be more selective when marking the feature_flags_SUITE exclusive 2021-04-12 19:17:27 +02:00
Michael Klishin 6a4ee16b79
Merge pull request #2968 from rabbitmq/longer-qq-names
Allow quorum queue names to exceed atom max chars
2021-04-12 18:45:22 +03:00
kjnilsson 432edb11fc Allow quorum queue names to exceed atom max chars
If the concatenation of the vhost and the queue name exceeds 255 chars
we instead generate an arbitrary atom name instead of throwing an
exception.
2021-04-12 14:14:26 +01:00
Philip Kuryloski 85f9e5f994 Mark quorum_queue_SUITE-clustered-cluster_size_2 as flaky 2021-04-12 12:06:55 +02:00
Philip Kuryloski 738c8c32ee Fix the lack of systemd in certain bazel tests 2021-04-12 10:56:57 +02:00
Michael Klishin 7f98bc3d1c
Add more VM memory monitor tests, pass Dialyzer
(cherry picked from commit 57ec1f8768)
2021-04-11 11:36:30 +03:00
Michael Klishin 30cbbba167
High VM watermark: support {relative, N} values set via advanced.config
for usability. It is not any different from when a float value
is used and only exists as a counterpart to '{absolute, N}'.

Also nothing changes for rabbitmq.conf users as that format performs
validation and correct value translation.

See #2694, #2965 for background.
2021-04-11 10:28:35 +03:00
Michael Klishin 0a48a2a05b
Merge pull request #2965 from rabbitmq/rabbitmq-server-2964
CLI: handle {:relative, val} cases when formatting effective memory watermark value
2021-04-10 18:41:26 +03:00
Michael Klishin 9ac71aff66
Cosmetics 2021-04-10 18:40:03 +03:00
Michael Klishin 350bbed4fb
Handle {absolute, N} free disk space limit values
to be extra defensive.

We never supported it [1] but some try to use
it by analogy to the high VM watermark value
[in advanced.config]

References #2964.

1. https://github.com/rabbitmq/rabbitmq-server/blob/v3.6.x/docs/rabbitmq.config.example#L306-L320
2021-04-10 17:40:46 +03:00
Philip Kuryloski 16e96f6010 Fix rabbit -> systemd dependency in bazel 2021-04-09 15:53:51 +02:00
Philip Kuryloski 088f49b06e Mark feature_flags_SUITE-clustering as flaky in bazel 2021-04-09 14:19:55 +02:00
Jean-Sébastien Pédron 127295227c Doc: Fix all errors reported by edoc
With this, `gmake edoc` returns successfully and HTML docs are correctly
generated.
2021-04-09 13:15:32 +02:00
Jean-Sébastien Pédron 4992b0cc9f Systemd: Use erlang-systemd to notify systemd of service status
Until now, we were using socat(1). It was added as a dependency to our
Debian and RPM packages. Unfortunately, the availability of this package
has not always been good. We also supported erlang-sd_notify which
relied on a UDP socket. None of them had journald support.

Now, thanks to erlang-systemd, we can use the Unix socket and provide
more fine-grained status updates if we want.

Journald support is also provided by erlang-systemd. It was added to
RabbitMQ in commit 91583a0c0e (#2940).
2021-04-09 10:38:10 +02:00
Philip Kuryloski 3644ed58ee Test sharding and flaky annotations
Also rename a nested common test group in quorum_queue_SUITE to avoid
a name collision that prevented running the duplicates individually
2021-04-08 15:33:19 +02:00
Philip Kuryloski 78bb20f0aa Adopt change of suite_name -> name in ct_suite from @bazel-erlang 2021-04-08 14:25:06 +02:00
Thuan Duong Ba 6a515871c1
address review feedback 2021-04-08 12:28:59 +03:00
Thuan Duong Ba 5fe7abad88
address review feedback 2021-04-08 12:28:59 +03:00
Thuan Duong Ba 28f41b1958
address review feedback 2021-04-08 12:28:58 +03:00
Thuan Duong Ba 9634f8205a
address review feedback 2021-04-08 12:28:58 +03:00
Thuan Duong Ba b4d73f0889
update doc on `aws.prefer_imdsv2` flag 2021-04-08 12:28:58 +03:00
Thuan Duong Ba dd051ca8fb
update parse 4xx responses from instance metadata service 2021-04-08 12:28:58 +03:00
Thuan Duong Ba 3aeeed5f57
Support rabbit_peer_discovery_aws to work with instance metadata service v2 (IMDSv2).
IMDSv2 uses session-oriented requests. With session-oriented requests, a session token is retrieved first
then used in subsequent GET requests for instance metadata values such as instance-id, credentials, etc.

Details could be found here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
2021-04-08 12:28:58 +03:00
kjnilsson e2fd14b996 Bump timeouts for peer discovery suite 2021-04-07 10:00:07 +01:00
kjnilsson b576242952 Increase rabbit_stream_queue_SUITE timetrap
And set the default of make start-cluster to 3 nodes.
2021-04-06 15:50:22 +01:00
Loïc Hoguin 3cab7d59a6
Add new configuration variable to BUILD.bazel 2021-04-06 12:25:36 +02:00
Loïc Hoguin 9063bcbd5c
Add queue_index_segment_entry_count configuration
The default value of ?SEGMENT_ENTRY_COUNT is 16384. Due to
the index file format the entire segment file has to be loaded
into memory whenever messages from this segment must be accessed.

This can result in hundreds of kilobytes that are read, processed
and converted to Erlang terms. This creates a lot of garbage in
memory, and this garbage unfortunately ends up in the old heap
and so cannot be reclaimed before a full GC. Even when forcing
a full GC every run (fullsweep_after=0) the process ends up
allocating a lot of memory to read segment files and this can
create issues in some scenarios.

While this is not a problem when there are only a small number
of queues, this becomes a showstopper when the number of queues
is more important (hundreds or thousands of queues). This only
applies to classic/lazy queues.

This commit allows configuring the segment file entry count
so that the size of the file can be greatly reduced, as well
as the memory footprint when reading from the file becomes
necessary.

Experiments using a segment entry count of 1024 show no
noticeable downside other than the natural increase in the
number of segment files.

The segment entry count can only be set on nodes that have
no messages in their queue index. This is because the index
uses this value to calculate in which segment file specific
messages are sitting in.
2021-04-06 12:25:36 +02:00
Jean-Sébastien Pédron 95f9e92caa
unit_log_management_SUITE: Use $RABBITMQ_LOGS to configure logging
Now that the Cuttlefish schema sets default values for the application
environment in `{rabbit, [{log, ...}]}`, the values set in the testsuite
using application:setenv() are overwritten.

By using the $RABBITMQ_LOGS environment variable, we can override those
default values.
2021-04-06 11:52:55 +02:00
Michael Klishin 34b03d6728
Merge pull request #2940 from rabbitmq/support-journald-logging
Logging: Add journald support
2021-04-01 06:58:11 +03:00
Philip Kuryloski 64f6c18cb8 Add the rabbitmq_auth_backend_oauth2 suite
requires recent @bazel-erlang updates
2021-03-31 19:11:32 +02:00
Philip Kuryloski e94649a398 Mark the eager_sync_SUITE/eager_sync test case as flaky 2021-03-31 19:09:46 +02:00
Philip Kuryloski 0caeb65d04 Shard the eager_sync_SUITE by case
This suite contains only one group, but is long enough to warrant
sharding. This is probably a bit of a time penalty in absolute terms
because init_per_suite and init_per_group re-run in each shard.
2021-03-31 15:47:36 +02:00
Jean-Sébastien Pédron 91583a0c0e
Logging: Add journald support
The implementation depends on erlang-systemd [1] which uses Unix socket
support introduced in Erlang 19. Therefore it doesn't rely on a native
library. We also don't need special handling if the host doesn't use
journald.

To enable the journald handler, add the following configuration
variable:

    log.journald = true

The log level can also be set the same way it is with other handlers:

    log.journald.level = debug

The log messages are communicated to journald using structured data. It
is possible to configure which fields are transmitted and how they are
named:

    log.journald.fields = SYSLOG_IDENTIFIER="rabbitmq-server" syslog_timestamp syslog_pid priority ERL_PID=pid

In this example:
  * the `SYSLOG_IDENTIFIER` is set to a string literal
  * `syslog_timestamp and `syslog_pid` are aliases for
    SYSLOG_TIMESTAMP=time and SYSLOG_PID=os_pid
  * `priority` is a special field computed from the log level
  * `ERL_PID=pid` indicates `pid` should be sent as the `ERL_PID`
    field.

The message itself is implicit and always sent. Otherwise, the list of
fields must be exhaustive: fields which are unset in a particular log
event meta are sent as an empty string and non-mentionned fields are not
sent. The order is not important.

Here are some messages printed by `journalctl -f` during RabbitMQ
startup:

    Mar 26 11:58:31 ip-172-31-43-179 rabbitmq-server[19286]: Ready to start client connection listeners
    Mar 26 11:58:31 ip-172-31-43-179 rabbitmq-server[19286]: started TCP listener on [::]:5672
    Mar 26 11:58:31 ip-172-31-43-179 rabbitmq-server[19286]: Server startup complete; 0 plugins started.

[1] https://github.com/rabbitmq/erlang-systemd
2021-03-31 14:14:35 +02:00
Jean-Sébastien Pédron 571b97513f
Logging: Allow to set timezone in rfc3339- and format-string-based time formats
This is not exposed to the end user (yet) through the Cuttlefish
configuration. But this is required to make logging_SUITE timezone
agnostic (i.e. the timezone of the host running the testsuite should not
affect the formatted times).
2021-03-31 14:13:40 +02:00
Loïc Hoguin e128c6f78a
Merge pull request #2942 from carlhoerberg/proxy-protocol-dest
Get destination address from PROXY protocol
2021-03-31 13:20:54 +02:00
Philip Kuryloski 128785b863 Adopt enhancements from @bazel-erlang
- no need to test version of ra since +debug_info is now default
- adjust the way default erlc_opts are handled
2021-03-31 10:06:56 +02:00
Carl Hörberg 330b820a0f Update proxy protocol test cases 2021-03-30 16:55:36 +02:00
Philip Kuryloski 7b6af92adf Update rabbit PROJECT_ENV bazel equivalent
with the latest value from the Makefile
2021-03-30 10:44:55 +02:00
Jean-Sébastien Pédron 2f648da118
config_schema_SUITE: Stop testing log configuration
The design of the rabbit_ct_config_schema helper makes it impossible to
do pattern matching and thus handle default values in the schema. As a
consequence, the helper explicitly removes the `{rabbit, {log, _}}`
configuration key to work around this limitation until a proper solution
is implemented and all testsuites rewritten. See
rabbitmq/rabbitmq-ct-helpers@b1f1f1ce68.

Therefore, we can't test log configuration variables anymore using this
helper. Thatt's ok because logging_SUITE already tests many things.
2021-03-30 10:21:26 +02:00
Jean-Sébastien Pédron aca638abbb
Logging: Add configuration variables to set various formats
In addition to the existing configuration variables to configure
logging, the following variables were added to extend the settings.

log.*.formatter = plaintext | json
  Selects between the plain text (default) and JSON formatters.

log.*.formatter.time_format = rfc3339_space | rfc3339_T | epoch_usecs | epoch_secs | lager_default
  Configures how the timestamp should be formatted. It has several
  values to get RFC3339 date & time, Epoch-based integers and Lager
  default format.

log.*.formatter.level_format = lc | uc | lc3 | uc3 | lc4 | uc4
  Configures how to format the level. Things like uppercase vs.
  lowercase, full vs. truncated.
  Examples:
    lc: debug
    uc: DEBUG
    lc3: dbg
    uc3: DBG
    lw4: dbug
    uc4: DBUG

log.*.formatter.single_line = on | off
  Indicates if multi-line messages should be reformatted as a
  single-line message. A multi-line message is converted to a
  single-line message by joining all lines and separating them
  with ", ".

log.*.formatter.plaintext.format
  Set to a pattern to indicate the format of the entire message. The
  format pattern is a string with $-based variables. Each variable
  corresponds to a field in the log event. Here is a non-exhaustive list
  of common fields:
    time
    level
    msg
    pid
    file
    line
  Example:
    $time [$level] $pid $msg

log.*.formatter.json.field_map
  Indicates if fields should be renamed or removed, and the ordering
  which they should appear in the final JSON object. The order is set by
  the order of fields in that coniguration variable.
  Example:
    time:ts level msg *:-
  In this example, `time` is renamed to `ts`. `*:-` tells to remove all
  fields not mentionned in the list. In the end the JSON object will
  contain the fields in the following order: ts, level, msg.

log.*.formatter.json.verbosity_map
  Indicates if a verbosity field should be added and how it should be
  derived from the level. If the verbosity map is not set, no verbosity
  field is added to the JSON object.
  Example:
    debug:2 info:1 notice:1 *:0
  In this example, debug verbosity is 2, info and notice verbosity is 1,
  other levels have a verbosity of 0.

All of them work with the console, exchange, file and syslog outputs.

The console output has specific variables too:

log.console.stdio = stdout | stderr
  Indicates if stdout or stderr should be used. The default is stdout.

log.console.use_colors = on | off
  Indicates if colors should be used in log messages. The default
  depends on the environment.

log.console.color_esc_seqs.*
  Indicates how each level is mapped to a color. The value can be any
  string but the idea is to use an ANSI escape sequence.
  Example:
    log.console.color_esc_seqs.error = \033[1;31m

V2: A custom time format pattern was introduced, first using variables,
    then a reference date & time (e.g. "Mon 2 Jan 2006"), thanks to
    @ansd. However, we decided to remove it for now until we have a
    better implementation of the reference date & time parser.

V3: The testsuite was extended to cover new settings as well as the
    syslog output. To test it, a fake syslogd server was added (Erlang
    process, part of the testsuite).

V4: The dependency to cuttlefish is moved to rabbitmq_prelaunch which
    actually uses the library. The version is updated to 3.0.1 because
    we need Kyorai/cuttlefish#25.
2021-03-29 17:39:50 +02:00
kjnilsson ca1afe5223 type fix in stream coordinator 2021-03-29 15:23:49 +01:00
Philip Kuryloski 388654c542
Add a partial Bazel build (#2938)
Adds WORKSPACE.bazel, BUILD.bazel & *.bzl files for partial build & test with Bazel. Introduces a build-time dependency on https://github.com/rabbitmq/bazel-erlang
2021-03-29 11:01:43 +02:00
dcorbacho e98b343095 Fix variable match 2021-03-26 17:55:07 +01:00
Philip Kuryloski 09e85d2e3d
Merge pull request #2935 from rabbitmq/rabbitmq-queue-int-tests
Fix integration tests to wait until ra cluster is ready
2021-03-26 17:28:06 +01:00
dcorbacho a1caff2a86 Fix integration tests to wait until ra cluster is ready
Publish/confirm before grow/shrink members is enough
2021-03-26 17:04:50 +01:00
Philip Kuryloski 1ead01081a Increase startup delay range in peer_discovery_classic_config_SUITE
I suspect the second ra system for coordination requires a bit more
time in boot, as this seems to flake more often since the merge
2021-03-26 14:11:36 +01:00
Michael Klishin 2eac4debbf
rabbitmq.conf.example: mention pause_minority 2021-03-25 22:10:11 +03:00
Philip Kuryloski 3c0c0901b1 Restore retry in peer_discovery_classic_config_SUITE
It was accidentally left commented out
2021-03-25 20:05:36 +01:00
Philip Kuryloski c313f36b57 Fix Makefile for feature_flags_SUITE_data/my_plugin
It was not updated for the rabbitmq-components.mk consolidation
2021-03-25 19:43:48 +01:00
Jean-Sébastien Pédron f3f5606f22
rabbit_prelaunch_errors: Handle exception stacktraces with args list
... instead of function arity.

I don't know when this was introduced, perhaps Erlang 23. Anyway, each
stacktrace entry has now the form:

    {Mod, Fun, ArgListOrArity, Props}

where `ArgListOrArity` is either the function arity (an integer) or the
actual list of arguments passed to the function.

If we get the latter, we format the stacktrace line as usual and we add
the list of arguments to the line below it.
2021-03-25 14:49:25 +01:00
Philip Kuryloski 008e47ef3c Fixup the behavior of rabbit_mnesia:is_virgin_node/0
Given the addition of the Coord ra system (and additional files on disk)
2021-03-25 10:49:17 +01:00
Michael Klishin 647b2ad453
Revisit what drain and revive do when their feature flag is not enabled
If maintenance mode feature flag is not enable, drain and revive should return an error
2021-03-24 23:11:59 +03:00
kjnilsson 8d8b67bb34 fix rabbit_fifo_int_SUITE 2021-03-24 14:17:34 +00:00
Michael Klishin 8eac876bc8
Use "quorum_queues" for QQ Ra system
"quorum" and "coordination" are not very distinctive
2021-03-22 21:44:19 +03:00
kjnilsson 75cea78415
fixes 2021-03-22 21:44:19 +03:00
kjnilsson f6f02a5d2d
ra systems wip 2021-03-22 21:44:15 +03:00
Michael Klishin 246f50598b
Stacktrace arity can be an argument list in some cases
According to [1]. What even are types.

1. https://erlang.org/doc/reference_manual/errors.html
2021-03-22 21:08:31 +03:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
dcorbacho 9c1766df43 Rename policies to unsupported_policies in capabilities/0 2021-03-22 11:06:10 +01:00
Michael Klishin 373285093e
Merge pull request #2899 from rabbitmq/parallel-stream-suite
Run most stream tests in parallel
2021-03-19 22:21:18 +03:00
Michael Klishin 5a6c288395
Merge pull request #2902 from rabbitmq/unsupported-stream-rebalance
Filter out stream queues from rebalance command
2021-03-19 22:00:09 +03:00
Michael Klishin 5e0d7041cd
Merge pull request #2910 from rabbitmq/configure-num-conns-sup
Make ranch parameter `num_conns_sups` configurable
2021-03-19 21:59:30 +03:00
Michael Klishin 68bec4c945
Ranch max connection is per connection supervisor in Ranch 2.0 2021-03-19 21:54:45 +03:00
Jean-Sébastien Pédron 9fd2d68e7a
rabbit_prelaunch_logging: $RABBITMQ_LOGS doesn't override log level
... if it is set in the configuration file.

Here is an example of that use case:
* The official Docker image sets RABBITMQ_LOGS=- in the environment
* A user of that image adds a configuration file with:
      log.console.level = debug

The initial implementation, introduced in rabbitmq/rabbitmq-server#2861,
considered that if the output is overriden in the environment (through
$RABBITMQ_LOGS), any output configuration in the configuration file is
ignored.

The problem is that the output-specific configuration could also set the
log level which is not changed by $RABBITMQ_LOGS. This patch fixes that
by keeping the log level from the configuration (if it is set obviously)
even if the output is overridden in the environment.
2021-03-19 15:43:28 +01:00
dcorbacho a41ece3950 Make ranch parameter `num_conns_sups` configurable
Defaults to 1
rabbit - num_conns_sup
rabbitmq_mqtt - num_conns_sup
rabbitmq_stomp - num_conns_sup
2021-03-18 21:38:13 +01:00
kjnilsson 52f745dcde Update rabbitmq-components.mk
use v1.x branch of ra
2021-03-18 15:14:40 +00:00
dcorbacho 75e37ce1db Filter out stream queues from rebalance command
It's not yet supported by streams, so avoid them altogether to avoid crashes
2021-03-17 23:26:29 +01:00
dcorbacho 9b3b5d48ec Run most stream tests in parallel
The test suite isn't faster, I guess some contention on the coordinator,
but is finding some bugs.
2021-03-17 21:32:42 +01:00
kjnilsson cbf0107605 Stream coordinator bug fix
Fix issue where a deleted replica could be restarted if the leader went
down whilst the replica was still running it's start phase.
2021-03-17 13:54:28 +00:00
kjnilsson 9d83e0c5d9 Add logging to config decryption test
To possibly get a bit more information on failure reasons on GH Actions.
2021-03-16 16:28:41 +00:00
Karl Nilsson 1b7379d266
Merge pull request #2876 from rabbitmq/stream-coord-refactor
Stream Coordinator refactor
2021-03-16 11:10:44 +00:00
kjnilsson eb91d50fd4 stream coordinator fall back to consistent query 2021-03-16 09:01:56 +00:00
Arnaud Cogoluègnes e46216b5a8 Check PID on leader lookup in stream plugin
To make sure the PID is alive, as the mnesia record can stale after a
failure.

Make also the local PID lookup in the stream coordinator do a consistent
query over the cluster if the PID is not alive.

Co-authored-by: Karl Nilsson <kjnilsson@users.noreply.github.com>
2021-03-12 15:04:40 +00:00
kjnilsson 3a26cf8654 Stream coordinator: handle commands for unknown streams
To avoid crashing.
2021-03-12 15:04:40 +00:00
kjnilsson 1709208105 Throw resource error when no local stream member
As well as some additional tests
2021-03-12 15:04:40 +00:00
dcorbacho e19aca8075 Use right map fields to compute streams info 2021-03-12 15:04:40 +00:00
kjnilsson 7fa3f6b6e1 Stream Coordinator: primitive backoff
Sleep for 5s after a failure due to a node being down before reporting
back to stream coordinator (which will immediately retry).

stream coordinator: correct command type spec

tidy up

fix rabbit_fifo_prop tests

stream coord: add function for member state query
2021-03-12 15:03:47 +00:00
kjnilsson bb3e0a7674 Move stream coordinator unit tests into ct suite 2021-03-12 15:03:10 +00:00
kjnilsson 9fb2e6d2dd Stream Coordinator refactor 2021-03-12 15:03:08 +00:00
Loïc Hoguin d5e3bdd623
Add ADDITIONAL_PLUGINS variable
This allows including additional applications or third party
plugins when creating a release, running the broker locally,
or just building from the top-level Makefile.

To include Looking Glass in a release, for example:

$ make package-generic-unix ADDITIONAL_PLUGINS="looking_glass"

A Docker image can then be built using this release and will
contain Looking Glass:

$ make docker-image

Beware macOS users! Applications such as Looking Glass include
NIFs. NIFs must be compiled in the right environment. If you
are building a Docker image then make sure to build the NIF
on Linux! In the two steps above, this corresponds to Step 1.

To run the broker with Looking Glass available:

$ make run-broker ADDITIONAL_PLUGINS="looking_glass"

This commit also moves Looking Glass dependency information
into rabbitmq-components.mk so it is available at all times.
2021-03-12 12:29:28 +01:00
David Ansari 18ba5b803f Avoid unnecessary network calls
by flipping the two list comprehension conditions.
If not is_local_to_node, then is_down will not be evaluated.
This saves (R-1) * Q network calls every 2 minutes where R is the number
of replicas per quorum queue and Q is the number of quorum queues in the
RabbitMQ cluster.
2021-03-11 16:29:05 +01:00
Michael Klishin 97ff62d3b2
Drop trailing newlines from logged messages where possible
Lager strips trailing newline characters but OTP logger with the default
formatter adds a newline at the end. To avoid unintentional multi-line log
messages we have to revisit most messages logged.

Some log entries are intentionally multiline, others
are printed to stdout directly: newlines are required there
for sensible formatting.
2021-03-11 15:17:37 +01:00
Michael Klishin b67c030953
Use Cuttlefish master for now
it no longer depends on Lager
2021-03-11 15:17:37 +01:00
Jean-Sébastien Pédron cdcf602749
Switch from Lager to the new Erlang Logger API for logging
The configuration remains the same for the end-user. The only exception
is the log root directory: it is now set through the `log_root`
application env. variable in `rabbit`. People using the Cuttlefish-based
configuration file are not affected by this exception.

The main change is how the logging facility is configured. It now
happens in `rabbit_prelaunch_logging`. The `rabbit_lager` module is
removed.

The supported outputs remain the same: the console, text files, the
`amq.rabbitmq.log` exchange and syslog.

The message text format slightly changed: the timestamp is more precise
(now to the microsecond) and the level can be abbreviated to always be
4-character long to align all messages and improve readability. Here is
an example:

    2021-03-03 10:22:30.377392+01:00 [dbug] <0.229.0> == Prelaunch DONE ==
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Starting RabbitMQ 3.8.10+115.g071f3fb on Erlang 23.2.5
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Licensed under the MPL 2.0. Website: https://rabbitmq.com

The example above also shows that multiline messages are supported and
each line is prepended with the same prefix (the timestamp, the level
and the Erlang process PID).

JSON is also supported as a message format and now for any outputs.
Indeed, it is possible to use it with e.g. syslog or the exchange. Here
is an example of a JSON-formatted message sent to syslog:

    Mar  3 11:23:06 localhost rabbitmq-server[27908] <0.229.0> - {"time":"2021-03-03T11:23:06.998466+01:00","level":"notice","msg":"Logging: configured log handlers are now ACTIVE","meta":{"domain":"rabbitmq.prelaunch","file":"src/rabbit_prelaunch_logging.erl","gl":"<0.228.0>","line":311,"mfa":["rabbit_prelaunch_logging","configure_logger",1],"pid":"<0.229.0>"}}

For quick testing, the values accepted by the `$RABBITMQ_LOGS`
environment variables were extended:
  * `-` still means stdout
  * `-stderr` means stderr
  * `syslog:` means syslog on localhost
  * `exchange:` means logging to `amq.rabbitmq.log`

`$RABBITMQ_LOG` was also extended. It now accepts a `+json` modifier (in
addition to the existing `+color` one). With that modifier, messages are
formatted as JSON intead of plain text.

The `rabbitmqctl rotate_logs` command is deprecated. The reason is
Logger does not expose a function to force log rotation. However, it
will detect when a file was rotated by an external tool.

From a developer point of view, the old `rabbit_log*` API remains
supported, though it is now deprecated. It is implemented as regular
modules: there is no `parse_transform` involved anymore.

In the code, it is recommended to use the new Logger macros. For
instance, `?LOG_INFO(Format, Args)`. If possible, messages should be
augmented with some metadata. For instance (note the map after the
message):

    ?LOG_NOTICE("Logging: switching to configured handler(s); following "
                "messages may not be visible in this log output",
                #{domain => ?RMQLOG_DOMAIN_PRELAUNCH}),

Domains in Erlang Logger parlance are the way to categorize messages.
Some predefined domains, matching previous categories, are currently
defined in `rabbit_common/include/logging.hrl` or headers in the
relevant plugins for plugin-specific categories.

At this point, very few messages have been converted from the old
`rabbit_log*` API to the new macros. It can be done gradually when
working on a particular module or logging.

The Erlang builtin console/file handler, `logger_std_h`, has been forked
because it lacks date-based file rotation. The configuration of
date-based rotation is identical to Lager. Once the dust has settled for
this feature, the goal is to submit it upstream for inclusion in Erlang.
The forked module is calld `rabbit_logger_std_h` and is based
`logger_std_h` in Erlang 23.0.
2021-03-11 15:17:36 +01:00
Michael Klishin cca6b22720
This message arguably belongs to the channel category
Since it documents something that happens to channels.
There are other messages that document the fact that
this connection is being closed.
2021-03-11 08:20:11 +03:00
Michael Klishin f6e8320fc9
Merge branch 'otp-24-ranch' 2021-03-10 07:37:51 +03:00
dcorbacho 61f7b2a723 Update to ranch 2.0 2021-03-08 23:11:05 +01:00
Michael Klishin 3eee3eecff
Cuttlefish 2.7.0 for Erlang 24 compatibility 2021-03-08 10:53:25 +01:00
Michael Klishin b6c4831e75
Bump Lager to 3.9.1 2021-03-04 04:36:39 +03:00
dcorbacho 82512ce206
Clean up rabbit_fifo_usage table on queue.delete 2021-03-04 04:06:40 +03:00
Michael Klishin ea41934d9c
Require Erlang/OTP 23 for RabbitMQ 3.9 2021-03-04 04:06:40 +03:00
Michael Klishin 3127a2f5d6
Remove an stdout log entry 2021-03-01 21:55:27 +03:00
Michael Klishin 4ab0c2e44f
Restore Erlang 22.3 compatibility for direct reply-to 2021-03-01 21:55:27 +03:00
Michal Kuratczyk a0aa8139b1
Replace Async threads warning with Dirty I/O
Async threads are basically not used these days.
Dirty I/O schedulers, on the other hand, are used a lot.
2021-03-01 21:55:27 +03:00
Loïc Hoguin 66ac1bf5e9
Bump observer_cli to 1.6.1
More responsive when the system is overloaded with file calls.
2021-03-01 21:55:27 +03:00
Michael Klishin ffcc590238
Update heartbeat timeout docs in rabbitmq.conf.example
Per suggestion from @adamhooper in #2852
2021-03-01 21:55:26 +03:00
Michael Klishin 4b98a0db7e
Adaptation to Lager 3.9 2021-02-26 04:23:04 +03:00
Michael Klishin 8fe3df9343
Upgrade Lager to 3.9.0 for OTP 24 compatibility
`lager_util:expand_path/1` use changes are
due to erlang-lager/lager#540
2021-02-26 00:52:15 +03:00
Michael Klishin a2f98f25e9
Merge pull request #2804 from rabbitmq/rabbitmq-server-2756
Add federation support for quorum queues
2021-02-25 19:10:15 +03:00
Michael Klishin 17b082abeb
Merge pull request #2843 from rabbitmq/consumer-capacity
Rename consumer_utilisation to consumer_capacity
2021-02-25 16:17:09 +03:00
dcorbacho 6778c1fea3 Small code enhancements 2021-02-25 11:27:40 +01:00
Michael Klishin 5f72779d57
Squash a warning on OTP 24 2021-02-25 01:06:41 +03:00
Michael Klishin cd1a271499
As of Lager 3.8.2, Lager has a log_root default
so override it unconditionally.
2021-02-25 00:43:02 +03:00
Michael Klishin 046db4be92
OTP 22 compatibility
(cherry picked from commit 652ffd2a15)
2021-02-24 22:37:55 +03:00
Michael Klishin f183ee4609
Adapt to the types used by string:lexemes/2 2021-02-24 20:41:32 +03:00
Michael Klishin 7ba2bde260
Correctly use string:lexemes/2 2021-02-24 20:31:10 +03:00
Michael Klishin 33d8ac4f79
Revisit type signatures that tripped up Dialyzer 2021-02-24 20:17:20 +03:00
Michael Klishin a11f98ccd8
Fall back to v1 direct reply-to encoding 2021-02-24 20:03:02 +03:00
Michael Klishin 00b7a84191
Limit direct reply-to identifier length growth
as node names grow.

Prior to this change, direct reply-to consumer channels
were encoded using term_to_binary/1, which means the result
would grow together with node name (since node name
is one of the components of an Erlang pid type).

This means that with long enough hostnames, reply-to
identifiers could overflow the 255 character limit of
message property field type, longstr.

With this change, the encoded value uses a hash of the node name
and then locates the actual node name from a map of
hashes to current cluster members.

In addition, instead of generating non-predictable "secure"
GUIDs the feature now generates "regular" predictable GUIDs
which compensates some of the additional PID pre- and post-processing
outlined above.
2021-02-24 18:21:26 +03:00
Michael Klishin 129a57dcef
Extract direct reply-to PID encoding into a new module 2021-02-24 18:21:26 +03:00
dcorbacho 930c78795c Rename consumer_utilisation to consumer_capacity
Capacity is 100% when there are online consumers and no messages
2021-02-24 16:20:52 +01:00
Michael Klishin f73e851f9c
Bump observer_cli to 1.6.0 2021-02-24 12:53:55 +03:00
Michael Klishin a5098b28a7
Bump Lager to 3.8.2 for OTP 24 compatibility 2021-02-24 12:53:30 +03:00
dcorbacho 8592291afa Fix notify_decorators and policy notifications 2021-02-21 22:56:06 +01:00
dcorbacho 0e63a7d79c Select applicable policies from exclusion list
It's not possible to know all aplicable policies since plugins can extend
these, i.e. federation. Thus, we'll exclude the known unapplicable core policies
and allow through any other policy.
2021-02-19 16:45:57 +01:00
Michael Klishin f37b3ca5d0
Ditto for ERTS_MINIMUM
(cherry picked from commit b78f45260f)
2021-02-19 17:33:35 +03:00
Michael Klishin fda5c0745c
Bump validated Erlang/OTP version minimum to 22.3
After several releases and several months of
docs saying that 22.3 is the minimum supported
version, we pull the trigger.

This is required by rabbitmq/credentials-obfuscation#10
as it uses the new crypto API available
in 22.1+ only.

(cherry picked from commit 36d6693776)
2021-02-19 16:48:09 +03:00
dcorbacho 699cd1ab29 Add federation support for quorum queues 2021-02-18 17:15:47 +01:00
Michael Klishin 7af5802a0e
rabbit_looking_glass: add an xref ignore
Looking Glass is a conditionally added dependency that
must be excluded in CI environments.
2021-02-18 18:26:48 +03:00
Michael Klishin f58a8370c8
Bump Cuttlefish to 2.6.0 2021-02-18 18:01:01 +03:00
Michael Klishin 5c84cf80ab
Make it possible to start Looking Glass without starting tracing
by exporting RABBITMQ_TRACER="true"
2021-02-16 14:09:46 +03:00
Michael Klishin d52f8da763
Correct TLS settings not compatible with TLSv1.3 2021-02-14 01:35:08 +03:00
Michael Klishin 6d4c005731
rabbitmq.conf.example: clarify TLS settings incompatible with TLSv1.3 2021-02-14 01:08:24 +03:00
Michael Klishin 36262814fe
Document TLSv1.3-specific cipher suites in rabbitmq.conf.example 2021-02-14 00:01:23 +03:00
Michael Klishin 0e4436ff37
More TLS-related edits in rabbitmq.conf.example 2021-02-13 23:25:12 +03:00
Michael Klishin b6f7a58487
Drive-by change: correctly format connection name 2021-02-13 23:23:41 +03:00
Gabriele Santomaggio 68120f3467 fix space 2021-02-13 14:14:48 +01:00
Gabriele Santomaggio 1ac2e22f54 Add tls info 2021-02-13 14:12:32 +01:00
Gabriele Santomaggio b6635ab52e Add tls info 2021-02-13 14:09:30 +01:00
Michael Klishin a3713aae54
Merge pull request #2803 from carlhoerberg/default-no-busy-wait
Disable Erlang busy wait threshold by default
2021-02-10 21:21:50 +03:00
D Corbacho 09f74b3a47
Merge pull request #2773 from rabbitmq/is-unresponsive-stream
Implement `is_unresponsive` for stream queues
2021-02-10 14:09:29 +00:00
Carl Hörberg 413bfe7b37 Disable Erlang busy wait by default
By disabling Erlang busy wait threshold CPU usage with 5000 idle connection
drops from 110% to 14%. Throughput does not seem to be affected at all,
if any thing it actually goes up a bit when you have 5000 idle connections
(because less CPU cycles are wasted polling idle connections).

rabbitmq-perf-test-2.13.0/bin/runjava com.rabbitmq.perf.PerfTest -s 8000 -z 15

With default erlang busy wait threshold:
id: test-115706-497, sending rate avg: 39589 msg/s
id: test-115706-497, receiving rate avg: 39570 msg/s

With busy wait disabled:
id: test-115807-719, sending rate avg: 40340 msg/s
id: test-115807-719, receiving rate avg: 40301 msg/s

rabbitmq-diagnostics runtime_thread_stats output while running the
PerfTest:

with default busy wait threshold:

Stats per type:
         async    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%
           aux    0.01%    0.00%    0.00%    0.00%    0.00%    0.00%   99.98%
dirty_cpu_sche    0.00%    0.00%    0.00%    0.03%    0.05%    0.00%   99.92%
dirty_io_sched    0.00%    0.00%    0.00%    0.00%    0.01%    0.00%   99.99%
          poll    0.00%    0.67%    0.00%    0.00%    0.00%    0.00%   99.33%
     scheduler    0.69%    0.18%   28.41%    5.49%    9.50%    7.43%   48.29%

without busy wait threshold:

Stats per type:
         async    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%
           aux    0.01%    0.00%    0.00%    0.00%    0.01%    0.00%   99.98%
dirty_cpu_sche    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%
dirty_io_sched    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%
          poll    0.00%    0.77%    0.00%    0.00%    0.00%    0.00%   99.23%
     scheduler    0.70%    0.14%   28.29%    5.41%    0.86%    7.22%   57.38%
2021-02-10 12:35:12 +01:00
Michael Klishin 8e250ae7c4
x-arg validation fixes, improved error reporting for queue declaration
Part of #2798.
2021-02-10 07:30:14 +03:00
Michael Klishin 927a9ddb52
Make it possible to specify optional queue arguments for dynamic Shovels
when shovels declare queues, it is currently not possible to declare
a quorum queue.

Closes #2798.
2021-02-10 06:13:18 +03:00
Michael Klishin 68c04358a5
Drive-by change: improve wording used by 'rabbitmq-queues rebalance' 2021-02-09 21:02:52 +03:00
Michael Klishin 686d462035
Avoid unintentional matching here 2021-02-09 20:32:00 +03:00
Michael Klishin f177a12cca
Handle queue deletions in the middle of leadership transfers
If we cannot transfer a queue because its record is gone
(e.g. it was a queue with TTL or an auto-delete queue),
skip it and move on.

Closes #2796
2021-02-09 19:39:45 +03:00
Michael Klishin ad20bfbc40
Use new crypto API cipher name here
References rabbitmq/credentials-obfuscation#10
2021-02-09 11:22:48 +03:00
Michael Klishin 83e3f75f01
Import runtime parameters after the topology
To reduce the likelihood of Shovel startup racing with
queue startup. See #2799 for details.

Closes #2799 for details.
2021-02-08 20:47:32 +03:00
Michael Klishin e7a3f30fd5
Don't consider exclusive classic queues to be mirrored
Because they are not, and should not be considered for operations
or features that assume mirroring, such as queue rebalacing.

Closes #2795.
2021-02-08 16:59:23 +03:00
Michael Klishin 0939cec51a
Exclude aes_ige256 in one more test suite 2021-02-08 11:21:16 +03:00
Michael Klishin b11a79cccf
Bump (c) year in header files 2021-02-04 07:04:58 +03:00
Michael Klishin d99e56173a
Merge pull request #2771 from rabbitmq/issue-2715
New command to close all connections of a user
2021-02-01 20:35:20 +03:00
Michael Klishin 6cb015933b
Correct a type spec 2021-02-01 20:25:48 +03:00
Michael Klishin 394d36ab76
Use a record here
accessing record/tuple elements by index is
increases the risk of code breakage when
the record changes.
2021-02-01 20:19:12 +03:00
Michael Klishin 0d5aa1b0f3
Compile 2021-02-01 18:56:32 +03:00
dcorbacho bfaea09df9 Implement `is_unresponsive` for stream queues 2021-02-01 16:49:10 +01:00
Michal Kuratczyk ea1f4a355a New command: `rabbitmqctl close_all_user_connections` 2021-02-01 16:04:16 +01:00
dcorbacho 6220b454cb Avoid federation crashes for non-classic queue types 2021-02-01 16:02:28 +01:00
Michael Klishin 20984b9a07
Wording 2021-02-01 15:37:31 +03:00
Michal Kuratczyk ecd2d738c0
Check whether the file is readable
Since the validation fails with "or isn't readable", we should actually
check whether we can read the file. This way, when configuring TLS for
example, you get early feedback if the cert files are not readable.
2021-02-01 15:19:57 +03:00
Michael Klishin 589352c31a
Remove a leftover binding
The line that used it was removed in #2765
2021-02-01 15:05:07 +03:00
Michal Kuratczyk 7cc2c7889d
Remove a log line related to CMQ leader transfer
We've removed this functionality in c7b9c39352
so we shouldn't log that we would do that.
2021-01-28 20:55:11 +01:00
Michael Klishin ecd3df13f5
Merge pull request #2759 from rabbitmq/default-quorum-cluster-size
Use `quorum_cluster_size` as the default cluster size parameter from configuration
2021-01-28 15:48:44 +03:00
Michael Klishin 1a8975bb80
Be extra defensive when fetching initial quorum group size
if the value is not set by mistake, quorum queue will fail
to start.
2021-01-28 15:35:36 +03:00
Michael Klishin 93388d55bd
Correctly fetch 'rabbit.quorum_cluster_size' 2021-01-28 15:05:22 +03:00
dcorbacho dd986b17d9 Fix capture of `application:get_env` return value 2021-01-28 13:03:27 +01:00