Commit Graph

59616 Commits

Author SHA1 Message Date
Michal Kuratczyk 84d52b51dc
[skip ci] Remove rabbit_log_shovel, use LOG_ macros directly 2025-07-18 08:43:03 +02:00
Michal Kuratczyk 301f6e9906
[skip ci] Remove redundant pid metadata in LOG_ macros 2025-07-18 08:43:03 +02:00
Michal Kuratczyk 8fb3ca1abf
[skip ci] Set logging domain to `?RMQLOG_DOMAIN_GLOBAL` on startup
`?RMQLOG_DOMAIN_GLOBAL` used to be added by a now deleted logging
module rabbit_log.
2025-07-18 08:43:03 +02:00
Michal Kuratczyk ad15dd39df
[skip ci] Simplify logging around peer discovery 2025-07-18 08:43:03 +02:00
Michal Kuratczyk ee100af9eb
[skip ci] Remove rabbit_log_ldad and use LOG_ macros 2025-07-18 08:43:02 +02:00
Michal Kuratczyk 8a05433897
[skip ci] Remove rabbit_log_connection and use LOG_ macros 2025-07-18 08:43:02 +02:00
Michal Kuratczyk ebe3f61ef0
[skip ci] Remove rabbit_log_federation and use LOG_ macros 2025-07-18 08:43:02 +02:00
Michal Kuratczyk 3ee8df9310
[skip ci] Remove `pid` from logger process metadata
It's added automatically by logger
2025-07-18 08:43:02 +02:00
Michal Kuratczyk 5600138ce9
[skip ci] Remove rabbit_log_prelaunch 2025-07-18 08:43:02 +02:00
Michal Kuratczyk b7b30ce4d1
[skip ci] Remove rabbit_log_mirroring 2025-07-18 08:43:02 +02:00
Michal Kuratczyk 1743881fe1
[skip ci] Remove rabbit_log_channel and use LOG_ macros directly 2025-07-18 08:43:02 +02:00
Michal Kuratczyk 14fc15a0c2
[skip ci] Remove rabbit_log_queue, replace with LOG_ macros 2025-07-18 08:43:02 +02:00
Michal Kuratczyk b6b766cac7
[skip ci] Replace logger: calls is LOG_ macros 2025-07-18 08:43:02 +02:00
Michal Kuratczyk 175ba70e8c
[skip ci] Remove rabbit_log and switch to LOG_ macros 2025-07-18 08:42:59 +02:00
David Ansari 310e8123ec
Merge pull request #14184 from rabbitmq/amqp-sql
Support AMQP SQL Filter Expressions
2025-07-18 08:17:21 +02:00
David Ansari a43e2c5201
Merge pull request #14245 from rabbitmq/amqp_filter_set_bug
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.18, 28) (push) Waiting to run Details
Deny `amqp_filter_set_bug` by default
2025-07-17 15:19:27 +02:00
David Ansari a850505b18 Fix failing test case `streams`
Fix
```
make -C deps/rabbit ct-amqp_dotnet t=cluster_size_1:streams
```
2025-07-17 11:29:53 +02:00
David Ansari 4c73edd923 Deny `amqp_filter_set_bug` by default
The deprecated feature flag `amqp_filter_set_bug` was introduced in
RabbitMQ 4.1 with phase `permitted_by_default`.
See https://github.com/rabbitmq/rabbitmq-server/pull/12415

This commit which will land in RabbitMQ 4.2 changes the phase to `denied_by_default`.
2025-07-17 10:35:00 +02:00
David Ansari bc346c8193 Minor refactoring 2025-07-16 15:29:24 +02:00
David Ansari 31d443a30c Change regex pattern from greedy to non-greedy
The spec mandates:
> The wildcard matching MUST consume as few characters as possible.
2025-07-16 15:29:23 +02:00
David Ansari 965691680d Make NAN and INF reserved 2025-07-16 15:29:23 +02:00
David Ansari 5bd2eba04f Support decimal and approximate number constants
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929299
and
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929300

