Commit Graph

50957 Commits

Author SHA1 Message Date
Michael Klishin b2371cef70 Update 3.10.6 release notes 2022-07-06 22:16:06 +04:00
Michael Klishin fcdb0d3e08
Merge pull request #5166 from rabbitmq/segment-checksums
Make computing checksums for quorum queues configurable
2022-07-06 21:03:10 +04:00
Michael Klishin 395b2401bf Re-enable QQ WAL and segment CRC32 checksums by default
The consensus on the team is to keep them on by default
2022-07-06 19:27:13 +04:00
David Ansari ceb5c72bbb Do not compute checksums for quorum queues
Make use of https://github.com/rabbitmq/ra/pull/292

The new default will be to NOT compute CRC32 for quorum queue segments
and to NOT compute Adler32 for WAL to achieve better performance.

See https://github.com/rabbitmq/ra/pull/292#pullrequestreview-1013194678
for performance improvements.
2022-07-06 13:37:50 +02:00
Michael Klishin ecee532064
Merge pull request #5155 from rabbitmq/rabbitmq-server-5116
Add client-side TLS options support to Consul peer discovery
2022-07-06 14:09:25 +04:00
Michael Klishin 2ee0ed9ec5
Merge pull request #5153 from rabbitmq/dependabot/github_actions/master/lewagon/wait-on-check-action-1.1.2
Bump lewagon/wait-on-check-action from 1.1.1 to 1.1.2
2022-07-06 02:36:08 +04:00
Michael Klishin d064d6bc68
Merge pull request #5156 from rabbitmq/bazel-test-logs
Add `bazel run test-logs` fallback for non-desktop session
2022-07-05 17:45:43 +04:00
Michael Klishin ae1df181ca
Merge pull request #5157 from rabbitmq/stream-lower-log-level-on-precondition-failed 2022-07-05 17:24:33 +04:00
Arnaud Cogoluègnes 37b43fb290
Lower log level on stream creation validation failure
No need to log an error when the arguments are not the same,
info is enough.
2022-07-05 12:18:27 +02:00
David Ansari 107b8a4de1 Add `bazel run test-logs` fallback for non-desktop session
My workflow is developing RabbitMQ on an Ubuntu server.
Since it doesn't have a desktop or browser, let's fallback
for `bazel run test-logs` command to start an HTTP server instead.

From now on, I can run conveniently:
```
david@nuc:~/workspace/rabbitmq-server$ bazel run test-logs //deps/rabbitmq_auth_backend_oauth2:unit_SUITE --config=local
INFO: Analyzed target //:test-logs (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:test-logs up-to-date:
  bazel-bin/open-test-logs.sh
INFO: Elapsed time: 0.047s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Archive:  outputs.zip
Couldn't find a suitable web browser!

Set the BROWSER environment variable to your desired browser.

Warning: program returned non-zero exit code #256
/usr/bin/open: 882: www-browser: not found
/usr/bin/open: 882: links2: not found
/usr/bin/open: 882: elinks: not found
/usr/bin/open: 882: links: not found
/usr/bin/open: 882: lynx: not found
/usr/bin/open: 882: w3m: not found
xdg-open: no method available for opening 'index.html'
Open your browser at http://nuc:8000/index.html
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
```

and then open http://nuc:8000/index.html in my browser on MacOS.
2022-07-05 10:10:58 +00:00
Michael Klishin a4f862176d Consul peer discovery: pass TLS options to httpc in one more place 2022-07-05 13:36:09 +04:00
Michael Klishin f70ea8ed74 Pass on TLS options to httpc options
Note that mock-based tests still need updating.

