Commit Graph

25764 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron 6e9ee4d0da
Remove test code which depended on the `quorum_queue` feature flags
These checks are now irrelevant as the feature flag is required.
2022-08-01 12:41:30 +02:00
Jean-Sébastien Pédron 4dd07e2905
rabbitmqctl.8: Use `stream_queue` in the `enable_feature_flag` example
The `quorum_queue` feature flag is now required and is always enabled.
2022-08-01 12:31:44 +02:00
Jean-Sébastien Pédron 909f861e55
Remove pre-quorum-queue compatibility code
Quorum queues were introduced in RabbitMQ 3.8.0. This was first time we
added a breaking change protected behind a feature flag. This allowed a
RabbitMQ cluster to be upgraded one node at a time, without having to
stop the entire cluster.

The breaking change was a new field in the `#amqqueue{}` record. This
broke the API and the ABI because records are a compile-time thing in
Erlang.

The compatibility code is in the wild for long enough that we want to
support the new `#amqqueue{}` record only from now on. The
`quorum_queue` feature flag was marked as required in a previous commit
(see #5202). This allows us to remove code in this patch.

References #5215.
2022-08-01 12:31:40 +02:00
Jean-Sébastien Pédron 776b4323bd
Remove test code which depended on the `virtual_host_metadata` feature flags
These checks are now irrelevant as the feature flag is required.
2022-08-01 11:56:53 +02:00
Jean-Sébastien Pédron 29b80bd65b
Remove pre-virtual_host_metadata feature flag compatibility code
This feature flag was introduced because a new field was added to the
`#vhost{}` record. This was a breaking change the feature flag allowed a
RabbitMQ cluster to be upgraded one node at a time, without having to
stop the entire cluster.

The compatibility code is in the wild for long enough that we want to
support the new `#vhost{}` record only from now on. The
`virtual_host_metadata` feature flag was marked as required in a
previous commit (see #5202). This allows us to remove code in this
patch.

References #5215.
2022-08-01 11:56:04 +02:00
Michael Klishin e327942262
rabbit_auth_backend_internal: correctly format JSON decoding errors that are tuples 2022-07-30 18:04:27 +04:00
Michael Klishin a474439146
rabbit_runtime_parameters: correctly format JSON decoding errors that are tuples in one more place 2022-07-30 16:02:54 +04:00
Michael Klishin 3fe97685d6
Merge branch 'master' into mk-swap-json-library 2022-07-30 15:35:25 +04:00
Michael Klishin 6073d6789c
rabbit_runtime_parameters: correctly format JSON decoding errors that are tuples 2022-07-30 04:59:11 +04:00
Michael Klishin 7436a0f5a2
rabbit_auth_backend_internal: correctly format JSON decoding errors that are tuples 2022-07-30 04:51:19 +04:00
Michael Klishin cc723a4ebf
rabbit_vhost_limit: correctly format JSON decoding errors that are tuples 2022-07-30 04:42:03 +04:00
Michael Klishin 2b837f245b
rabbit_policy: correctly format JSON decoding errors that are tuples 2022-07-30 04:34:43 +04:00
Michael Klishin 0639f3ecd2
rabbit_json:decode/2: raise a two-tuple error 2022-07-30 04:26:13 +04:00
Michael Klishin a63248a756
rabbit_aws: adapt for Thoas-based rabbit_json 2022-07-30 03:53:49 +04:00
Michael Klishin cba60c04c8
rabbitmqadmin_SUITE: encode value as bytes on Python 3 2022-07-30 02:43:04 +04:00
Michael Klishin ba18abd6e2
rabbitmqadmin_SUITE: only use Python 3, Python 2 is really truly EOL 2022-07-29 21:47:59 +04:00
Michael Klishin 3664b2475b
Merge pull request #5385 from rabbitmq/conditional-logging-format
Add conditional logging to text formatter
2022-07-29 21:43:31 +04:00
Michael Klishin a0c793b610
Merge pull request #5392 from cloudamqp/channel_tracking
Channel PID as primary key of channel tracking ETS table
2022-07-29 20:59:32 +04:00
David Ansari 32e118fada Remove test code which depended on feature flag implicit_default_bindings
The feature flag is required.

References #5215.
2022-07-29 15:03:26 +00:00
David Ansari 067c880c02 Remove implicit_default_bindings compatibility code
Implicit default bindings, introduced in RabbitMQ 3.8.x, was a breaking change
protected behind a feature flag. This allowed a RabbitMQ cluster to be
upgraded one node at a time, without having to stop the entire cluster.

The compatibility code is in the wild for long enough. The
`implicit_default_bindings` feature flag was marked as required in a
previous commit (see #5202). This allows us to remove code in this
patch.

References #5215.
2022-07-29 15:03:26 +00:00
Michael Klishin 83bfee4adf
Merge pull request #5388 from rabbitmq/direct-exchange-routing-v2-more-tests
Direct exchange routing v2 more tests
2022-07-29 18:45:11 +04:00
Michael Klishin 01871b4a65
Adapt JSON logging test for Thoas
Only top-level features are atomized by rabbit_json:encode/1
now
2022-07-29 18:27:38 +04:00
Arnaud Cogoluègnes 0c848ab29d
Fix stream command name
For consistency and to make link work.
2022-07-29 13:46:00 +02:00
David Ansari 4d17f63e2f Add test for routing from exchange to exchange 2022-07-29 10:18:49 +00:00
David Ansari b2fe059860 Set read lock on rabbit_exchange during rabbit_index_route migration
Since the migration function for feature flag direct_exchange_routing_v2
does dirty reads on table rabbit_exchange, let's set a read lock on
that whole table.
In theory, it's not really necessary since bindings are modified within
transactions contexts.
However, let's be safe and set that read lock.
Function rabbit_binding:populate_index_route_table/0
takes less than a few seconds with many thousands of bindings.
So, it shouldn't harm that no exchanges can be created / deleted in that
short time period when enabling the feature flag.

Also, abort the transaction and return an error in the feature flag
migration is a source exchange cannot be found.
This is the safest thing to do because we do not want any routes to be
missing in rabbit_index_route table.
2022-07-29 10:18:49 +00:00
David Ansari f08171779e Remove binding from rabbit_index_route if exchange not found
This branch should never hit.
However, if a source exchange is not present anymore,
delete its bindings from rabbit_index_route.
If the binding doesn't exist is rabbit_index_route, the delete operation
is a no-op.
2022-07-29 10:18:48 +00:00
Péter Gömöri 8d5785baa4 Channel PID as primary key of channel tracking table
Before this change `rabbit_channel_tracking` used node+name as primary
key of the channel tracking table. As the `channel_closed` event might
only contain the channel pid and not node and name,
`rabbit_channel_tracking` used a full-table-scan matching in
`get_tracked_channel_by_pid/1` to look up and unregister the closed
channel. Now that channel pid is the key unregistering channels should
be constant time and not proportional to the number of tracked channels.
2022-07-29 12:09:46 +02:00
Péter Gömöri a38e63b8f1 Don't try to create connection tracking tables in rabbit_mnesia
boot() is called right after init_db_and_upgrade which stops mnesia. So
creating mnesia tables will always fail with node not running.
2022-07-29 12:09:46 +02:00
Michael Klishin 1bea14fdca
Begin adapting logging_SUITE for Thoas 2022-07-29 14:01:00 +04:00
Jean-Sébastien Pédron 5b98d7d2a2
Remove test code which depended on the `maintenance_mode_status` feature flags
These checks are now irrelevant as the feature flag is required.
2022-07-29 11:51:52 +02:00
Jean-Sébastien Pédron 43a525f4d0
Remove pre-maintenance_mode_status compatibility code
Maintenance mode, introduced in RabbitMQ 3.8.x, was a breaking change
protected behind a feature flag. This allowed a RabbitMQ cluster to be
upgraded one node at a time, without having to stop the entire cluster.

The compatibility code is in the wild for long enough. The
`maintenance_mode_status` feature flag was marked as required in a
previous commit (see #5202). This allows us to remove code in this
patch.

References #5215.
2022-07-29 11:51:26 +02:00
Jean-Sébastien Pédron 32049cd256
Remove test code which depended on the `user_limits` feature flags
These checks are now irrelevant as the feature flag is required.
2022-07-29 11:04:48 +02:00
Iliia Khaprov 1c1f5403d6 Add conditional logging to text formatter.
Just like OTP logger
2022-07-29 10:40:29 +02:00
Jean-Sébastien Pédron eeaf8d39e5
Remove pre-user_limits compatibility code
User limits required a breaking change protected behind a feature flag.
This allowed a RabbitMQ cluster to be upgraded one node at a time,
without having to stop the entire cluster.

The breaking change was a new field in the `#internal_user{}` record. This
broke the API and the ABI because records are a compile-time thing in
Erlang.

The compatibility code is in the wild for long enough that we want to
support the new `#internal_user{}` record only from now on. The
`user_limits` feature flag was marked as required in a previous commit
(see #5202). This allows us to remove code in this patch.

References #5215.
2022-07-29 10:18:15 +02:00
Michael Klishin 2bd585dd64
rabbit_json:decode/1: use erlang:error/1 like the JSX version did 2022-07-29 10:34:52 +04:00
Michael Klishin d216d4293e
Remove a few tests that are no longer relevant
Back in 2016, JSON encoding and
much of the Erlang ecosystem used
proplists, which can lead to duplicate
keys in JSON documents.

In 2022 some JSON libraries only
decode JSON to maps, and maps
have unique keys, so these tests
are not worth adjusting or reproducing
with maps.

Per discussion with the team.
2022-07-29 10:34:52 +04:00
Michael Klishin bad6e394b2
Swap JSX for Thoas in more places
and adapt rabbit_json for Thoas in the process.

Pair: @pjk25
2022-07-29 10:34:51 +04:00
Michael Klishin 9c99f76579
Replace JSX with Thoas for JSON operations
Thoas is more efficient both in terms of encoding
time and peak memory footprint.

In the process we have discovered an issue:
https://github.com/lpil/thoas/issues/15

Pair: @pjk25
2022-07-29 10:34:47 +04:00
Michael Klishin 838499c326
Merge pull request #5350 from rabbitmq/pjk25/set-broker-version-to-3.12.0
Bump the rabbitmq version on this branch to 3.12.0 (bazel)
2022-07-28 21:06:03 +04:00
Jean-Sébastien Pédron f46acbd34c
Merge pull request #5301 from rabbitmq/tracking-to-ets
Move connection and channel tracking tables to ETS
2022-07-28 17:09:23 +02:00
Michael Klishin b732a9b4c0
Merge pull request #5358 from rabbitmq/more-tests-direct-exchange-routing-v2 2022-07-28 19:02:01 +04:00
Jean-Sébastien Pédron c18465e088
Merge pull request #5253 from rabbitmq/use-rabbit_feature_flags-instead-of-rabbit_ff_registry-in-rabbitmq_stream
rabbit_stream: Use rabbit_feature_flags, not `rabbit_ff_registry`
2022-07-28 16:26:35 +02:00
dcorbacho 69ce55f971 Updates to new feature flag API 2022-07-28 16:13:17 +02:00
David Ansari 4b6d72ea41 Add more direct_exchange_routing_v2 tests
1. Recover bindings
2. Enable feature flag with concurrent definition import
2022-07-28 14:06:59 +00:00
dcorbacho 6069af791c Minor fixes to move tracking tables to ETS 2022-07-28 15:49:20 +02:00
dcorbacho 5795ba94b1 Move connection and channel tracking tables to ETS 2022-07-28 15:49:20 +02:00
Rin Kuryloski 71cc16bfbb Remove old reference to external trust-store-http
Follow up to #5359
2022-07-28 14:36:44 +02:00
Jean-Sébastien Pédron dd6b52d3f2
rabbit_stream: Use rabbit_feature_flags, not `rabbit_ff_registry`
`rabbit_ff_registry` is an internal module of the feature flags
subsystem, it is not meant to be called outside of it. In particular, it
may lead to crashes very difficult to debug when a feature flag is
enabled. The reason is that this module is compiled and reloaded at
runtime, so the module may disappear for a small period of time. Another
reason is that a process calling `rabbit_ff_registry` may hold that
module, preventing the feature flags subsystem from performing its task.

The correct public API to query the state of a feature flag is
`rabbit_feature_flags:is_enabled/1`. It will always return a boolean. If
the feature flag being queried is in `state_changing` state, this
function takes care of waiting for the outcome.

See #5018.
2022-07-28 14:12:41 +02:00
Michael Klishin e0dfc34616
Remove external dependency reference to trust_store_http
Pair: @pjk25
2022-07-28 15:25:53 +04:00
Michael Klishin 89fa75ee1b
Fold trust_store_http into this repo
It does not have any external users and we'd prefer
to evolve it together with the RabbitMQ tier 1 plugin that
depends on it.

Pair: @pjk25
2022-07-28 15:15:36 +04:00