In contrast, in JMS approximate literals use the Java floating-point literal syntax.
2025-07-16 15:29:23 +02:00
David Ansari 642eca60c0 Add support for UTC function
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929310
2025-07-16 15:29:23 +02:00
David Ansari 833b367e3b Support delimited identifier
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929314
2025-07-16 15:29:23 +02:00
David Ansari 492575bc29 Support strings surrounded by double quotes
JMS:
> A string literal is enclosed in single quotes, with an included single quote represented
> by doubled single quote; for example, 'literal' and 'literal''s'.

AMQP SQL
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929302
> A string constant is a string of arbitrary text consisting of any valid printable Unicode
> characters surrounded by single or double quotation marks. A quotation mark inside the
> string is represented by two consecutive quotation marks.
> string_constant ::= { ‘ | “ } <any> [<any>] { ‘ | “ }
2025-07-16 15:29:23 +02:00
David Ansari ffc879d958 Support binary constants
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929303
2025-07-16 15:29:23 +02:00
David Ansari ccdb82b687 Allow only upper case operator names
Allow only upper case predefined selector literals and operator names.

The JMS spec states:
> Predefined selector literals and operator names are written here in upper case; however, they are case insensitive.

However, the AMQP SQL spec does not include such a statement.
The EBNF notation with single quotes ('AND') typically implies exact literal matching.
This commit follows the AMQP SQL's EBNF notation and therefore disallows
lower case predefined selector literals or operator names.
2025-07-16 15:29:23 +02:00
David Ansari c5eeced28d Support set expressions
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929291
2025-07-16 15:29:23 +02:00
David Ansari 7da3c64287 Allow lexicographical comparison of strings
AMQP SQL spec:
"The left operand is of greater value than the right operand if:
... both operands are of type string or of type symbol (any combination is permitted) and the
lexicographical rank of the left operand is greater than the lexicographical rank of the right operand."

In contrast, in JMS:
"String [...] comparison is restricted to = and <>."
2025-07-16 15:29:23 +02:00
David Ansari 5949e6fe90 Support modulo operator '%'
The spec is underspecified in what should happen if the left hand side
is a float. This commit decides that the result is undefined (unknown).

The spec is also underspecified in what should happen if either the left
hand side or the right hand side is negative. This commit decides to use
the behaviour of Erlang `rem`.
2025-07-16 15:29:23 +02:00
David Ansari 885b8d38e8 Support ‘!=’ operator 2025-07-16 15:29:23 +02:00
David Ansari f5ae413659 Remove [NOT] BETWEEN operator
[NOT] BETWEEN operator is not supported in AMQP SQL
2025-07-16 15:29:23 +02:00
David Ansari 9f7668f6c2 Add link capability AMQP_FILTEX_SQL_V1_0
"A partner MAY indicate support and yet it MAY still refuse to accept
certain filters or combination of filters for some scenarios."
2025-07-16 15:29:23 +02:00
David Ansari b64c0ef5bf Comply with 6.4.4.4 Field References and Values
https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929312
2025-07-16 15:29:23 +02:00
David Ansari dbc6321808 Rename JMS to (AMQP) SQL 2025-07-16 15:29:23 +02:00
David Ansari c34d6206f1 Support AMQP SQL Filter Expressions
Instead of the JMS message selector syntax, support a subset of the
AMQP SQL Filter Expressions syntax as defined in
[AMQP Filter Expressions Version 1.0 Committee Specification Draft 01](https://docs.oasis-open.org/amqp/filtex/v1.0/csd01/filtex-v1.0-csd01.html#_Toc67929276).

This commit changes the descriptors.
2025-07-16 15:29:23 +02:00
David Ansari da2255d7da
Merge pull request #14238 from rabbitmq/optimise-amqp-parser
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.18, 28) (push) Waiting to run Details
Make AMQP 1.0 faster
2025-07-16 15:27:54 +02:00
Arnaud Cogoluègnes f8eac1dc92
Merge pull request #14240 from rabbitmq/stream-fix-test-flake-2
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.18, 28) (push) Waiting to run Details
Increase timeouts and improve error logging in stream test
2025-07-16 11:34:28 +00:00
Arnaud Cogoluègnes c1fd7c3376
Propagate connection state in offset lag calculation test
This should fix some flakes.
2025-07-16 11:33:12 +02:00
David Ansari 80a687f525 Simplify splitting large messages 2025-07-16 11:32:50 +02:00
David Ansari cf3bbe99a7 Simplify pattern matching 2025-07-16 10:32:21 +02:00
David Ansari ce3726c064 Fix splitting large messages in server
This commit fixes the following test case:
```
make -C deps/rabbit ct-amqp_dotnet t=cluster_size_1:fragmentation
```

