Commit Graph

24667 Commits

Author SHA1 Message Date
Philip Kuryloski 88b091ae2e Fix shard_count for rabbit_stream_queue_SUTIE 2021-07-15 10:46:26 +02:00
dcorbacho e65ba8347c Fix delete_replica bug
It caused a lot of flakiness on the rabbit_stream_queue_SUITE, both on `delete_replica`
and `delete_last_replica` test cases.
2021-07-14 17:18:20 +02:00
dcorbacho 6052ecdc9c Split cluster_size_3_parallel in two groups
Faster to test locally the flaky tests and isolate them
2021-07-14 17:18:20 +02:00
dcorbacho 6610c3443d Include queue name on log message 2021-07-14 17:17:28 +02:00
dcorbacho e58ee79b4a Avoid double spawn on coordinator and link spawned processes
If phases are not linked, they can continue running *after* the coordinator has
been stopped. This could (or not) lead to unexpected behaviours,
but for sure it makes debugging harder.
2021-07-14 17:17:28 +02:00
dcorbacho 0103ab9723 Capture delete_stream errors and return them as protocol errors
Clients get the reason of the failure, instead of a generic internal error
2021-07-14 17:17:28 +02:00
dcorbacho 9e128b72b4 Set info/2 timeout to infinity to list connections
Default gen_server timeout is not enough to list busy connections.
Setting it to infinity allows the caller to decide the timeout,
as classic queues do. The `emit_info` function's family sets its
own timeout for all the cli commands.
2021-07-14 17:16:22 +02:00
Philip Kuryloski 8a339aae6c Fixup rabbitmq_federation:queue_SUITE for mixed version testing 2021-07-13 18:05:04 +02:00
Michael Klishin 29bb9c5b0c
Merge pull request #3175 from processone/proxy_protocol_tls_info
Extract TLS informations that are delivered in PROXY protocol frame
2021-07-13 15:08:40 +03:00
Philip Kuryloski 860333a088
Merge pull request #3177 from rabbitmq/stream-commit-offset-becomes-store-offset
Use "store" instead of "commit" for offset tracking
2021-07-13 12:11:37 +02:00
Philip Kuryloski ff619eea6a Mark per_vhost_connection_limit_SUITE as flaky 2021-07-12 22:21:02 +02:00
Philip Kuryloski 6edb1ea016 Use bazel-erlang 1.1.0 2021-07-12 19:06:20 +02:00
Philip Kuryloski 3102946d45 Use bazel-erlang 1.1.0 2021-07-12 19:05:14 +02:00
Michael Klishin 7de491fd82
Merge pull request #3187 from rabbitmq/less-chatty-mqtt
Change a log line from INFO to DEBUG
2021-07-12 19:07:29 +03:00
Philip Kuryloski 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +02:00
Michal Kuratczyk 41922b96cf
Change a log line from INFO to DEBUG
This line is printed on every new MQTT connection which leads to very chatty logs when there is a lot of connections. Given that the way MQTT uses vhosts is generally static (once set up, always the same for all connections), I think this can be a debug message instead.
2021-07-12 16:50:25 +02:00
Philip Kuryloski 05111b3653 Add an assertion that no deps/rabbit common test suites are missing
in bazel
2021-07-12 15:55:56 +02:00
Philip Kuryloski 71ae7e7d14
Merge pull request #3186 from rabbitmq/use-bazel-erlang-native-sharding
Use bazel erlang native sharding
2021-07-12 12:36:37 +02:00
Philip Kuryloski 3eac3cf8a8 Remove unused load statements from bazel files 2021-07-12 12:10:26 +02:00
Philip Kuryloski 923d87f847 Avoid using a duplicate group name in rabbitm_stream_queue_SUITE
Since bazel-erlang doesn't support this with sharding
2021-07-09 16:26:56 +02:00
Philip Kuryloski 8421100008 Use bazel-erlang semi-automatic suite sharding 2021-07-09 10:05:16 +02:00
tomyouyou f55a3e1b08
'start_ssl_listener/4' has wrong parameter orfer
The 'ConcurrentConnsSupsCount' should be the last paramter
2021-07-08 18:12:31 +08:00
Arnaud Cogoluègnes 8ddff0faf8
Use "store" instead of "commit" for offset tracking 2021-07-08 11:28:33 +02:00
Philip Kuryloski 19b8fa1409 Mark //deps/rabbitmq_stomp:python_SUITE as flaky 2021-07-08 11:22:15 +02:00
Arnaud Cogoluègnes 7cb2645283
Replace commit with store for offset persistence
In stream protocol. Commit have a strong consistency connotation,
which is not actually enforced by the offset persistence
mechanism.
2021-07-08 10:32:04 +02:00
Philip Kuryloski 2fc112e29c Correct some test cleanup in rabbit_mgmt_http_SUITE 2021-07-07 18:05:55 +02:00
Michael Klishin 00f647cf04
Channel tracking: reduce log verbosity
When a connection is closed, we should not log that all of its
channels are closed every single time.

Per discussion with @mkuratczyk
2021-07-06 18:54:49 +03:00
Arnaud Cogoluègnes 76c4c2792b
Merge pull request #3171 from rabbitmq/stream-add-uncompressed-length-to-sub-batch-format
Add uncompressed size in stream sub-entry
2021-07-06 14:45:45 +02:00
Michael Klishin 2ea732b7ef
Drop a couple of non-essential debug log messages
Note that we still have epmd recovery-related log messages.

Per discussion with @mkuratczyk.
2021-07-06 14:18:32 +03:00
Michael Klishin 1bdecdb2c4
Introduce a few new rabbit_policy listing functions 2021-07-06 05:38:51 +03:00
Arnaud Cogoluègnes f9867f1f82
Add uncompressed size field for pub ids generation 2021-07-05 16:22:21 +02:00
Karl Nilsson 284809e750
Merge pull request #3170 from rabbitmq/stream-flaky
Fix restart of stream coordinator when there are no stream queues
2021-07-05 15:03:45 +01:00
Philip Kuryloski da6da8d6c7 Clear memory alarms on all nodes in the memory_alarm_rolls_wal test
If the alarm is triggered directly with `rabbit_alarm` it has to be
cleared on all nodes
2021-07-05 15:57:56 +02:00
dcorbacho deaa42ecac Fix restart of stream coordinator when there are no stream queues
Recovering from an existing queue is fine but if a node is restarted when
there are no longer stream queues on the system, the recovery process won't
restart the pre-existing coordinator as that's only performed on queue recovery.
The first attempt to declare a new stream queue on this cluster will crash with
`coordinator unavailable` error, as it only restarts the local coordinator
and not the whole ra cluster, thus lacking quorum.

Recovering the coordinator during the boot process ensures that a pre-existing
coordinator cluster is restarted in any case, and does nothing if there was
never a coordinator on the node.
2021-07-05 15:34:05 +02:00
Philip Kuryloski dbb09f1bf5 Add ?awaitMatch/4 to rabbit_assert.hrl
?awaitMatch/4 is the same as ?awaitMatch/3, but where the polling
interval is configurable
2021-07-05 15:21:27 +02:00
Paweł Chmielowski d5daf7598b Extract TLS informations that are delivered in PROXY protocol frame 2021-07-05 13:29:59 +02:00
Michael Klishin 65ccf7ce42
Mirrored supervisor: make it easier to keep track of group membership changes
in the logs.