Part of #5116.
2022-07-05 12:24:41 +04:00
Michael Klishin b77d8631dc Peer discovery HTTP client: more override that accept HTTP options
Part of #5116
2022-07-05 10:37:44 +04:00
Michael Klishin 18b1c88fdd Add TLS options to Consul peer discovery schema
References #5116
2022-07-05 01:20:14 +04:00
dependabot[bot] e3d797b4fe
Bump lewagon/wait-on-check-action from 1.1.1 to 1.1.2
Bumps [lewagon/wait-on-check-action](https://github.com/lewagon/wait-on-check-action) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/lewagon/wait-on-check-action/releases)
- [Commits](https://github.com/lewagon/wait-on-check-action/compare/v1.1.1...v1.1.2)

---
updated-dependencies:
- dependency-name: lewagon/wait-on-check-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 18:31:41 +00:00
Michael Klishin 503bd487da
Merge pull request #5150 from rabbitmq/bazel-start-cluster
Add Bazel targets start-cluster and stop-cluster
2022-07-04 19:35:18 +04:00
David Ansari b08ef4583e Add Bazel targets start-cluster and stop-cluster
to have the equivalent of `make start-cluster` and `make stop-cluster`.

To create a 3-node RabbitMQ cluster:
```
bazel run --config=local start-cluster
```
To define number of nodes or a custom directory:
```
bazel run --config=local start-cluster NODES=5 TEST_TMPDIR="$HOME/scratch/myrabbit"
```

To stop the cluster:
```
bazel run --config=local stop-cluster
```
or, if started by the 2nd command:
```
bazel run --config=local stop-cluster NODES=5 TEST_TMPDIR="$HOME/scratch/myrabbit"
```
2022-07-04 13:54:26 +00:00
Michael Klishin 891046b672 3.9.21 release notes 2022-07-04 14:15:04 +04:00
Michael Klishin 13e9079e74 Update 3.10.6 release notes 2022-07-04 14:13:46 +04:00
Michael Klishin 15e9581148
Merge pull request #5147 from rabbitmq/mk-3.9.21-release-notes
3.9.21 release notes
2022-07-04 13:59:47 +04:00
Michael Klishin 0be41a53e4 3.9.21 release notes 2022-07-04 13:59:17 +04:00
Karl Nilsson 63077edf41
Merge pull request #5144 from rabbitmq/gh-issue-5141
Fix mixed version channel crash
2022-07-04 09:52:24 +01:00
David Ansari a8442ccc7a Fix mixed version channel crash
Fixes #5141
2022-07-04 08:20:55 +00:00
Michael Klishin b1e7a6a2ca
Merge pull request #5137 from rabbitmq/mk-3.10.6-release-notes
3.10.6 release notes
2022-07-03 23:45:27 +04:00
Michael Klishin 48970f8446 3.10.6 release notes 2022-07-03 23:44:36 +04:00
Michael Klishin 5dffcb172a
Merge pull request #5131 from rabbitmq/fix_read_stream_framemax_heartbeat
Fix read frame_max and heartbeat parameters
2022-07-03 12:08:37 +04:00
Gabriele Santomaggio 3ae0f732d6
Formatting
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
2022-07-01 16:03:22 +02:00
Gabriele Santomaggio a43ca47d95
Fix read frame_max and heartbeat parameters
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
2022-07-01 15:56:41 +02:00
Michael Klishin 25f4425131 CHX: document the limitations introduced in #5121 2022-07-01 12:29:00 +04:00
Michael Klishin dd1d2ee9a4
Merge pull request #5125 from rabbitmq/microsecond
Use microsecond abbreviation 'us' instead of 'µs'
2022-06-30 20:46:20 +04:00
David Ansari ad27021630 Use microsecond abbreviation 'us' instead of 'µs'
'us' is used when Unicode is not available.

Prior to this commit:
```
$ kubectl logs r1-server-0 -c rabbitmq | ag time
2022-06-30 13:37:35.253927+00:00 [debug] <0.336.0> wal: recovered 00000003.wal time taken 0ms
2022-06-30 13:37:35.262592+00:00 [debug] <0.349.0> wal: recovered 00000003.wal time taken 0ms
2022-06-30 13:37:35.489016+00:00 [debug] <0.352.0> Feature flags: time to find supported feature flags: 76468 �s
2022-06-30 13:37:35.495193+00:00 [debug] <0.352.0> Feature flags: time to regen registry: 6032 �s
2022-06-30 13:37:35.500574+00:00 [debug] <0.361.0> Feature flags: time to find supported feature flags: 937 �s
2022-06-30 13:37:35.500603+00:00 [debug] <26705.398.0> Feature flags: time to find supported feature flags: 891 �s
2022-06-30 13:37:35.507998+00:00 [debug] <26705.398.0> Feature flags: time to regen registry: 7199 �s
2022-06-30 13:37:35.509092+00:00 [debug] <0.361.0> Feature flags: time to regen registry: 8396 �s
```
2022-06-30 13:54:25 +00:00
David Ansari 5ebbb75c01 Fix log format in consistent hash exchange
Before this commit:
```
Consistent hashing exchange: removing binding from exchange '"exchange 'e1' in vhost '/'"' to destination '"queue 'qq2' in vhost '/'"' with routing key '2'
```

The single quotes do not make sense.
2022-06-30 13:19:11 +00:00
Michael Klishin b48dd093d6 rabbit_binding:list_between/2: consider all route tables 2022-06-30 16:21:32 +04:00
Michael Klishin e8af9881f9 Introduce rabbit_binding:list_between/2
and has_any_between/2

(cherry picked from commit 088b7a63a9)
2022-06-30 15:34:00 +04:00
Michael Klishin 1cfa2aadd4
Merge pull request #5121 from rabbitmq/chx-node-restart
Make adding bindings idempotent
2022-06-30 15:33:18 +04:00
David Ansari ba22b3307f Add some function and type specs 2022-06-30 09:45:46 +00:00
David Ansari 878f369b7a Make adding bindings idempotent
First binding wins.
Duplicate bindings, i.e. bindings with the same source exchange and
same destination queue / exchange but possibly different routing key
(weight) are ignored from now on by the consistent hash exchange.

This applies only to bindings being added.
For bindings being deleted, any duplicate binding (independent of its
routing key) will delete all buckets for the given source and
destination. (This is to ensure that buckets for a given source and
destination can be deleted for when upgrading from a version prior
to this commit. This was also the behaviour prior to this commit,
so nothing changes in that regard.)

Note that duplicate bindings continue to be created in RabbitMQ.
(They are only ignored by the consistent hash exchange.)

Adding a binding will perform linear search in the bucket map.
This is already stated in the README:
"These two operations use linear algorithms to update the ring."

The linear search when adding a binding could be optimised by
adding another Mnesia table field which will require a new migration and
feature flag. Hence, such an optimization is left out in this commit.

Fixes #3386.
2022-06-30 09:24:02 +00:00
Jean-Sébastien Pédron df080b89cf
rabbit_feature_flags: Fix a stale comment about experimental feature flags 2022-06-28 16:41:02 +02:00
Jean-Sébastien Pédron a48a4a09c4
Merge pull request #3940 from rabbitmq/add-feature-flags-controller
Add a feature flags controller
2022-06-28 13:33:59 +02:00
Jean-Sébastien Pédron 0fd051234e
Git: Don't ignore `rabbitmq_ct_helpers` and `rabbitmq_ct_client_helpers` in deps 2022-06-28 11:08:29 +02:00
Jean-Sébastien Pédron da807547f5
rabbit_core_ff: Remove no-op migration functions
There is no need to add a migration function which does nothing.
Ignoring the third argument and always returning `ok` is incorrect
anyway.
2022-06-28 10:13:19 +02:00
Jean-Sébastien Pédron cefb6aaef5
cth_log_redirect_any_domains: common_test hook to handle domain-specific log messages
common_test installs its own logger handler, which is great.
Unfortunately, this logger handler drops all messages having a domain,
except when the domain is among the domains used by Erlang itself.

In RabbitMQ, we use logger domains to categorize messages. Therefore
those messages are dropped by the common_test's logger handler.

This commit introduces another logger handler which sits on top of the
common_test one and makes sure messages with a domain are logged as
well.
2022-06-28 10:13:19 +02:00
Jean-Sébastien Pédron bcb8733880
rabbit_feature_flags: Add a feature flags controller process
This gen_statem-based process is responsible for handling concurrency
when feature flags are enabled and synchronized when a cluster is
expanded.

This clarifies and stabilizes the behavior of the feature flag subsystem
w.r.t. situations where e.g. a feature flag migration function takes
time to update data and a new node joins a cluster and synchronizes its
feature flag states with the cluster. There was a chance that the
feature flag was marked as enabled on the joining node, even though the
migration function didn't take care of that node.

With this new feature flags controller, enabling or synchronizing
feature flags blocks and delays any concurrent operations which try to
modify feature flags states too.

This change also clarifies where and when the migration function is
called: it is called at least once on each node who knows the feature
flag and when the state goes from "disabled" to "enabled" on that node.

Note that even if the feature flag is being enabled on a subset of the
nodes (because other nodes already have it enabled), it is marked as
"state_changing" everywhere during the migration. This is to prevent
that a node where it is enabled assumes it is enabled on all nodes who
know the feature flag.

There is a new feature as well: just after a feature flag is enabled,
the migration function is called a second time for any post-enable
actions. The feature flag is marked as enabled between these "enable"
and "post-enable" steps. The success or failure of this "post-enable"
run does not affect the state of the feature flag (i.e. it is ignored).

A new migration function API is introduced to allow more advanced
things. The new API is:

    my_migration_function(
      #ffcommand{name = ...,
                 props = ...,
		 command = enable | post_enable,
		 extra = #{...}})

The record is defined in `include/feature_flags.hrl`. Here is the
meaning of each field:

* `name` and `props` are the equivalent of the `FeatureName` and
  `FeatureProps` arguments of the previous migration function API.

* `command` is basically the same as the previous `Arg` arguments.

* `extra` is map containing context-specific information. For instance, it
  contains the list of nodes where the feature flag state changes.

This whole new behavior is behind a new feature flag called
`feature_flags_v2`. If a feature flag uses the new migration function
API, `feature_flags_v2` will be automatically enabled.

If many feature flags are enabled at once (like when a fresh RabbitMQ
node is started for the first time), `feature_flags_v2` will be enabled
first if it is in the list.
2022-06-28 10:13:19 +02:00
Michael Klishin f95d2ba4b4
Merge pull request #5113 from rabbitmq/unique-extra-bcc
Do not route to duplicate extra BCC destinations
2022-06-28 00:01:39 +04:00
David Ansari 0ec9566e95 Do not route to duplicate extra BCC destinations 2022-06-27 17:17:20 +00:00
Michael Klishin 2d12f8bb86
Merge pull request #5107 from Ayanda-D/handle-qq-timeouts
Handle quorum queue timeout errors on rare 'basic.get' operations
2022-06-27 08:42:57 +04:00
Ayanda Dube e6dce57c8c Handle quorum queue timeout errors from rabbit_fifo_client:dequeue/3 on 'basic.get' 2022-06-26 22:37:33 +01:00
Michael Klishin adb6e0468d
Merge pull request #5078 from rabbitmq/test-logs-enhancements
Allow `bazel run test-logs` to work when logs are compressed
2022-06-22 12:15:56 +04:00
Michael Klishin bebe9654a0
Merge pull request #5085 from rabbitmq/amqp-stream-consumer-file-handle-leak-fix 2022-06-21 23:17:23 +04:00
Karl Nilsson 8635ded7fe Close osiris log when cancelling AMQP stream consumer
Else we'd end up leaking file handles.
2022-06-21 16:22:13 +01:00