Previously, the server sent a frame that was 1 byte too large.
2025-07-16 10:29:08 +02:00
Arnaud Cogoluègnes 0d84c8e9a5
Increase timeouts and improve error logging in stream test 2025-07-16 10:22:20 +02:00
David Ansari 64fdb25f97 Fix splitting large messages in AMQP client
This commit fixes the failing test cases
```
make -C deps/rabbit ct-msg_size_metrics t=tests:message_size
make -C deps/amqp10_client ct-system t=rabbitmq:roundtrip_large_messages
```

The second test case failed with:
```
flush {amqp10_event,
          {connection,<0.193.0>,
              {closed,
                  {framing_error,
                      <<"frame size (131073 bytes) > maximum frame size (131072 bytes)">>}}}}
```
2025-07-16 09:39:40 +02:00
David Ansari bf23a7fb30 Speed up AMQP 1.0 parser by generating less garbage
This commit results in great performance improvements for AMQP 1.0.

Stream filtering via AMQP SQL Filters or AMQP Property Filters where the
broker reads messages from the stream into memory and the filter returns
false, i.e. messages are not sent to the client:
Before this commit: ~400,000 msgs/s
After this commit:  ~500,000 msgs/s

There is also a ~10% increase in end-to-end throughput for normal
AMQP workloads, e.g. when sending to and receiving from a classic queue.

Prior to this commit, a lot of garbage was created leading to many minor
garbage collections.

This commit reduces the garbage being generated.
The new module amqp10_composite performs very well:
* Single tuple update setting multiple fields at once, sometimes done even in-place
  without copying the tuple.
* The list of fields is passed into X registers, no need for any new
  allocations.

On the serialisation side, this commit also generates less garbage by:
1. Avoiding tuple_to_list/1
2. Omitting trailing elements of the list that are null

This will also lead to fewer bytes per message sent on the wire and less
resource usage for the clients as they need to parse fewer fields.
2025-07-15 16:41:56 +00:00
David Ansari 09f9a77799 Delete dead code 2025-07-15 15:57:22 +00:00
David Ansari 603466b5d8 Use byte_size/1 instead of size/1 2025-07-15 15:55:09 +00:00
Arnaud Cogoluègnes fb9f048add
Merge pull request #14235 from rabbitmq/stream-fix-test-flake
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.18, 28) (push) Waiting to run Details
Fix flake in stream plugin test suite
2025-07-15 15:34:24 +00:00
Arnaud Cogoluègnes ff98f6fc1e
Fix flake in stream plugin test suite
The closing sequence must account for consumer update and metadata
update frames the broker sends when a consumer group changes and when a
stream is deleted.
2025-07-15 15:51:02 +02:00
Michael Klishin cdd9ba1bb6
Merge pull request #14227 from rabbitmq/show-deprecated-feature-state
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.18, 28) (push) Waiting to run Details
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Has been cancelled Details
Test Authentication/Authorization backends via mutiple messaging protocols / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled Details
Test Management UI with Selenium / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled Details
Test Authentication/Authorization backends via mutiple messaging protocols / summary-selenium (push) Has been cancelled Details
Show current state of deprecated features
2025-07-14 11:21:21 -04:00