Referenes #3148.
2021-07-05 14:02:37 +03:00
Philip Kuryloski f8c09121c1 Revert "Add ?awaitMatch/4 to rabbit_assert.hrl"
This reverts commit 3bb9d0084d.
2021-07-05 11:46:51 +02:00
Philip Kuryloski 3bb9d0084d Add ?awaitMatch/4 to rabbit_assert.hrl
?awaitMatch/4 is the same as ?awaitMatch/3, but where the polling
interval is configurable
2021-07-05 11:40:42 +02:00
Philip Kuryloski 973a8c5189 Adjustments to hopefully make rabbitmq_federation suite less flaky
and print more informative errors in a failure case
2021-07-05 11:26:56 +02:00
Philip Kuryloski 390a00b828 Handle feature flag enablement failure more gracefully in test setup 2021-07-05 11:22:38 +02:00
Arnaud Cogoluègnes be9cc22dc1
Add uncompressed size in stream sub-entry 2021-07-02 16:19:47 +02:00
Michael Klishin 5f8f57dac6
Drop a few exclusive terms still present in man pages
References #3159
2021-07-02 14:12:43 +03:00
Michael Klishin 59942f89d6
Do not update virtual host tracing state when it's not necessary
Primarily to avoid refreshing state of all channels.

Per discussion with @ansd
2021-07-01 22:44:15 +03:00
Gerhard Lazu ef4303a486
Merge pull request #3157 from rabbitmq/stream-protocol-counters
Add specific stream protocol counters to track protocol errors
2021-07-01 17:56:14 +01:00
Arnaud Cogoluègnes f1f733445e
Check publisher still exists on osiris_written event 2021-07-01 10:47:58 +02:00
Michael Klishin c20cb568a1
Acquire locks before starting or restarting dynamic Shovels
When N cluster nodes are configured to import the same definition
file that includes Shovel declarations, there is a natural race
condition that can lead to Shovels being started on multiple
nodes under the same name.

See #3154 for the background.
2021-06-30 21:17:38 +03:00
Philip Kuryloski 07220e4e13 Fix handling of `broker_with_plugins` config "flag" under bazel
If unset, the flag actually has no effect, rather than assumed to be false
2021-06-30 16:20:11 +02:00
Michael Klishin a52a424578
Merge pull request #3163 from rabbitmq/mk-epmd-starter-loop-timeout
Make sure not to wait for epmd-starter subprocess forever
2021-06-30 16:06:38 +03:00
Michael Klishin 4f01d450e0
Make sure not to wait for epmd-starter subprocess forever
Per discussion in #3162
2021-06-30 15:20:09 +03:00
dcorbacho b636ad2565 Rename protocol error counters to _total 2021-06-30 12:46:41 +02:00
Philip Kuryloski 1b92fadd80 Skip additional quorum_queue_SUITE cases under mixed versions 2021-06-30 12:41:59 +02:00
Philip Kuryloski d086af8070 Reduce test case flakyness in quorum_queue_SUITE
for the clustered/cluster_size_3/confirm_availability_on_leader_change case
2021-06-30 10:05:23 +02:00
Philip Kuryloski ef9647671f Introduce dynamic wait in parts of the quorum_queue_SUITE
to help with test flakes
2021-06-29 18:32:53 +02:00
Philip Kuryloski e67575441a Use bazel-erlang 1.0.0 2021-06-29 17:16:25 +02:00
Philip Kuryloski 77073529a6 Use bazel-erlang 1.0.0 2021-06-29 16:49:53 +02:00
Philip Kuryloski a8ae32e2f7 Skip an additional quorum_queue_SUITE case in mixed versions 2021-06-29 16:43:19 +02:00
Philip Kuryloski 5c7f579ccd rabbitmq_stream_management bazel fix 2021-06-29 13:26:39 +02:00
Philip Kuryloski b807db3fd0 Update rabbitmq_stream deps in bazel
for changes occurring in 58e36b6417
2021-06-29 13:07:06 +02:00
dcorbacho 58e36b6417 Add specific stream protocol counters to track protocol errors 2021-06-29 12:50:00 +02:00
Michael Klishin cf147ebfe5
Merge branch 'master' into mk-stricter-stop-start-assertions-in-quorum-queue-suite 2021-06-29 12:49:31 +03:00
Michael Klishin a1ab7452ef
Improve assertions in a QQ suite test 2021-06-29 12:16:23 +03:00
Michael Klishin a3e98c2a7f
Merge pull request #3137 from rabbitmq/faster-binding-recovery
Faster implementation of rabbit_binding:recover/0
2021-06-29 12:09:27 +03:00
Philip Kuryloski 3cb8ff1ab9 Mixed version testing skip updates 2021-06-29 10:49:06 +02:00
Gerhard Lazu 3078d05ddc
Merge pull request #3136 from rabbitmq/global-gauges
Gauges for global publishers & consumers metrics
2021-06-29 09:20:59 +01:00
Philip Kuryloski 9c81acf524 Mark //deps/rabbit:vhost_SUITE as flaky 2021-06-29 09:59:37 +02:00
dcorbacho c9305d948a
Use number of publishing channels as global publishers in amqp091 2021-06-29 08:10:42 +01:00
dcorbacho 228ea40e34
Gauges for global publishers & consumers metrics 2021-06-29 08:10:42 +01:00
Michael Klishin 2867b0747b
Merge pull request #3156 from rabbitmq/rabbitmq-server-3155
Deduplicate parsed list of plugin directories
2021-06-28 22:04:22 +03:00
Michael Klishin bed64f2cc9
Reduce priority_queue_SUITE to single node tests
Other tests (that produce flakes) arguably test classic mirrored
queues, a deprecated feature reasonably well
covered in other suites.

Per discussion with @gerhard.
2021-06-28 21:59:16 +03:00
Jean-Sébastien Pédron 24c29733a9
rabbit_prelaunch_early_logging: Don't call dbg:tracer() if unused
Indeed, if there is no module to trace, don't initialize the debugger.
2021-06-28 18:32:57 +02:00
Michael Klishin 1d3d8623de
CLI tests: make mock plugin declare compatibility with 3.8 through 3.10 2021-06-28 18:39:40 +03:00
Michael Klishin 17a1f4fa3e
Deduplicate parsed plugin directory list in one more place
References #3155
2021-06-28 18:38:22 +03:00
Michael Klishin d0ad77f10d
Deduplicate parsed list of plugin directories
See #3155 for context. It is also possible that someone might
override the path with duplicate values.

Note that the list of directories will lose its original
ordering. That should be fine as we expect unique plugin
paths: it is not a "preference list" (ordering should
not matter).

Closes #3155
2021-06-28 17:45:13 +03:00
Michael Klishin 9a15d787ac
Merge pull request #3152 from rabbitmq/rabbitmq-server-3149
Canonicalize a few more paths in the startup banner
2021-06-28 16:30:02 +03:00
Michael Klishin 4e787a7f6b
Log locations are already canonicalized 2021-06-28 14:59:15 +03:00
Arnaud Cogoluègnes 8bc39d6e50
Merge pull request #3151 from rabbitmq/stream-reader-statem
Convert rabbit_stream_reader into state machine
2021-06-28 12:52:37 +02:00
Michael Klishin 62e7785a48
Canonicalize a few more paths in the startup banner
References #3149
2021-06-28 13:48:13 +03:00
Michael Klishin a19a0f924a
quorum_queue_SUITE: don't unconditionally skip node_removal_is_not_quorum_critical
Unintentionally introduced in a3c97d491f
2021-06-28 13:02:55 +03:00
David Ansari b145684b1b Remove useless ensure_stats_timer calls
Calling ensure_stats_timer after init_stats_timer and reset_stats_timer
is enough.

The idea is to call stop_stats_timer before hibernation and
ensure_stats_timer on wakeup. However, since we never call
stop_stats_timer in rabbit_stream_reader, we don't need to call
ensure_stats_timer on every network activity.
2021-06-28 11:27:45 +02:00
Philip Kuryloski 818818cdd6 Mark rabbitmq_stream_management suite not mixed version compatible
Since streams are 3.9 only we would not expect them to be used until
the cluster has been fully upgraded
2021-06-28 09:35:35 +02:00
Philip Kuryloski 8e88c6e967 Update flaky setting for rabbit_stream_queue_SUITE 2021-06-28 09:35:27 +02:00
David Ansari 896d879f8d Fix heartbeater exception exit
Before this commit test AlarmsTest.diskAlarmShouldNotPreventConsumption
of the Java client was failing.
When executing that test, the server failed with:

2021-06-25 16:11:02.886935+02:00 [error] <0.1301.0>     exception exit: {unexpected_message,resume}
2021-06-25 16:11:02.886935+02:00 [error] <0.1301.0>       in function  rabbit_heartbeat:heartbeater/3 (src/rabbit_heartbeat.erl, line 138

because the heartbeater was tried to be resumed without being paused
before.

Above exception exit also happens on master branch when executing this
test. However, the test falsely succeeds on master because the following FIXME was
never implemented:
8e569ad8bf/deps/rabbitmq_stream/src/rabbit_stream_reader.erl (L778)
2021-06-26 14:04:05 +02:00
David Ansari 8c4e2e009d Log at debug level when state machine terminates 2021-06-26 14:02:00 +02:00
Philip Kuryloski 8e569ad8bf Mark dynamic_ha_SUITE as flaky 2021-06-25 17:33:19 +02:00
David Ansari 81ee05f9ce Convert rabbit_stream_reader into state machine
This is pure refactoring - no functional change.

Benefits:
* code is more maintainable
* smaller methods (instead of previous 350 lines listen_loop_post_auth function)
* well defined state transitions (e.g. useful to enforce authentication protocol)
* we get some gen_statem helper functions for free (e.g. debug utilities)

Useful doc: https://ninenines.eu/docs/en/ranch/2.0/guide/protocols/
2021-06-25 15:07:34 +02:00
Philip Kuryloski 6a42a92839 Mark additonal suites flaky 2021-06-25 12:09:06 +02:00
David Ansari ff174eaa5f Add behaviour declaration for rabbit_stream_metrics_gc
since it implements a gen_server.
2021-06-25 11:57:14 +02:00
Philip Kuryloski a3c97d491f Update additional test skipping for 3.8/3.9 mixed versions 2021-06-25 11:17:46 +02:00
Philip Kuryloski f0941c806d Add is_mixed_versions/0
So that the check can be performed before run_setup_steps on a Config
2021-06-25 11:06:17 +02:00
Michael Klishin 9aa1389713
Startup banner wording: SSL => TLS 2021-06-25 01:58:29 +10:00
Gerhard Lazu 2853ec9286
Use emu_flavor in commercial startup log too
cc @dumbbell @mkuratczyk

Part of https://github.com/rabbitmq/rabbitmq-server/pull/2777

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-06-24 16:43:11 +01:00
Gerhard Lazu fa0364d37f
Merge pull request #2777 from rabbitmq/banner-with-otp-version
Add OTP version to the startup banner
2021-06-24 16:11:16 +01:00
Michael Klishin 07740be9d3
Merge branch 'SzumiecM-master' 2021-06-24 23:31:43 +10:00
Michael Klishin 471294af67
AuthN/Z backend HTTP: rename two new settings, add tests 2021-06-24 23:26:13 +10:00
Philip Kuryloski 1c5cd716e5 Mark //deps/rabbit:rabbitmqctl_integration_SUITE as flaky 2021-06-24 15:18:27 +02:00
Philip Kuryloski cbdd80830c Mark //deps/rabbit:dynamic_qq_SUITE as flaky 2021-06-24 14:55:43 +02:00
Philip Kuryloski a145c35aaa
Marking of flaky tests 2021-06-24 21:59:10 +10:00
Philip Kuryloski 7112a1e7ab
Mark deps/rabbitmq_stream:commands_SUITE as flaky 2021-06-24 21:59:10 +10:00
Philip Kuryloski a798b51739
Fixup deps/rabbitmq_management/BUILD.bazel
"True" -> True
2021-06-24 21:59:10 +10:00
Philip Kuryloski 6f49ac1170
Additional flaky test adjustments in bazel 2021-06-24 21:59:10 +10:00
Philip Kuryloski 5aa2c1587e
Revert "Default all `rabbitmq_integration_suite` to flaky in bazel"
This reverts commit 70cb8147b2.
2021-06-24 21:59:09 +10:00
Philip Kuryloski 9488dcf275
Additional skipping of unsupported tests in mixed version clusters
Also consolidate the mixed version check on
rabbit_ct_helpers:is_mixed_versions/1 as much as possible
2021-06-24 21:59:09 +10:00
Michal Kuratczyk 52bd0d0adf
Print Erlang and SSL library on boot, right under the logo
This is purely for information purposes. We have often seen users
copy-paste console output when reporting issues, and they miss the most
important information: Erlang & SSL library versions. After this change,
we are less likely to have ask about the Erlang & SSL library versions
via follow-up questions.

emu_flavor was introduced in Erlang 24. Erlang 23 has not JIT so we can
always return "emu".

FWIW, we discourage putting new code in rabbitmq_common as this is meant
to be shared between the broker and the client. Also, keeping the
function definitions close to where they are called is a good general
practice.

We discussed the benefits of having the OS line with @dumbbell &
@gerhard and concluded that it's not worth the effort.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-06-24 12:53:30 +01:00
Philip Kuryloski ee5c16e866 Marking of flaky tests 2021-06-24 13:45:23 +02:00
Philip Kuryloski bb75157fc1 Mark deps/rabbitmq_stream:commands_SUITE as flaky 2021-06-24 12:56:20 +02:00
SzumiecM bfe648e92d Add configurable timeout to HTTP connections 2021-06-24 02:02:54 -07:00
Philip Kuryloski 4a830a4709 Fixup deps/rabbitmq_management/BUILD.bazel
"True" -> True
2021-06-24 10:53:19 +02:00
Philip Kuryloski c234a5f37d Additional flaky test adjustments in bazel 2021-06-24 10:46:29 +02:00
Philip Kuryloski 4c4e2926ea Avoid using mixed cluster args for node start in normal tests
Enhances b56cc4d0fb
2021-06-24 10:28:30 +02:00
Philip Kuryloski 8c7e7e0656 Revert "Default all `rabbitmq_integration_suite` to flaky in bazel"
This reverts commit 70cb8147b2.
2021-06-23 20:53:14 +02:00
Philip Kuryloski dca208abce Additional skipping of unsupported tests in mixed version clusters
Also consolidate the mixed version check on
rabbit_ct_helpers:is_mixed_versions/1 as much as possible
2021-06-23 14:27:41 +02:00
Philip Kuryloski b56cc4d0fb Activate plugins correctly in bazel mixed version cluster tests
Bazel mixed version nodes are prebuilt with all plugins, so they need
an alternate mechanism than gnu make for selecting which plugins to enable
2021-06-23 12:17:48 +02:00
Gerhard Lazu fae836f1c6
Remove rabbitmq_stream_prometheus plugin
All these metrics, except publishers & consumers, are handled by
rabbitmq_global_metrics, so we currently have duplicates. As I started
removing these, I realised that tests were written in Java - why not
Erlang? - and they seemed way too complicated for what was needed. After
the new rabbitmq_global_metrics, we are left with 2 metrics, and all the
extra code simply doesn't justify them. I am proposing that we add them to
rabbit_global_counters as gauges. Let's discuss @dcorbacho @acogoluegnes

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-06-22 14:14:26 +01:00
Gerhard Lazu c7971252cd
Global counters per protocol + protocol AND queue_type
This way we can show how many messages were received via a certain
protocol (stream is the second real protocol besides the default amqp091
one), as well as by queue type, which is something that many asked for a
really long time.

The most important aspect is that we can also see them by protocol AND
queue_type, which becomes very important for Streams, which have
different rules from regular queues (e.g. for example, consuming
messages is non-destructive, and deep queue backlogs - think billions of
messages - are normal). Alerting and consumer scaling due to deep
backlogs will now work correctly, as we can distinguish between regular
queues & streams.

This has gone through a few cycles, with @mkuratczyk & @dcorbacho
covering most of the ground. @dcorbacho had most of this in
https://github.com/rabbitmq/rabbitmq-server/pull/3045, but the main
branch went through a few changes in the meantime. Rather than resolving
all the conflicts, and then making the necessary changes, we (@gerhard +
@kjnilsson) took all learnings and started re-applying a lot of the
existing code from #3045. We are confident in this approach and would
like to see it through. We continued working on this with @dumbbell, and
the most important changes are captured in
https://github.com/rabbitmq/seshat/pull/1.

We expose these global counters in rabbitmq_prometheus via a new
collector. We don't want to keep modifying the existing collector, which
grew really complex in parts, especially since we introduced
aggregation, but start with a new namespace, `rabbitmq_global_`, and
continue building on top of it. The idea is to build in parallel, and
slowly transition to the new metrics, because semantically the changes
are too big since streams, and we have been discussing protocol-specific
metrics with @kjnilsson, which makes me think that this approach is
least disruptive and... simple.

While at this, we removed redundant empty return value handling in the
channel. The function called no longer returns this.

Also removed all DONE / TODO & other comments - we'll handle them when
the time comes, no need to leave TODO reminders.

Pairs @kjnilsson @dcorbacho @dumbbell
(this is multiple commits squashed into one)

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-06-22 14:14:21 +01:00
Michal Kuratczyk 46f6d81ad0 Faster implementation of rabbit_binding:recover/0
For a large number of bindings, this implementation reduces the recovery
time from minutes to seconds. rabbit_binding:recover/2 is the second
operation that may take minutes but it can be improved separately.
2021-06-22 15:01:42 +02:00
Philip Kuryloski 2d06a67921 Fix test for rabbitmq-ct-helpers change
rabbit_ct_broker_helpers:rpc now raised an exception if the remote
call fails. This matches the assertion with the new behavior
2021-06-22 11:12:17 +02:00
Philip Kuryloski 88134b416e Follow up changes for the rpc:call -> erpc:call change
Some tests would make rpc calls, ignoring the result. Since erpc
throws errors, this broke some tests. This commit restores the
non-throw behavior to add_vhost, delete_vhost, add_user,
set_user_tags, delete_user & clear_permissions.
2021-06-22 11:06:27 +02:00
Philip Kuryloski 67e9f02075 Use `erpc:call/{4,5}` in `rabbit_ct_broker_helpers:rpc/{4,5}`
erpc was introduced in Erlang 23, and importantly now provides much
more information when a call fails, like the stacktrace
2021-06-21 17:17:42 +02:00
Philip Kuryloski 70cb8147b2 Default all `rabbitmq_integration_suite` to flaky in bazel
Most tests that can start rabbitmq nodes have some chance of
flaking. Rather than chase individual flakes for now, this commit
changes the default (though it can still be overriden, as is the case
for config_scheme_SUITE in many places, since I have yet to see that
particular suite flake).
2021-06-21 16:10:38 +02:00
Philip Kuryloski d8c4c0a887 Adjustments for the way @bazel-erlang shards tests 2021-06-21 13:13:21 +02:00
Philip Kuryloski 39c1957617 Mark clustering_management_SUITE as flaky in bazel 2021-06-21 12:15:42 +02:00
Philip Kuryloski c01019c628 Mark additional suites as flaky in bazel 2021-06-21 12:03:14 +02:00
Philip Kuryloski 55b3b6a370 Mark //deps/rabbitmq_mqtt:java_SUITE as flaky in bazel 2021-06-21 11:16:45 +02:00
Philip Kuryloski 7f2565cf18 Correct //deps/rabbitmq_peer_discovery_etcd:system_SUITE setup
Adjust to more strict setup checks in rabbitmq-ct-helpers
2021-06-21 09:51:51 +02:00
Michael Klishin 0e6298d1ae
Explain
(cherry picked from commit 2387022e8c)
2021-06-21 14:43:54 +08:00
Michael Klishin 6550cd1752
Reduce flakiness in rabbitmq_queues_cli_integration_SUITE
In case removed node hosts a leader, it takes a moment for
the QQ to elect a new one and begin accepting cluster
membership change operations again.

(cherry picked from commit a9d8816c6a)
2021-06-21 14:41:10 +08:00
Michael Klishin 8ec3b08462
More man page massaging 2021-06-19 19:27:53 +08:00
Patrik Ragnarsson f191414dbc Escape the consumer-tag value in federation mgmt
Patches persistent XSS.
2021-06-19 09:25:11 +02:00
Philip Kuryloski 40a7a1c24c Bring rabbit:logger_SUITE online in bazel and bump mismatched deps 2021-06-18 14:41:14 +02:00
Philip Kuryloski f5719cd45f Updates for mixed version testing with bazel 2021-06-18 13:01:11 +02:00
Michael Klishin 0b716aee3b
Minor man page updates post rabbitmq/rabbitmq-website#1209 2021-06-18 08:47:13 +08:00
Michael Klishin 9666ffa67e
Merge pull request #3117 from tropikhajma/master
fix hostname(1) calls on Solaris
2021-06-17 23:13:13 +08:00
Philip Kuryloski cff7516317 Skip some tests that are not mixed version compatible
Mark per_user_connection_channel_tracking_SUITE:cluster_size_2_network
as not mixed version compatible.

In a mixed 3.8/3.9 cluster, changes to rabbit_core_ff.erl imply that
some feature flag related migrations cannot occur, and therefore
user_limits cannot be enabled as required by the test
2021-06-17 15:36:22 +02:00
Philip Kuryloski eea51a7e3a Mark additional suites as flaky 2021-06-17 13:42:22 +02:00
Pavel Heimlich 020b22f9ea fix hostname(1) calls on Solaris 2021-06-17 13:23:05 +02:00
Karl Nilsson 8a4f4c6d45 Ignore dynamic_qq test that isn't mixed version compatible
quorum_unaffected_after_vhost_failure isn't mixed versions compatible as
it tries to declare a queue in a mixed cluster from a node running RA 1.x where all other
nodes are running Ra 2.0.
2021-06-17 11:52:34 +01:00
Karl Nilsson d8ac46d745 Mark quorum queue test as non-mixed-version compatible
simple_confirm_availability_on_leader_change can't be made forwards compatible
as when running in mixed mode the queue declaration happens on an old node in
a cluster of mostly new nodes. As new nodes run Ra 2.0 and Ra 1.x does not know
how to create members on Ra 2.0 nodes this test fails. This is an acceptable limitation
for a transient mixed versions cluster.
2021-06-17 10:48:20 +01:00
Michael Klishin 40b7e001b4
Queue args won't be set for all suites, be more defensive 2021-06-16 23:39:02 +08:00
Michael Klishin 62e24460b3
Avoid conflicting queue declarations from tests
this is important now that different federation sides
use queues of different types in the mixed group.
2021-06-16 22:32:44 +08:00
Michael Klishin 57ef42f732
Compile 2021-06-16 21:07:38 +08:00
dcorbacho 77e253e7c7 Support mixed queue type federation links 2021-06-16 13:49:16 +02:00
Karl Nilsson c9026daecc test case 2021-06-16 13:49:16 +02:00
Philip Kuryloski 7e17a47557 Update rabbitmq_cli mock test plugin for 3.10.x 2021-06-15 11:29:57 +02:00
Arnaud Cogoluègnes 1ee34a4cb4
Merge pull request #3101 from rabbitmq/stream-common-library
Stream common library
2021-06-15 10:28:20 +02:00
Michael Klishin 0572156d74
Update a rabbitmqctl(8) example
As suggested in rabbitmq/rabbitmq-website#1209 by @jaisea
2021-06-15 14:52:18 +08:00
Michael Klishin c67e7e9f09
Merge pull request #3021 from rabbitmq/fix-double-registration-management-ipv4v6
Only register the first web-dispatch listener
2021-06-14 23:12:10 +08:00
dcorbacho 7e5163690d Remove dependency from rabbit_common 2021-06-14 15:47:03 +02:00
Philip Kuryloski a3bffb4d18 Fixup bazel compilation for rabbitmq_stream_common 2021-06-14 10:07:49 +02:00
Michael Klishin 159e71111e
When policy changes, emit internal events for individual objects
so that observers do not have to do matching over again.

This also helps with observability.
2021-06-14 14:22:54 +08:00
Michael Klishin 58b33029bc
rabbit_policy: naming 2021-06-13 16:50:59 +08:00
Michael Klishin 2826225cde
Drive-by change: speed up two tests in rabbit_mgmt_rabbitmqadmin_SUITE
This makes sure rabbitmqadmin suite doesn't spend minutes resolving
a non-existent hostname in environments with certain DNS client
settings.
2021-06-13 12:32:03 +08:00
Michael Klishin 4126807e71 rabbit_mgmt_test_util: modernize for recent JSX versions 2021-06-12 08:10:36 +08:00
Michael Klishin 300196ea4e
Second attempt at upgrading JSX to 3.1 2021-06-12 08:03:18 +08:00
dcorbacho 38f474688f Stream common library 2021-06-11 17:24:00 +02:00
Michael Klishin 8c03f51972
Revert "Merge pull request #3090 from johanrhodin/patch-1"
This reverts commit 0f94046b37, reversing
changes made to 37f5744833.

The value would be rejected by rabbitmq.conf schema validation.
It can be set to `undefined` via `rabbit.consumer_timeout` in
`advanced.config`.
2021-06-11 03:58:52 +03:00
Michael Klishin 0d84dc1e48
Merge pull request #3098 from rabbitmq/unexpected-socket-input
Close stream socket if client doesn't follow authentication protocol
2021-06-11 03:25:45 +03:00
David Ansari 1cca0f1e4c Categorize connection log messages 2021-06-10 19:50:48 +02:00
Loïc Hoguin 1e0ac8efc9
Fix recovery when terms are accidentally empty
This is a fix for an issue that occurs when shutting down
a node (via SIGTERM) while the queues and more specifically
the queue index is recovering. When that happens
rabbit_recovery_terms has already started, and when
it starts it calls dets:open_file/2 which creates an
empty recovery.dets file. After the node is down and
restarted again, the node thinks the shutdown was clean
because the recovery file is there, except it is empty
and therefore the queues have lost all their state.

This results in RabbitMQ thinking there are 0 messages
in all classic queues.

To avoid this issue, we consider a shutdown to be dirty
in the case where we have a recovery file BUT we do not
find our state in the recovery terms.

To reliably reproduce the issue this fixes:

* Start a node

* Fill it with many messages (800k is more than enough)

* Wait a little and then kill the node via Ctrl+C twice
  (to force dirty recovery next start)

* Start the node again

* While it says "Starting broker", after waiting
  about 5 seconds, send a SIGTERM (killall beam.smp)
  to shutdown the node "cleanly"

* Start the node again

* Management will show 0 messages in all classic queues
2021-06-10 17:11:08 +02:00
David Ansari fcc8dbeab6 Close client connections that don't follow authentication protocol
Before this commit sending garbarge data to the server stream port
caused the RabbitMQ node to eat more and more memory.

In this commit, we fix it by expecting the client to go through the
proper authentication sequence. Otherwise, the server closes the socket.

Co-authored-by: Michal Kuratczyk <mkuratczyk@pivotal.io>
2021-06-10 15:44:51 +02:00
Arnaud Cogoluègnes dcd65572a0
Remove correlation ID from commit_offset
In stream protocol. commit_offset is asynchronous and does
not expect a response, so the correlation ID is not required.
2021-06-10 15:21:38 +02:00
Michael Klishin 604fbfac3a
Depend on erlang-jose ref with fix for potatosalad/erlang-jose#113 2021-06-10 15:49:39 +03:00
Michael Klishin ab795c1232
OAuth 2 system_SUITE: squash some erlc warnings 2021-06-10 15:48:33 +03:00
Johan Rhodin ec23d34b48
Update rabbitmq.conf.example 2021-06-09 14:55:42 -05:00
Philip Kuryloski 37f5744833 Add rabbitmq_auth_backend_oauth2 system_SUITE to bazel 2021-06-09 17:43:20 +02:00
Michael Klishin 15a26d206f
Merge pull request #3086 from tomyouyou/queue-delete-qpid-exit
"handle_method(#'queue.delete'{},_)" can not process the case "{error,{exit, _, _}}"
2021-06-08 20:03:42 +03:00
Arnaud Cogoluègnes b77fb27af3
Merge pull request #3083 from rabbitmq/raw-reader
Raw reader option
2021-06-08 17:48:20 +02:00
dcorbacho 935f57b608 Chunk selector option in offset reader 2021-06-08 15:17:22 +02:00
Michal Kuratczyk 437d8aa8c5 Don't run policy tests in parallel
Now that a policy overwrites queue arguments, running policy tests in
parallel with other tests leads to non-deterministic test results with
some tests randomly failing.
2021-06-07 16:46:14 +02:00
Michal Kuratczyk c04d214375 Policy values take precedence over stream args
We've decided that policy values such as max-length-bytes and max-age
should take precedence over arguments provided during stream
declaration. Previously the lower of the values was used which meant
that a stream retention period could not be extended beyond the initial
definition. Since streams are long lived, retention requirements can
change as the system evolve and since they contain data, deleting them
and redeclaring with different arguments not feasible. With this change,
retention can always be adjusted through a policy.
2021-06-07 14:08:00 +02:00
Michal Kuratczyk f967929640 Remove redundant policy setting
The policy is now set in rabbit_queue_type
2021-06-07 12:47:33 +02:00
Michal Kuratczyk 7407a5a100 Apply policy in rabbit_queue_type 2021-06-07 12:30:33 +02:00
tomyouyou 8a0d797a3b
"handle_method(#'queue.delete'{},_)" can not process the case "{error,{exit, _, _}}"
In my test of "queue.delete", this has happened:

2021-06-05 16:31:26.281 [error] <0.9903.21> ** Generic server <0.9903.21> terminating
** Last message in was {'$gen_cast',{method,{'queue.delete',0,<<"nbm_alive_c0fb2eb6-c822-4641-adda-0ea9c2c02fef">>,false,false,false},none,noflow,false}}
** When Server state == {ch,{conf,running,rabbit_framing_amqp_0_9_1,1,<0.9893.21>,<0.9902.21>,<0.9893.21>,<<"174.11.10.28:48839 -> 174.11.10.23:5674">>,undefined,{user,<<"guest">>,[administrator],[{rabbit_auth_backend_internal,none}]},<<"/">>,<<"nbm_alive_c0fb2eb6-c822-4641-adda-0ea9c2c02fef">>,<0.9897.21>,[{<<"authentication_failure_close">>,bool,true},{<<"basic.nack">>,bool,true},{<<"connection.blocked">>,bool,true},{<<"consumer_cancel_notify">>,bool,true},{<<"publisher_confirms">>,bool,true}],none,0,134217728,undefined,#{},1000000000},{lstate,undefined,false,#Fun<rabbit_channel.8.31076537>},none,1,{0,{[],[]}},#{},{state,#{},erlang},#{},#{},{set,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},{state,none,30000,undefined},false,1,{unconfirmed,{0,nil},#{},#{}},[],[],none,flow,[],#{},#Ref<0.2883551392.790364161.215222>,false,false,undefined,undefined,{erlang,#Ref<0.2883551392.790364161.214783>},{{174,11,10,28},48839,"174.11.10.28:48839 -> 174.11.10.23:5674","none"},#{},#{}}


** Reason for termination ==
** {{case_clause,{error,{exit,{normal,{gen_server2,call,[<0.10232.21>,{delete,false,false,<<"guest">>},infinity]}},[{gen_server2,call,3,[{file,"src/gen_server2.erl"},{line,346}]},{delegate,safe_invoke,2,[{file,"src/delegate.erl"},{line,274}]},{delegate,invoke,2,[{file,"src/delegate.erl"},{line,92}]},{rabbit_misc,with_exit_handler,2,[{file,"src/rabbit_misc.erl"},{line,602}]},{rabbit_channel,handle_method,6,[{file,"src/rabbit_channel.erl"},{line,3082}]},{rabbit_channel,handle_method,3,[{file,"src/rabbit_channel.erl"},{line,2021}]},{rabbit_channel,handle_cast,2,[{file,"src/rabbit_channel.erl"},{line,823}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1067}]}]}}},[{rabbit_channel,handle_method,6,[{file,"src/rabbit_channel.erl"},{line,3082}]},{rabbit_channel,handle_method,3,[{file,"src/rabbit_channel.erl"},{line,2021}]},{rabbit_channel,handle_cast,2,[{file,"src/rabbit_channel.erl"},{line,823}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1067}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}
2021-06-05 16:31:26.281 [error] <0.9893.21> Error on AMQP connection <0.9893.21> (174.11.10.28:48839 -> 174.11.10.23:5674, vhost: '/', user: 'guest', state: running), channel 1:
 {{case_clause,
     {error,
         {exit,
             {normal,
                 {gen_server2,call,
                     [<0.10232.21>,
                      {delete,false,false,<<"guest">>},
                      infinity]}},
             [{gen_server2,call,3,[{file,"src/gen_server2.erl"},{line,346}]},
              {delegate,safe_invoke,2,[{file,"src/delegate.erl"},{line,274}]},
              {delegate,invoke,2,[{file,"src/delegate.erl"},{line,92}]},
              {rabbit_misc,with_exit_handler,2,
                  [{file,"src/rabbit_misc.erl"},{line,602}]},
              {rabbit_channel,handle_method,6,
[{rabbit_channel,handle_method,6,
      [{file,"src/rabbit_channel.erl"},{line,3082}]},
  {rabbit_channel,handle_method,3,
      [{file,"src/rabbit_channel.erl"},{line,2021}]},
  {rabbit_channel,handle_cast,2,[{file,"src/rabbit_channel.erl"},{line,823}]},
  {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1067}]},
  {proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}
2021-06-07 18:24:12 +08:00
Michael Klishin ed0ba6a2f2
Merge pull request #3075 from rabbitmq/remove-randomized-startup-delays
Remove randomized startup delays
2021-06-05 15:47:01 +03:00
Arnaud Cogoluègnes 49a70a0f9f
Handle last_stream_member more gently in CLI 2021-06-04 16:35:46 +02:00
Michael Klishin 16455426f0
Merge pull request #3085 from luos/improve-federation-performance
Improve performance of federation
2021-06-04 15:43:25 +03:00
Lajos Gerecs f17a97082c Improve performance of federation
When a federated message is processed, certain headers are added,
cluster_name is called for every message.
This every single time creates an UDP port and queries into the
inet_drv to get the hostname.
Now we first try to look it up in the database instead of
calculating a default which will not be needed.
2021-06-04 13:23:53 +02:00
Arnaud Cogoluègnes 7d5c8f402a
Merge pull request #3071 from rabbitmq/subscribe-props
Fix properties binary construction
2021-06-03 18:09:52 +02:00
Philip Kuryloski 1ed7da1988 Mark rabbitmq_amqp1_0 system_SUITE flaky in bazel 2021-06-03 15:01:47 +02:00
Philip Kuryloski 453e1cb386 Revert "Attempt to make rabbitmq_amqp1_0 tests less flaky"
This reverts commit 67e5b54908.
2021-06-03 14:59:22 +02:00
Philip Kuryloski 67e5b54908 Attempt to make rabbitmq_amqp1_0 tests less flaky 2021-06-03 12:37:05 +02:00
David Ansari 0876746d5f Remove randomized startup delays
On initial cluster formation, only one node in a multi node cluster
should initialize the Mnesia database schema (i.e. form the cluster).
To ensure that for nodes starting up in parallel,
RabbitMQ peer discovery backends have used
either locks or randomized startup delays.

Locks work great: When a node holds the lock, it either starts a new
blank node (if there is no other node in the cluster), or it joins
an existing node. This makes it impossible to have two nodes forming
the cluster at the same time.
Consul and etcd peer discovery backends use locks. The lock is acquired
in the consul and etcd infrastructure, respectively.

For other peer discovery backends (classic, DNS, AWS), randomized
startup delays were used. They work good enough in most cases.
However, in https://github.com/rabbitmq/cluster-operator/issues/662 we
observed that in 1% - 10% of the cases (the more nodes or the
smaller the randomized startup delay range, the higher the chances), two
nodes decide to form the cluster. That's bad since it will end up in a
single Erlang cluster, but in two RabbitMQ clusters. Even worse, no
obvious alert got triggered or error message logged.

To solve this issue, one could increase the randomized startup delay
range from e.g. 0m - 1m to 0m - 3m. However, this makes initial cluster
formation very slow since it will take up to 3 minutes until
every node is ready. In rare cases, we still end up with two nodes
forming the cluster.

Another way to solve the problem is to name a dedicated node to be the
seed node (forming the cluster). This was explored in
https://github.com/rabbitmq/cluster-operator/pull/689 and works well.
Two minor downsides to this approach are: 1. If the seed node never
becomes available, the whole cluster won't be formed (which is okay),
and 2. it doesn't integrate with existing dynamic peer discovery backends
(e.g. K8s, AWS) since nodes are not yet known at deploy time.

In this commit, we take a better approach: We remove randomized startup
delays altogether. We replace them with locks. However, instead of
implementing our own lock implementation in an external system (e.g. in K8s),
we re-use Erlang's locking mechanism global:set_lock/3.

global:set_lock/3 has some convenient properties:
1. It accepts a list of nodes to set the lock on.
2. The nodes in that list connect to each other (i.e. create an Erlang
cluster).
3. The method is synchronous with a timeout (number of retries). It
blocks until the lock becomes available.
4. If a process that holds a lock dies, or the node goes down, the lock
held by the process is deleted.

The list of nodes passed to global:set_lock/3 corresponds to the nodes
the peer discovery backend discovers (lists).

Two special cases worth mentioning:

1. That list can be all desired nodes in the cluster
(e.g. in classic peer discovery where nodes are known at
deploy time) while only a subset of nodes is available.
In that case, global:set_lock/3 still sets the lock not
blocking until all nodes can be connected to. This is good since
nodes might start sequentially (non-parallel).

2. In dynamic peer discovery backends (e.g. K8s, AWS), this
list can be just a subset of desired nodes since nodes might not startup
in parallel. That's also not a problem as long as the following
requirement is met: "The peer disovery backend does not list two disjoint
sets of nodes (on different nodes) at the same time."
For example, in a 2-node cluster, the peer discovery backend must not
list only node 1 on node 1 and only node 2 on node 2.

Existing peer discovery backends fullfil that requirement because the
resource the nodes are discovered from is global.
For example, in K8s, once node 1 is part of the Endpoints object, it
will be returned on both node 1 and node 2.
Likewise, in AWS, once node 1 started, the described list of instances
with a specific tag will include node 1 when the AWS peer discovery backend
runs on node 1 or node 2.

Removing randomized startup delays also makes cluster formation
considerably faster (up to 1 minute faster if that was the
upper bound in the range).
2021-06-03 08:01:28 +02:00
Philip Kuryloski ad8c6f8f64 Allow `bazel run rabbitmq-diagnostics` 2021-06-02 17:23:48 +02:00
Michael Klishin eb96ac9b69
Emit consumer creation events for all consumers
when force refreshing events. We do that when consumers are registered
online. Inactive consumers in case of SAC queues are still present
and their presence should be broadcast as an internal event.

This also simplifies the code updated for #3072.

Per discussion with @pjk25.
2021-06-02 15:32:58 +03:00
Michael Klishin 8f234dd8a8
Be more defensive when emitting consumer events for a queue with SAC
A queue that had a SAC but currently has none (e.g. because client
connection failed) should not fail with a badmatch.

Clearing the holder field will be investigated separately.

Closes #3072
2021-06-02 13:27:31 +03:00
Loïc Hoguin d948097106
Add missing link in Web-MQTT example 2021-06-02 11:06:07 +02:00
Loïc Hoguin e20c62486b
Make Web-MQTT obtain/release a FD via file_handle_cache
Makes it behave just like Web-STOMP.
2021-06-02 11:05:32 +02:00
Philip Kuryloski 2a217f0e61 mark rabbitmq_trust_store:system_SUITE as flaky for both groups 2021-06-01 17:16:05 +02:00
Philip Kuryloski c3c9b3fc50 Merge branch 'bazel-dialyze' 2021-06-01 10:31:29 +02:00
Philip Kuryloski 30f9a95b9f Add dialyze for remaning tier-1 plugins 2021-06-01 10:19:10 +02:00
Arnaud Cogoluègnes 761af0a7a0
Extract publishing IDs from batch publishing
In stream plugin, to e.g. send publish errors in case the stream
does not exist. Batches were not taken into account.
2021-05-31 15:35:10 +02:00
Philip Kuryloski e5d477dc66 Add dialyze for rabbitmq_amqp1_0 2021-05-31 10:17:49 +02:00
Philip Kuryloski 3899b316da Add dialyze for amqp10_common 2021-05-31 10:08:59 +02:00
Philip Kuryloski f6c3ccc42f Add dialyze for amqp10_client 2021-05-31 10:06:54 +02:00
Philip Kuryloski 0ed5f325b4 Add dialyze for amqp_client 2021-05-31 10:05:03 +02:00
dcorbacho 65c9dae53f Fix properties binary construction 2021-05-28 15:45:19 +02:00
Philip Kuryloski f9d114ad75 dialyze rabbit 2021-05-28 13:27:21 +02:00
Philip Kuryloski fe2e2cfe78 Use dialyzer on rabbit_common
Only dialyze errors will cause a build failure, similar to Erlang.mk
2021-05-28 13:03:55 +02:00
Michael Klishin e91c9185aa
Merge pull request #3068 from rabbitmq/mk-segment-entry-count-fallback-during-3.6-upgrade
Handle cases where virtual host config file does not yet exist
2021-05-27 17:41:22 +03:00
Michael Klishin 6acee761e0
Handle cases where virtual host config file does not yet exist
This happens during queue migration from a pre-3.7 version.

References #2954.
2021-05-27 17:38:53 +03:00
Karl Nilsson f36751aa6d make rabbit_stream_SUITE more reliable
By having rabbit_stream_core cache it's incoming command internally.
2021-05-27 13:15:55 +01:00
Philip Kuryloski f251815002 Replace rabbitmq_stream test helper with common version
from rabbitmq_ct_helpers

and update default app env for bazel, to match Makefile
2021-05-27 12:26:51 +02:00
Arnaud Cogoluègnes e471d802c8
Render TLS info for stream connections in management UI 2021-05-27 11:15:30 +02:00
Arnaud Cogoluègnes 2ab5cb22ca
Expose TLS info for stream connections (CLI, REST API) 2021-05-27 10:43:33 +02:00
Michael Klishin 12253d2fb4
Merge pull request #2954 from rabbitmq/new-segment-entry-count-default
Set segment_entry_count per vhost and use a better default
2021-05-27 01:56:02 +03:00
Michael Klishin 7f0d9fa1e7
{consistent_hash,recent_history}_exchange plugins: add retries to schema sync
So, do what RabbitMQ core does as of 3.6.7 or so.

This makes it possible for nodes with those plugins enabled to be
restarted in arbitrary order within a certain time window, just
like nodes without those plugins.
2021-05-26 20:49:14 +03:00
Karl Nilsson 9bcd51c2a5 Correct help text for rabbitmq-queue grow command 2021-05-26 14:20:04 +01:00
Arnaud Cogoluègnes 5a6dbef372
Return TLS port in stream connection properties 2021-05-26 12:30:54 +02:00
Arnaud Cogoluègnes 69ad6969e6
Add stream.advertised_tls_port setting 2021-05-26 11:08:43 +02:00
Philip Kuryloski 1af7d7e6c2 Mark //deps/rabbitmq_federation:queue_SUITE as flaky in bazel 2021-05-25 17:00:50 +02:00
Arnaud Cogoluègnes 35ef1e5ade
Merge pull request #3038 from rabbitmq/stream-tls
TLS support for streams
2021-05-25 15:39:40 +02:00
dcorbacho 05bd6dd838 Test multiple chunks 2021-05-25 14:25:38 +02:00
Philip Kuryloski a6f70b8dda Add xref for remaining tier-1 plugins 2021-05-25 11:39:03 +02:00
Philip Kuryloski e02132ee0f Fix rabbitmq-components.mk path when publishing to hex pm 2021-05-25 10:29:51 +02:00
Arnaud Cogoluègnes b7a2e9a792
Fix comment 2021-05-25 09:53:04 +02:00
Karl Nilsson 4a9d8115f8 rebase fixes
post rebase test fixes

Make socket initialisation more lenient

correct return types

fix

remove commented code
2021-05-24 15:53:10 +01:00
Karl Nilsson 4112cc6f77 Clarify x-max-age options in management ui 2021-05-24 14:31:32 +01:00
Philip Kuryloski a3dbdecb8c Mark //deps/rabbitmq_prometheus:rabbit_prometheus_http_SUITE flaky 2021-05-21 18:32:20 +02:00
dcorbacho 3fefa8e8d4 Use ssl option when initialising data reader 2021-05-21 17:13:15 +01:00
dcorbacho 8f54150867 Add stream TLS test 2021-05-21 17:10:55 +01:00
dcorbacho b2a7884a45 TLS support for streams 2021-05-21 16:40:57 +01:00
Karl Nilsson 03063f2eed
Merge pull request #3043 from rabbitmq/streams-consumer-lag-metrics
Add consumer offset_lag to rabbitmq-stream CLI command & Management
2021-05-21 16:38:50 +01:00
Karl Nilsson 1ea7bf5519 quorum_queue_SUITE restructure tests
Run more tests with 3 node cluster and have only one group definition
for cluster_size_2
2021-05-21 15:13:18 +01:00
Arnaud Cogoluègnes 478588bcce
Merge pull request #3060 from rabbitmq/stream-advertised-host-port-in-open
Send advertised host and port in open
2021-05-21 14:26:38 +02:00
Gerhard Lazu 080b0771cf
Fix test_gc_consumers test
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-05-21 13:02:48 +01:00
Gerhard Lazu f8b4e1e298
Add consumer offset_lag to rabbitmq-stream CLI command & Management
This is an important metric to keep track of and be aware (maybe even
alert on) when consumers fall behind consuming stream messages. While
they should be able to catch up, if they fall behind too much and the
stream gets truncated, they may miss on messages.

This is something that we want to expose via Prometheus metrics as well,
but we've started closer to the core, CLI & Management.

This should be merged as soon as it passes CI, we shouldn't wait on the
Prometheus changes - they can come later.

Pair: @kjnilsson

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-05-21 13:02:48 +01:00
Karl Nilsson 355b1cbe21 quorum_queue_SUITE only configure dist proxy when needed
Only configure the dist proxy for groups that require it.
2021-05-21 12:39:07 +01:00
Arnaud Cogoluègnes 8f8e08a9a9
Send advertised host and port in open
More secure than in peer properties frame, which is just
at the beginning of the connection opening.
2021-05-21 13:03:38 +02:00
Philip Kuryloski 98e71c45d8 Perform xref checks on many tier-1 plugins 2021-05-21 12:03:22 +02:00
Michael Klishin 67f1490a53
Merge pull request #3057 from rabbitmq/support-elixir-1-12
Declare support for elixir 1.12
2021-05-21 12:55:10 +03:00
Philip Kuryloski 3b9359a41f Update systemd dependency
Fixes https://github.com/rabbitmq/rabbitmq-server/issues/3058
2021-05-21 11:49:37 +02:00
Loïc Hoguin 79d576f276
Make rabbit_prelaunch GC before returning
Because it runs in the context of a supervisor that does very
little work, the supervisor would end up with MiBs of memory
allocated and never freed. An explicit GC frees memory completely
and the process is no longer prominent in tools like observer_cli.
2021-05-21 11:37:25 +02:00
Michal Kuratczyk e540761a2c
Declare support for elixir 1.12 2021-05-21 11:34:56 +02:00
Michal Kuratczyk 6c38b42ad6 Log heartbets at debug; remove newlines
A log line every minute about a successful heartbeat pollutes the logs.
So do empty log lines.
2021-05-20 18:46:15 +02:00
Philip Kuryloski 3715616afb Replace deprecated function calls in amqp10_client
http_uri:decode/1 -> uri_string:percent_decode/1
2021-05-20 16:52:55 +02:00
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
Philip Kuryloski df65247006 Mark rabbitmq_trust_store:system_SUITE-http_provider_tests as flaky 2021-05-19 17:36:06 +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
Arnaud Cogoluègnes c42930acb0
Set stream plugin default port to 5552 2021-05-19 15:38:52 +02:00
Philip Kuryloski 11f1cf6dbe Mark rabbitmq_shovel:dynamic_SUITE as flaky in bazel 2021-05-19 13:48:52 +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
Arnaud Cogoluègnes c15805b472
Fix stream protocol open origin
Client, not server.
2021-05-19 12:34:35 +02:00
Arnaud Cogoluègnes 7adac7a71b
Add subscription properties to stream protocol 2021-05-19 12:26:30 +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
Arnaud Cogoluègnes 0b73c9337c
Fix some logging statements in stream plugin
Missing arguments in the format.
2021-05-19 11:22:15 +02:00
Arnaud Cogoluègnes d9b7523987
Handle connection closing when dispatching stream messages 2021-05-19 10:05:37 +02: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 7145a1a2ad
Trigger event on stream consumer cancellation
To make metrics are cleaned up.
2021-05-18 17:42:33 +02:00
Arnaud Cogoluègnes 194198a450
Add stream consumer properties to list command 2021-05-18 17:16:06 +02:00
Arnaud Cogoluègnes 67546a60ca
Fix stream test suite 2021-05-18 17:03:21 +02:00
Arnaud Cogoluègnes 77b99a2efd
Add stream subscription properties to metrics 2021-05-18 16:54:41 +02: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
Michael Klishin 221666056f
Merge pull request #3044 from rabbitmq/mk-higher-mqtt-leader-election-operation-timeout
MQTT: use consistent Ra operation timeout values
2021-05-18 16:01:15 +03:00
Arnaud Cogoluègnes 7a32a4483f
Use ~0p to print map on one line 2021-05-18 14:52:12 +02:00
Michael Klishin a755dca8e9
MQTT: use consistent Ra operation timeout values
of more than the default 5s which is really low.
2021-05-18 14:35:48 +03:00
Philip Kuryloski 5d06930b8d Add rabbit_stream_core_SUITE to bazel 2021-05-18 12:45:34 +02:00
Karl Nilsson 90a8c11450 Stream: tweak type and tidy up 2021-05-18 10:02:38 +01:00
Arnaud Cogoluègnes 28f3de7f2a
Support properties in stream subscription
To add metadata. Can be used to map a subscription to
the commit offset reference.
2021-05-18 10:15:26 +02:00
Arnaud Cogoluègnes cb4e293cc7
Merge pull request #3013 from rabbitmq/stream-refactoring
Extract stream protocol framing / generation into separate module
2021-05-17 16:02:51 +02:00
Philip Kuryloski 29ddca78aa Fix additional Erlang 24 compiler warnings 2021-05-17 12:05:28 +02:00
Karl Nilsson 79502ef663 fix tests 2021-05-17 10:39:55 +01:00
Karl Nilsson 312690315d rabbit_stream_core: remove duplicate clause 2021-05-17 10:39:55 +01:00
Karl Nilsson a5cc3b28e4 remove unused function 2021-05-17 10:39:55 +01:00
Karl Nilsson b21966cf86 stream plugin: use core module in test suite
this implements a basic "client" and tests the core module on both server and client.
2021-05-17 10:39:55 +01:00
kjnilsson a1ce34c1b8 Extract stream protocol framing and binary generation
into a separate module.
2021-05-17 10:39:52 +01:00
Philip Kuryloski 4f3b068886 Fix for a compiler warning in Erlang 24 2021-05-17 11:09:19 +02:00
Arnaud Cogoluègnes e5101c2bfd
Bump JUnit in stream-related Java test suite 2021-05-17 09:32:30 +02:00
Loïc Hoguin 3ef858746c
CQ: don't deliver right before acking in the index 2021-05-14 14:25:11 +02:00
Lajos Gerecs 37a4c270b1 revert restart intensity of external stats process
Previously the restart intensity was 100 and period 50. This process was
prone to crashing in the past, so it does not make sense to not restart it
if anything happens during the gathering of statistics.

Related: #2850
2021-05-14 11:05:54 +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
Philip Kuryloski 7d7e6eafec drive-by bazel formatting 2021-05-14 10:39:25 +02:00
Michael Klishin 594f9df495
Merge pull request #3039 from rabbitmq/mk-management-cowboy-opts-listener-shadowing
Avoid a badmatch when advanced Cowboy options are set for HTTPS/TLS listener
2021-05-14 00:30:40 +03:00
Michael Klishin 4f9be8f9eb
Avoid a badmatch when advanced Cowboy options are set for HTTPS/TLS listener
For example, with the following config file snippet provided in
community Slack:

``` ini
management.ssl.port = 15671

management.ssl.cacertfile = /path/to/tls-gen.git/basic/result/ca_certificate.pem
management.ssl.certfile = /path/to/tls-gen.git/basic/result/server_certificate.pem
management.ssl.keyfile = /path/to/tls-gen.git/basic/result/server_key.pem

management.ssl.shutdown_timeout   = 7000
management.ssl.max_keepalive      = 120
management.ssl.idle_timeout       = 120
management.ssl.inactivity_timeout = 120
management.ssl.request_timeout    = 120
management.ssl.compress           = true
management.ssl.honor_cipher_order   = true
management.ssl.honor_ecc_order      = true
management.ssl.client_renegotiation = false
management.ssl.secure_renegotiate   = true
management.ssl.versions.1 = tlsv1.2
management.ssl.versions.2 = tlsv1.1
management.ssl.ciphers.1 = ECDHE-ECDSA-AES256-GCM-SHA384
management.ssl.ciphers.2 = ECDHE-RSA-AES256-GCM-SHA384
management.ssl.ciphers.3 = ECDHE-ECDSA-AES256-SHA384
management.ssl.ciphers.4 = ECDHE-RSA-AES256-SHA384
management.ssl.ciphers.5 = ECDH-ECDSA-AES256-GCM-SHA384
management.ssl.ciphers.6 = ECDH-RSA-AES256-GCM-SHA384
management.ssl.ciphers.7 = ECDH-ECDSA-AES256-SHA384
management.ssl.ciphers.8 = ECDH-RSA-AES256-SHA384
management.ssl.ciphers.9 = DHE-RSA-AES256-GCM-SHA384
```
2021-05-14 00:28:46 +03:00
Michael Klishin 820ed74d21 Merge pull request #48 from rabbitmq/stream-tls
Add stream TLS port
2021-05-14 00:24:11 +03:00
dcorbacho f0009e4008 Add stream TLS port 2021-05-13 17:00:03 +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
Philip Kuryloski e6df6615e1 Futher bazel file refactoring and deduplication 2021-05-11 16:15:33 +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
Philip Kuryloski 6edf06dcdd Refactor rabbitmq_federation bazel 2021-05-11 11:22:36 +02:00