Commit Graph

642 Commits

Author SHA1 Message Date
Michael Klishin 01f68b80c9
Merge pull request #3723 from wrobell/rabbitmq-streams-doc-protocol-deliver-fix
Fix description of "deliver" command in RabbitMQ Streams protocol documentation
2021-11-14 21:59:12 +03:00
wrobell b4f39031f6 Fix description of "deliver" command in RabbitMQ Streams protocol documentation
Add missing fields - chunk type, timestamp, trailer length and reserved.
The fields are added after looking at

    3fd348d225/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java (L267)
    https://github.com/qweeze/rstream/blob/master/rstream/schema.py#L376

Change type of "version" field - it shall be uint16 like in other
commands.
2021-11-14 14:51:35 +00:00
Philip Kuryloski e4505bea3d Use unique group names in rabbit_stream_SUITE
Technically duplicate names is supported by common test, but we have
seen it contribute to flakiness in our suite in practice

(cherry picked from commit 513446b6d1)
2021-11-09 13:52:41 +01:00
Arnaud Cogoluègnes ba5cfb1bae
Use version range for stream client Maven dependency
In test suite. Note a snapshot for 1.0-SNAPSHOT has been
pushed by mistake a while ago, so this one must be
excluded. It's unlikely it will be erased, as the snapshots
for the first stable version should be 1.0.0-SNAPSHOT.
2021-11-03 14:05:23 +01:00
Michael Klishin 40db671e0b
Merge pull request #3633 from wrobell/rabbitmq-streams-doc-protocol-hex
Use hex values in RabbitMQ Streams protocol description
2021-11-02 21:58:42 +03:00
wrobell 08c417fdb7 Use hex values in RabbitMQ Streams protocol description
The protocol documentation uses decimal values for error and request key
codes.

Let's use hex values instead. This helps when looking at a request and
its response - 0x0006 and 0x8006 vs. 6 and 32774.

Also, when looking at output of protocol analysis tools like Wireshark,
a hexadecimal value will be printed, for example:

    "Nov  1, 2021 23:05:19.395825508 GMT","60216,5552","00000009000600010000000701"
    "Nov  1, 2021 23:05:19.396069528 GMT","5552,60216","0000000a80060001000000070001"

Above, we can visually identify delete publisher request and response
(0x0006 and 0x8006) and easily match them in the documentation of the
protocol.

Finally, above argument applies to logging as it is common to log
hex values, not decimal.
2021-11-02 18:31:30 +00:00
Philip Kuryloski 76287fb30c format with bazel files with buildifier 2021-11-02 18:24:26 +01:00
wrobell e74823d68c Fix use of "RabbitMQ Streams" in protocol documentation
The following RabbitMQ page uses "RabbitMQ Streams" or "streams",
therefore use it in the protocol documentation as well

    https://blog.rabbitmq.com/posts/2021/07/rabbitmq-streams-overview
2021-10-29 19:06:06 +01:00
wrobell 57ff5dbf4a Fix RabbitMQ Streams protocol documentation
1. Response for publisher declaration request does not contain
   publisher id.

2. Add mechanism entry to the details of SASL handshake request.

3. SASL handshake response contains list of mechanisms, not just single
   mechanism.
2021-10-28 17:53:22 +01:00
Arnaud Cogoluègnes c0f1e23b17
Disable stream test in mixed versions mode
Not worth testing in this mode, as the stream plugin
does not start without the stream_queue feature flag.
2021-10-20 15:16:45 +02:00
Arnaud Cogoluègnes 030a08fa54
Enable stream_queue flag with env variable in test suite
For mixed version mode, where feature flags are
not explictely enabled.
2021-10-20 15:08:05 +02:00
Arnaud Cogoluègnes d87fa91a52
Enable stream_queue flag in test suite
For mixed version mode, where feature flags are
not explictely enabled.
2021-10-20 14:55:54 +02:00
Arnaud Cogoluègnes 6aabfdbbb4
Format stream plugin 2021-10-20 14:53:08 +02:00
Michael Klishin 2140562209
Merge pull request #3562 from rabbitmq/disable_stream_plugin_3557
Disable the stream_plugin if stream feature flag is not enabled
2021-10-14 18:45:26 +03:00
Arnaud Cogoluègnes 6d0dc3f6b4
Attach add/delete super stream command to streams scope only
Not to ctl.

References #3503
2021-10-14 17:09:18 +02:00
Michael Klishin 2fbc5fab25
Formatting, wording 2021-10-14 17:20:59 +03:00
Gabriele Santomaggio f2df98aef9 change message 2021-10-13 12:01:21 +02:00
Gabriele Santomaggio 2eb625531d Disable the stream_plugin and stream management if the feature flag
is not enabled.
fixes https://github.com/rabbitmq/rabbitmq-server/issues/3557
2021-10-13 11:59:11 +02:00
Gabriele Santomaggio c270ebf037 Disable the stream_plugin if the feature flag
is not enabled.
fixes https://github.com/rabbitmq/rabbitmq-server/issues/3557
2021-10-12 19:09:34 +02:00
Arnaud Cogoluègnes 6b9589bae4
Handle stream arguments in add_super_stream command
max-age, leader-locator, etc.
2021-10-11 16:50:03 +02:00
Arnaud Cogoluègnes ecbd969834
Embed RPC call function in test 2021-10-11 16:50:02 +02:00
Arnaud Cogoluègnes 8ae60bef73
Fix group spec in test 2021-10-11 16:50:02 +02:00
Arnaud Cogoluègnes b0bd5f8a00
Add delete_super_stream CLI command 2021-10-11 16:50:02 +02:00
Arnaud Cogoluègnes a73b1a3d0d
Add add_super_stream CLI command 2021-10-11 16:50:01 +02:00
Arnaud Cogoluègnes 147659093f
Add functions to create/delete super stream in manager 2021-10-11 16:50:01 +02:00
Michael Klishin 72c2e152ef
Merge pull request #3499 from rabbitmq/cla-url
Update CLA URL
2021-10-01 00:16:03 +03:00
Arnaud Cogoluègnes e8d0d380a2
Bump dependencies in stream Java tests 2021-09-28 14:02:10 +02:00
Arnaud Cogoluègnes fc80138204
Fallback to rabbit_stream:host/0 if advertised_tls_host not set
The advertised_host must also be tried for TLS connections.

References #3514
2021-09-28 14:00:41 +02:00
Carl Hörberg 52791c677b
Support for advertising different hostname for TLS stream connections
Use case: Allow plain connections over one (internal IP), and TLS
connections over another IP (eg. internet routable IP). Without this
patch a cluster can only support access over one or the other IP, not
both.

(cherry picked from commit b9e6aad035)
2021-09-28 13:47:22 +02:00
Michal Kuratczyk 1a2126676d Update CLA URL 2021-09-23 14:29:36 +02:00
Michael Klishin 0f6a9dac27
Introduce rabbit_nodes:all/0 2021-09-20 22:24:25 +03:00
Arnaud Cogoluègnes ab2c565b49
Merge pull request #3423 from rabbitmq/streams-sort-partitions
Sort stream partitions using binding parameter
2021-09-15 14:56:17 +02:00
Arnaud Cogoluègnes faee72552a
Polish test 2021-09-15 11:56:53 +02:00
Arnaud Cogoluègnes 4bbed58352
Add Bazel rule for rabbit_stream_utils_SUITE 2021-09-15 11:38:17 +02:00
Arnaud Cogoluègnes 5b83dceb87
Return only streams for partition-related commands
The stream partition metadata is based on bindings,
so we make sure to return only streams from the binding
information.
2021-09-15 11:33:04 +02:00
Arnaud Cogoluègnes b140395864
Fall back to HOSTNAME(1) in stream Java test suite
In case the Java way fails (only on new CI).
2021-09-15 10:36:27 +02:00
Arnaud Cogoluègnes 04a0653571
Sort stream partitions using binding parameter
If present. To make the partition order stable.
2021-09-14 18:02:22 +02:00
Michael Klishin c8d483809e
Resolve a missed conflict 2021-09-13 20:33:11 +03:00
Michael Klishin f79bc1c935
Merge branch 'master' into stream-reader-close-in-terminate
Conflicts:
	deps/rabbitmq_stream/src/rabbit_stream_reader.erl
2021-09-13 20:27:58 +03:00
Arnaud Cogoluègnes 8f207e3c5f
Make stream protocol route command return several streams
We expect to have 1 stream for each routing key, but
as binding can return several queues for a given key we
let that possibility open in the stream protocol.
2021-09-13 17:53:25 +02:00
Karl Nilsson 9e4506041d fix build warnings 2021-09-13 11:38:41 +01:00
Karl Nilsson 135575b3ff Stream reader: close osiris logs and sockets in terminate
Instead of injecting it into varios places inside the code.

When the osiris log is closed it will decrement the global "readers"
counter which is why it is much safer to do this in terminate.
2021-09-13 11:23:35 +01:00
Karl Nilsson 3b1714cbe3 formatting 2021-09-10 15:26:26 +01:00
Karl Nilsson f10db03b4d Gracefully terminate stream reaader
when the client forcefully terminates TCP connection

Also improve logging.
2021-09-10 15:24:29 +01:00
Karl Nilsson d6301a3e11 Handle closed connections in stream reader
and throw and stop gracefully.
2021-09-10 10:15:59 +01:00
Karl Nilsson 3513fa0ea8 rabbitmq_stream formatting 2021-09-09 09:45:13 +01:00
Federico Caprari 2246727428
Fix store offset parameters
As you can see 860333a088/deps/rabbitmq_stream_common/src/rabbit_stream_core.erl (L239)

There is the stream name and not the subscription id in this message.
2021-09-01 22:13:07 +02:00
Arnaud Cogoluègnes 902fa429dd
Use awaitMatch to check global counters
Assertion fails on CI environment.
2021-09-01 09:51:06 +02:00
Karl Nilsson c240ec2985
Fix function_clause error in stream reader
When the server initiate connection close.
2021-08-31 15:29:16 +01:00
Gerhard Lazu 6c0ba03d61
Test that we start from 0 publishers & consumers
Pair: @kjnilsson

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-08-31 15:29:16 +01:00
Gerhard Lazu 0ecf3d4eeb
Test stream publisher & consumer counters
Pair: @kjnilsson

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-08-31 15:29:16 +01:00
Gerhard Lazu dad0025088
Perform stream reader cleanup in terminate
Otherwise metrics will not get cleaned up correctly when processes crash.

It's also tidier to do this in a single place, in terminate/3

Pair: @kjnilsson

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-08-31 15:29:15 +01:00
Arnaud Cogoluègnes 8dc024089c
Bump dependencies in Java stream tests 2021-08-31 08:32:53 +02:00
Michael Klishin ace3ee9cd9
Bump Java stream client used in tests 2021-08-10 11:32:57 +03:00
Michael Klishin 2d3f31eb21
Merge pull request #3204 from rabbitmq/keep-state-and-data
Use keep_state_and_data
2021-07-27 21:39:06 +03:00
David Ansari e3ed9c21b0 Fix list_stream_publishers additional usage output 2021-07-22 18:13:07 +02:00
Karl Nilsson f38c023aa8
Correct Publish frame docs 2021-07-21 09:13:55 +01:00
Michael Klishin 0d06f34c66
rabbit_stream_reader: convert most log messages to debug ones 2021-07-21 01:38:13 +03:00
Gabriele Santomaggio 71c355c963
Fix links 2021-07-20 17:42:56 +02:00
David Ansari 644335de86 Use keep_state_and_data 2021-07-20 16:11:22 +02:00
Gabriele Santomaggio de0f7952e9 Add resources link
to client guide line and streams internals
2021-07-20 09:55:25 +02:00
Gabriele Santomaggio 84f51d7926 Remove project maturity warning 2021-07-20 09:00:11 +02:00
Michael Klishin e20bca44cc
rabbit_stream_reader: these should not be logged at info level 2021-07-20 00:55:40 +03:00
Michael Klishin 70ebefc0f2
rabbit_stream: ignore escript and sbin 2021-07-19 20:26:16 +03:00
Michael Klishin 532d076907
Merge pull request #3194 from rabbitmq/stream-reader-state-timeouts
Add stream reader state timeouts
2021-07-19 20:16:04 +03:00
David Ansari 863b899079 Remove TEST macro
since it fails with Bazel.

As discussed with @pjk25, let's set this value via application env,
make it configurable to the test, but not configurable to the user.
2021-07-19 16:42:54 +02:00
David Ansari 13b03b8530 Remove unused variable warning 2021-07-19 14:36:22 +02:00
David Ansari 4053f729dd Rename STATE_TIMEOUT to CONNECTION_NEGOTIATION_STEP_TIMEOUT 2021-07-15 20:56:56 +02:00
David Ansari 694804d0d2 Add timeout reason to log message 2021-07-15 20:53:46 +02:00
David Ansari 3964da37b4 Close TCP connection when stream reader times out
Add state timeouts.
If the client takes more than 10s for a single step in the authentication
protocol, make the server close the TCP connection.

Also close the TCP connection if the server times out in state
close_sent. That's the case when the client sends an invalid command
(after successful authentication), the server requests the client to
close the connection, but the client doesn't respond anymore.
2021-07-15 19:29:24 +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
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 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +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 8421100008 Use bazel-erlang semi-automatic suite sharding 2021-07-09 10:05:16 +02:00
Arnaud Cogoluègnes 8ddff0faf8
Use "store" instead of "commit" for offset tracking 2021-07-08 11:28:33 +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
Arnaud Cogoluègnes f9867f1f82
Add uncompressed size field for pub ids generation 2021-07-05 16:22:21 +02:00
Paweł Chmielowski d5daf7598b Extract TLS informations that are delivered in PROXY protocol frame 2021-07-05 13:29:59 +02:00
Arnaud Cogoluègnes be9cc22dc1
Add uncompressed size in stream sub-entry 2021-07-02 16:19:47 +02: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
dcorbacho b636ad2565 Rename protocol error counters to _total 2021-06-30 12:46:41 +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
dcorbacho 228ea40e34
Gauges for global publishers & consumers metrics 2021-06-29 08:10:42 +01: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
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
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
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 bb75157fc1 Mark deps/rabbitmq_stream:commands_SUITE as flaky 2021-06-24 12:56:20 +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
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
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 eea51a7e3a Mark additional suites as flaky 2021-06-17 13:42:22 +02:00
Philip Kuryloski a3bffb4d18 Fixup bazel compilation for rabbitmq_stream_common 2021-06-14 10:07:49 +02:00
dcorbacho 38f474688f Stream common library 2021-06-11 17:24:00 +02: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
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
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 7407a5a100 Apply policy in rabbit_queue_type 2021-06-07 12:30:33 +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 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
dcorbacho 65c9dae53f Fix properties binary construction 2021-05-28 15:45:19 +02: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 2ab5cb22ca
Expose TLS info for stream connections (CLI, REST API) 2021-05-27 10:43:33 +02: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
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
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
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
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
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
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
Arnaud Cogoluègnes c30e013d7a
Rename max-segment-size to stream-max-segment-size-bytes 2021-05-20 10:16:19 +02:00
Arnaud Cogoluègnes c42930acb0
Set stream plugin default port to 5552 2021-05-19 15:38:52 +02:00
Karl Nilsson ef52b92390 Make stream consumer arg parsing return error
when receiving unexpected input
2021-05-19 12:00:10 +01: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
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
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 7a32a4483f
Use ~0p to print map on one line 2021-05-18 14:52:12 +02: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
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
Philip Kuryloski e6df6615e1 Futher bazel file refactoring and deduplication 2021-05-11 16:15:33 +02:00
Philip Kuryloski a9159834e7 Add rabbitmq_stream to bazel 2021-05-06 12:27:42 +02:00
Arnaud Cogoluègnes 787b46e3a1
Propagate advertised host and port to client 2021-05-03 10:32:33 +02:00
Arnaud Cogoluègnes e3c4c9a471
Use stream leader to query offset 2021-04-27 15:38:21 +02:00
Arnaud Cogoluègnes e4307b6180
Adapt stream code to osiris tracking types introduction 2021-04-27 09:44:59 +02:00
Arnaud Cogoluègnes 39f8be929d
Block stream publishing on disk alarm 2021-04-20 16:49:01 +02:00
Arnaud Cogoluègnes 5d218b85cf
Remove stream plugin instructions
No longer valid, use the usual process to run a plugin.
2021-04-16 20:20:20 +02:00
kjnilsson 9bd02b3510 Make streams compatible with osiris API changes
In osiris:init_reader
2021-04-13 15:02:32 +01:00
Arnaud Cogoluègnes c70de74c5e
Handle "undefined" PID when writing osiris tracking 2021-04-09 15:45:28 +02:00
Arnaud Cogoluègnes 88154a72d0
Handle closed osiris reader when dispatching chunk 2021-04-09 15:26:06 +02:00
Arnaud Cogoluègnes 23aee072eb
Handle creation of stream with different parameters 2021-04-08 15:50:51 +02:00
Arnaud Cogoluègnes 3b69f4b630
Handle 4 reserved bytes in osiris chunk
References rabbitmq/osiris#22
2021-03-30 09:45:29 +02:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
kjnilsson 52f745dcde Update rabbitmq-components.mk
use v1.x branch of ra
2021-03-18 15:14:40 +00:00
Karl Nilsson 1b7379d266
Merge pull request #2876 from rabbitmq/stream-coord-refactor
Stream Coordinator refactor
2021-03-16 11:10:44 +00:00
Arnaud Cogoluègnes e46216b5a8 Check PID on leader lookup in stream plugin
To make sure the PID is alive, as the mnesia record can stale after a
failure.

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

Co-authored-by: Karl Nilsson <kjnilsson@users.noreply.github.com>
2021-03-12 15:04:40 +00:00
Arnaud Cogoluègnes e80db9d46a Adapt stream plugin after coordinator refactoring
Do not use mnesia record for topology info, use coordinator instead.
2021-03-12 15:04:35 +00:00
Loïc Hoguin d5e3bdd623
Add ADDITIONAL_PLUGINS variable
This allows including additional applications or third party
plugins when creating a release, running the broker locally,
or just building from the top-level Makefile.

To include Looking Glass in a release, for example:

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

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

$ make docker-image

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

To run the broker with Looking Glass available:

$ make run-broker ADDITIONAL_PLUGINS="looking_glass"

This commit also moves Looking Glass dependency information
into rabbitmq-components.mk so it is available at all times.
2021-03-12 12:29:28 +01:00
Michael Klishin 97ff62d3b2
Drop trailing newlines from logged messages where possible
Lager strips trailing newline characters but OTP logger with the default
formatter adds a newline at the end. To avoid unintentional multi-line log
messages we have to revisit most messages logged.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The Erlang builtin console/file handler, `logger_std_h`, has been forked
because it lacks date-based file rotation. The configuration of
date-based rotation is identical to Lager. Once the dust has settled for
this feature, the goal is to submit it upstream for inclusion in Erlang.
The forked module is calld `rabbit_logger_std_h` and is based
`logger_std_h` in Erlang 23.0.
2021-03-11 15:17:36 +01:00
Michael Klishin 570eb509c2
Naming 2021-03-10 07:45:49 +03:00
dcorbacho e0d567828f Update ranch supervisor structure on list/0 command 2021-03-09 23:17:03 +01:00
dcorbacho 61f7b2a723 Update to ranch 2.0 2021-03-08 23:11:05 +01:00
Michael Klishin b6c4831e75
Bump Lager to 3.9.1 2021-03-04 04:36:39 +03:00
Loïc Hoguin 66ac1bf5e9
Bump observer_cli to 1.6.1
More responsive when the system is overloaded with file calls.
2021-03-01 21:55:27 +03:00
Arnaud Cogoluègnes 15ebf7c87a
Add comment 2021-03-01 21:55:25 +03:00
Arnaud Cogoluègnes 68478c5fc2
Use unsigned ints in stream protocol, when appropriate 2021-03-01 21:55:25 +03:00
Arnaud Cogoluègnes 076bb22bd0
Start constants at 1 for stream plugin 2021-03-01 21:55:24 +03:00
Arnaud Cogoluègnes ad0a2cd1b9
Use MSB in keys to distinguish requests/responses
In stream protocol.
2021-03-01 21:55:24 +03:00
Michael Klishin 8fe3df9343
Upgrade Lager to 3.9.0 for OTP 24 compatibility
`lager_util:expand_path/1` use changes are
due to erlang-lager/lager#540
2021-02-26 00:52:15 +03:00
Arnaud Cogoluègnes b39f4a6d1d
Set stream plugin default port to 5551
Instead of 5555, which is already registered.
2021-02-25 18:16:32 +01:00
Arnaud Cogoluègnes d70b55aa0c
Add route and partitions command to stream plugin
For publishing to super streams.
2021-02-25 17:22:42 +01:00
Michael Klishin f73e851f9c
Bump observer_cli to 1.6.0 2021-02-24 12:53:55 +03:00
Michael Klishin a5098b28a7
Bump Lager to 3.8.2 for OTP 24 compatibility 2021-02-24 12:53:30 +03:00
Arnaud Cogoluègnes 047e87137c
No global response code for metadata in stream protocol 2021-02-22 15:24:24 +01:00
Arnaud Cogoluègnes 9696861181
Fix stream protocol documentation after review 2021-02-22 15:19:58 +01:00
Arnaud Cogoluègnes b61be1e409
Mention stream protocol responses can have extra info 2021-02-22 11:42:34 +01:00
Arnaud Cogoluègnes 8868ad97b3
Add logging to stream subscription 2021-02-11 16:16:26 +01:00
Arnaud Cogoluègnes d63756ed67
Set correct offset metrics on stream consumer creation 2021-02-09 11:36:20 +01:00
Arnaud Cogoluègnes 3de198845f
Disable stream failure test 2021-01-27 17:54:35 +01:00
Arnaud Cogoluègnes b921ac11a8
Merge pull request #2712 from rabbitmq/rabbitmq-stream-prometheus
Add stream prometheus plugin
2021-01-27 16:46:37 +01:00
Arnaud Cogoluègnes 268bc7257c
Merge pull request #2729 from rabbitmq/rabbitmq-stream-consumers-in-queue-details
Report stream consumers as regular consumers in management
2021-01-27 16:06:59 +01:00
Arnaud Cogoluègnes ce7851b470
Disable stream failure test until coordinator is fixed 2021-01-21 16:35:13 +01:00
Arnaud Cogoluègnes 78b723d7c3
Report stream consumers as regular consumers in management
This helps to see that a queue is consumed from.

WIP
2021-01-20 15:36:16 +01:00
Arnaud Cogoluègnes e87581f14c
Remove unnecessary dependencies 2021-01-19 15:04:59 +01:00
Arnaud Cogoluègnes 2f903843e0
Add list_stream_publishers CLI command 2021-01-19 14:49:30 +01:00
Arnaud Cogoluègnes 1e6244990c
Add list_stream_consumers CLI command 2021-01-19 11:31:39 +01:00
Arnaud Cogoluègnes a559c79b8c
Add response codes to stream protocol page 2021-01-18 14:25:24 +01:00
Arnaud Cogoluègnes b5315c0166
Merge branch 'master' into rabbitmq-stream-prometheus 2021-01-18 11:26:06 +01:00
Arnaud Cogoluègnes 0d73b58be0
Re-order stream command constants
The order is more usage-oriented.
2021-01-18 11:25:21 +01:00
Arnaud Cogoluègnes 52aa2963f5
Bump test dependencies in stream plugins 2021-01-14 17:58:38 +01:00
Arnaud Cogoluègnes bf72683eb2
Add stream prometheus plugin 2021-01-11 16:49:56 +01:00
Arnaud Cogoluègnes 5f0df3bdb0
Format stream and stream management plugins code 2021-01-06 15:47:27 +01:00
Arnaud Cogoluègnes 07b9e68ff5
Add logs to some stream tests 2021-01-06 14:38:02 +01:00
dcorbacho fc88f3ba21 Check that the queue exists before calling declare
Rabbit channels are responsible of this check before calling declare,
skipping it on the manager meant that the queue was partly redeclared
and a new data directory created. The old one was still on disk with
a different timestamp, but from the user point of view the queue data
has been erased.
2020-12-23 12:18:33 +01:00
Arnaud Cogoluègnes c0bb7ec4a7
Add offset & consumed metrics to stream consumer 2020-12-15 15:37:26 +01:00
Arnaud Cogoluègnes c4d07467da
Merge branch 'master' into rabbitmq-stream-management 2020-12-09 12:00:56 +01:00
Arnaud Cogoluègnes 9a590647b3
Add chunk header parameter to send_file callback 2020-12-09 11:33:28 +01:00
Arnaud Cogoluègnes e5ed53c5e2
Merge branch 'master' into rabbitmq-stream-management 2020-12-08 11:41:22 +01:00
Arnaud Cogoluègnes 87837f857d
Fix failure tests in stream plugin 2020-12-08 11:40:38 +01:00
Arnaud Cogoluègnes 846b36bec6
Fix metrics table GC test in stream plugin 2020-12-08 09:47:38 +01:00
Arnaud Cogoluègnes 2b45d8635b
Add publisher reference to stream endpoint 2020-12-07 10:17:01 +01:00
Arnaud Cogoluègnes 1faeaad499
Add publisher REST endpoint to stream consumer management 2020-12-04 17:22:14 +01:00
Arnaud Cogoluègnes 224e9914b2
Merge branch 'master' into rabbitmq-stream-management 2020-12-04 10:26:42 +01:00
Arnaud Cogoluègnes c51e060a07
Wait longer for replicas to come up in stream plugin 2020-12-04 09:48:56 +01:00
Arnaud Cogoluègnes 88b4ddb6c2
Track publishers in stream plugin 2020-12-03 17:57:48 +01:00
Arnaud Cogoluègnes c14c9bb6da
Fix some dialyzer warnings in stream plugin 2020-12-03 10:09:29 +01:00
Arnaud Cogoluègnes 66867a4062
Add GC to stream consumer monitoring table 2020-12-02 18:12:45 +01:00
Arnaud Cogoluègnes 41160210ab
Start stream consumer REST endpoint 2020-12-01 18:23:22 +01:00
Arnaud Cogoluègnes 08891a734e
Merge branch 'master' into rabbitmq-stream-management 2020-11-30 09:42:54 +01:00
Arnaud Cogoluègnes 67308be13c
Remove stream field from publish command
Only the publisher ID is necessary now the publisher declaration is
mandatory before publishing.
2020-11-27 11:07:10 +01:00
Arnaud Cogoluègnes bfa541a095
Include publisher state management 2020-11-26 18:18:43 +01:00
Arnaud Cogoluègnes 8cf5fb0775
Enforce publisher ID uniqueness 2020-11-26 15:19:02 +01:00
Arnaud Cogoluègnes 59bc60fe36
Add query publisher sequence 2020-11-26 10:02:13 +01:00
Arnaud Cogoluègnes 9859714f0e
Declare publisher in stream test 2020-11-24 18:18:14 +01:00
Arnaud Cogoluègnes 8f97ea400a
Start adding publishing dedup support for streams 2020-11-24 17:48:41 +01:00
Arnaud Cogoluègnes 584811582b
Add first tests for stream management
They are using Java to have a proper stream client.
2020-11-23 11:23:29 +01:00
Arnaud Cogoluègnes 580beb21bf
Include publish dedup in stream protocol 2020-11-20 11:43:04 +01:00
Arnaud Cogoluègnes c8249a304f
Filter stream connections where metrics are disabled
This implied defining the protocol field in tracked connection to be
able to filter out non-stream connections.
2020-11-20 09:29:55 +01:00
Arnaud Cogoluègnes e516aab737
Display only stream connections in plugin 2020-11-19 17:02:35 +01:00
Arnaud Cogoluègnes 23d7e8114c
Introduce stream management plugin 2020-11-19 14:48:25 +01:00
Arnaud Cogoluègnes 1ed8f76eed
Check if member processes are alive in metadata command
In case the Mnesia record is stale.
2020-11-17 10:15:09 +01:00
Arnaud Cogoluègnes 29e74cbfca Move some code to utils module 2020-11-05 15:33:13 +01:00
Arnaud Cogoluègnes fa586140d3 Call rabbit_log:warning/2 2020-11-03 18:04:22 +01:00
Arnaud Cogoluègnes d2eda4cb79 Update rabbitmq-components.mk 2020-11-03 14:27:50 +01:00
Arnaud Cogoluègnes 0f569d705a Return Erlang node long name in metadata
Fixes #2
2020-11-03 11:45:22 +01:00
Arnaud Cogoluègnes 2813356682 Use non_amqp_connection name for force_refresh_event 2020-10-23 15:37:07 +02:00
Arnaud Cogoluègnes a2f05f5b75 Support shutdown call from management plugin 2020-10-23 11:14:04 +02:00
Arnaud Cogoluègnes bd191cf40d Register connections and handle force_event_refresh
For existing connections that must emit stats when the management plugin
is enabled.

References rabbitmq/rabbitmq-server#2481
2020-10-23 10:17:39 +02:00
Arnaud Cogoluègnes bb510b0e14 Merge branch 'master' into management-integration
Conflicts:
	src/rabbit_stream_manager.erl
2020-10-22 15:41:42 +02:00
Arnaud Cogoluègnes dd8b3ea008 Check stats timer in listen loop 2020-10-22 14:27:06 +02:00
Arnaud Cogoluègnes 43898e59b1 Support max-age in stream creation 2020-10-22 13:42:33 +02:00
Arnaud Cogoluègnes a1f6006356 Support leader locator strategies
References rabbitmq/rabbitmq-server#2471
2020-10-21 15:25:31 +02:00
Arnaud Cogoluègnes 20681aca63 Add event notification during authentication 2020-10-20 18:20:03 +02:00
Arnaud Cogoluègnes 184f177d78 Emit stats for management
WIP
2020-10-20 15:09:34 +02:00
Arnaud Cogoluègnes cc030ac195 Support initial-cluster-size argument on creation
See rabbitmq/rabbitmq-server#2467
2020-10-16 14:07:19 +02:00
Arnaud Cogoluègnes b704e2f8ef Check stream name before creation
Should not start with "amq.", be empty. Strips also newline
and carriage return characters.
2020-10-16 11:22:16 +02:00
Arnaud Cogoluègnes 27d06e8021 Add CLI command to list stream connections 2020-10-16 09:18:36 +02:00
Arnaud Cogoluègnes 9e6008a362 Add rabbitmq_ct_client_helpers dependency 2020-10-12 17:58:42 +02:00
Arnaud Cogoluègnes c85f98cb7f Add ct_client_helpers dependency 2020-10-12 17:51:17 +02:00
Arnaud Cogoluègnes 685164be64 Add INI-type configuration support 2020-10-12 17:29:38 +02:00
Arnaud Cogoluègnes 4420c77e8b Set default heartbeat to 60 seconds 2020-10-12 16:05:34 +02:00
Arnaud Cogoluègnes 5e80aa9f39 Add correlation ID field in commit offset frame
Not used yet, but can avoid a command version change if the command
should have confirm response.
2020-10-02 14:16:22 +02:00
Arnaud Cogoluègnes b8bdb5ae7b Bump dependencies in Java test suite
And apply Google Java Format with Maven Spotless plugin.
2020-09-29 12:05:29 +02:00
Arnaud Cogoluègnes 03a11e0771 Adapt failure tests
They are a bit more defensive. The subscription is also now more
reliable by returning a stream-not-available code if necessary.

Using also Aten poll interval to 1 second (bumped to 5 seconds in master
now).
2020-09-29 11:29:56 +02:00
Arnaud Cogoluègnes 04e981e9e6 Use rabbit_durable_queue to check if stream exists
This is done after checking rabbit_queue and if it returns that the
queue does not exist. The coordinator may be recovering the queue, so
thanks to this double check we know the queue exists but is not
available, instead of thinking it does not exist at all.
2020-09-17 09:30:20 +02:00
Arnaud Cogoluègnes cf5e99cd29 Add offset tracking commands 2020-09-15 17:52:05 +02:00
Arnaud Cogoluègnes c25d89d67a Adapt test to additional chunk type field in chunk 2020-09-03 13:46:57 +02:00
Arnaud Cogoluègnes 21d9aea96c Add publisher ID 2020-09-02 15:13:37 +02:00
Arnaud Cogoluègnes b2f30a55ba Use byte for sub ID in credit notification 2020-09-01 18:14:07 +02:00
Arnaud Cogoluègnes 9a788362dd Change sub ID to byte in protocol reference 2020-09-01 18:13:41 +02:00
Arnaud Cogoluègnes db93e14932 Use byte for subscription ID
Instead of integer. This is to be consistent with the introduction of a
similar ID for publishers (which will be a byte as well).
2020-09-01 18:07:27 +02:00
Arnaud Cogoluègnes ea2636cbb3 Add debug log during deletion 2020-08-07 16:43:34 +02:00
Arnaud Cogoluègnes 58f6ebff2e Refactor Java tests after Client package change 2020-08-06 14:01:02 +02:00
Arnaud Cogoluègnes 40f2db4291 Add function to kill connection based on name
For test purposes.
2020-08-05 14:43:07 +02:00
Arnaud Cogoluègnes 02d87cab5d Fix frame reading in test 2020-07-23 11:40:20 +02:00
Arnaud Cogoluègnes a886cd8872 Send heartbeat from the reader process
If the heartbeat frame is sent from a dedicated process, it interleaves
between 2 socket calls from the reader process. Frames are typically
sent in one call, so this is fine, but a chunk is delivered with 2
calls, one for the frame header and one send_file for the chunk. So the
heartbeat frame can sneak in between these 2 calls, which makes clients
fail to parse frames.
2020-07-10 09:42:00 +02:00
Arnaud Cogoluègnes 92ebb825cb Handle error case when creating a stream 2020-07-10 09:24:24 +02:00
Arnaud Cogoluègnes 7740fee13e Pass in monitor reference, not stream name 2020-07-09 11:33:44 +02:00
Arnaud Cogoluègnes 4714f682e5 Add consumer failure test
The node the consumer is connected to fails, the consumer connects
and starts consuming where it left off.
2020-07-06 17:42:46 +02:00
Arnaud Cogoluègnes 4f01776a65 Add publishing failure test
Stream leader node fails while publisher is publishing, publisher
reconnects on the new leader. A consumer should read all the confirmed
messages afterwards.
2020-07-03 16:10:38 +02:00
Arnaud Cogoluègnes af2dcf7f57 Handle publishing sub-entries (batch) 2020-06-30 17:29:28 +02:00
Arnaud Cogoluègnes 1597bdf14a Disable failure test 2020-06-29 10:51:31 +02:00
Arnaud Cogoluègnes 7270125c0b Fix closing sequence
When server sends close, it would not listen on the socket for the
client confirmation.
2020-06-26 16:33:39 +02:00
Arnaud Cogoluègnes 30e51ca4cb Add failure test 2020-06-25 16:25:02 +02:00
Arnaud Cogoluègnes 4a05b6b62a Ignore non-responding brokers in metadata command 2020-06-25 15:32:33 +02:00
Arnaud Cogoluègnes 1d3978ae40 Change response code label
From "stream deleted" to "stream not available". It covers now the
deletion of a stream and the unavailibility due to a failure. This is up
to the client to find out what to do (typically send a metadata request
about the stream and see if it's still there).
2020-06-23 10:51:34 +02:00
Arnaud Cogoluègnes 7b3d8c4ad0 Use Erlang monitor to detect stream deletion/failure 2020-06-22 18:33:54 +02:00
Arnaud Cogoluègnes 5bd352737c Pass in node information to Java test suite 2020-06-22 16:35:07 +02:00
Arnaud Cogoluègnes 2fd743f2bd Add credit response to protocol reference 2020-06-19 15:27:46 +02:00
Arnaud Cogoluègnes f8074a9f93 Notify client when it credits an unknown subscription 2020-06-19 15:19:39 +02:00
Arnaud Cogoluègnes 27c4e1e707 Add authorisation on publishing 2020-06-18 17:00:02 +02:00
Arnaud Cogoluègnes 5f69ef7cf7 Add authorisation for subscription 2020-06-18 16:13:14 +02:00
Arnaud Cogoluègnes 397c5ca078 Add authorisation for creation/deletion 2020-06-18 15:25:50 +02:00
Arnaud Cogoluègnes 3c18498734 Clean manager listener code
Now the manager uses the coordinator to know about deleted streams.
2020-06-18 10:57:01 +02:00
Arnaud Cogoluègnes ad165d78da Adjust licensing 2020-06-18 09:44:30 +02:00
Arnaud Cogoluègnes a1314a13c9 Use coordinator to get notified on stream deletion 2020-06-18 08:58:59 +02:00
Arnaud Cogoluègnes 625eaec004 Use rabbit_log 2020-06-15 11:17:27 +02:00
Arnaud Cogoluègnes 50581b2255 Fix cluster tests 2020-06-11 18:12:31 +02:00
Arnaud Cogoluègnes 157808ca8f Make max_frame consistent between makefile and application 2020-06-11 16:53:14 +02:00
Arnaud Cogoluègnes d3aa774156 Add Java-based tests for clustering 2020-06-11 15:38:07 +02:00
Arnaud Cogoluègnes 6a07d385ae Add specs t stream manager 2020-06-11 11:05:02 +02:00
Arnaud Cogoluègnes bb5efad9ef Fix dialyzer errors 2020-06-10 18:13:55 +02:00
Arnaud Cogoluègnes 76162b18a2 Add type specifications 2020-06-10 16:24:18 +02:00
Arnaud Cogoluègnes 19a1eb4013 Remove some unnecessary comments 2020-06-10 15:06:51 +02:00
Arnaud Cogoluègnes 16288a2596 Separate changing state from (almost) immutable state 2020-06-10 15:04:31 +02:00
Arnaud Cogoluègnes c39852fa72 Introduce PeerProperties command
To exchange client/server properties at the beginning of the connection.
2020-06-10 10:42:29 +02:00
Arnaud Cogoluègnes d2a29c5aef Support client properties 2020-06-09 17:48:23 +02:00
Arnaud Cogoluègnes 121f0e3575 Improve readme 2020-06-09 13:53:49 +02:00
Arnaud Cogoluègnes 6ef10c8573 Use MPL 2.0 2020-06-08 09:54:33 +02:00
Arnaud Cogoluègnes a56cf4013c Support first/last/next/offset/timestamp offset spec 2020-06-02 16:35:00 +02:00
Arnaud Cogoluègnes 9536d74f9d Update link to osiris for data format 2020-06-02 11:13:19 +02:00
Arnaud Cogoluègnes ecf47a8a42 Fix typo 2020-06-02 10:47:46 +02:00
Arnaud Cogoluègnes 2ab7e864dc Consume from a local member 2020-05-28 11:59:13 +02:00
Arnaud Cogoluègnes efc6fbc089 Add advertised host/port settings
This allows to communicate whatever it's appropriate to clients when
they issue the metadata command.
2020-05-28 10:47:30 +02:00
Arnaud Cogoluègnes 2f8559ae41 Polish documentation 2020-05-25 17:56:02 +02:00
Arnaud Cogoluègnes 838ef21b0d Document authentication sequence 2020-05-25 17:53:34 +02:00
Arnaud Cogoluègnes 4faa853b00 Fix link in documentation 2020-05-25 17:04:00 +02:00
Arnaud Cogoluègnes 0f86e54b61 Cover all commands in protocol documentation 2020-05-25 17:02:43 +02:00
Arnaud Cogoluègnes b7f70c6598 Fix links in documentation 2020-05-25 15:57:16 +02:00
Arnaud Cogoluègnes 848c95a181 Start documenting protocol 2020-05-25 15:55:51 +02:00
Arnaud Cogoluègnes b54026aa32 Add arguments for stream creation
To handle retention settings.
2020-05-19 18:18:30 +02:00
Arnaud Cogoluègnes 55adca1b44 Make sure queue is stream queue 2020-05-07 11:00:45 +02:00
Arnaud Cogoluègnes c2e35eb55f Use stream coordinator to manage streams 2020-05-06 17:35:41 +02:00
Arnaud Cogoluègnes 2d19e85925 Use stream instead of target 2020-05-06 09:15:16 +02:00
Arnaud Cogoluègnes b61a79b9ff Credit value is signed 2020-04-03 11:00:35 +02:00
Arnaud Cogoluègnes 204f61399b Handle client heartbeat 2020-04-01 10:08:32 +02:00
Arnaud Cogoluègnes 8c97d442ce Add heartbeat 2020-03-31 14:43:06 +02:00
Arnaud Cogoluègnes ece2a4770f Refactoring before introducing heartbeat
Introduce a level of supervisors to have a parent PID for the heartbeat
process.
2020-03-31 10:12:35 +02:00
Arnaud Cogoluègnes b693f71c5d Add todo task 2020-03-30 17:46:27 +02:00
Arnaud Cogoluègnes 47d46d145b Send close when client sends frame too large 2020-03-30 15:18:57 +02:00
Arnaud Cogoluègnes e899bdfb3e Refactor tune
Use int32 for both max frame size and bump max frame size to 1 MB.
2020-03-27 15:55:57 +01:00
Arnaud Cogoluègnes 670f5f639b Add test for close 2020-03-27 09:26:02 +01:00
Arnaud Cogoluègnes 9667525cd7 Update test for opening sequence 2020-03-26 17:52:54 +01:00
Arnaud Cogoluègnes 4e035dfbdb Add support to send close 2020-03-26 16:56:53 +01:00
Arnaud Cogoluègnes a26962cfcb Handle close command from client 2020-03-26 14:52:19 +01:00
Arnaud Cogoluègnes 7c33112f25 Check virtual host access in open 2020-03-26 09:53:28 +01:00
Arnaud Cogoluègnes 728a017f9e Add skeleton for tune and open 2020-03-25 17:06:04 +01:00
Arnaud Cogoluègnes 1fd5270d01 Use constants in tests 2020-03-25 10:22:16 +01:00
Arnaud Cogoluègnes b84de96d0b Add test for authentication 2020-03-25 10:08:10 +01:00
Arnaud Cogoluègnes 55a836b488 Refactor to pre/post authentication frame handling 2020-03-24 17:42:10 +01:00
Arnaud Cogoluègnes 6ae44768f3 Handle null binary in SASL authenticate 2020-03-24 16:40:05 +01:00
Arnaud Cogoluègnes 22dc72c9d9 Handle SASL authenticate 2020-03-24 11:47:50 +01:00
Arnaud Cogoluègnes e2f11fdafc Handle SASL handshake 2020-03-23 14:54:59 +01:00
Arnaud Cogoluègnes 1f42faeab8 Refactor after some Osiris changes 2020-03-23 10:48:46 +01:00
Arnaud Cogoluègnes 9f64d3d490 Add instructions to build and run 2020-03-17 11:37:04 +01:00
Arnaud Cogoluègnes 4e8a801e8d Add license information 2020-03-17 10:59:37 +01:00
Arnaud Cogoluègnes ab98aecd17 Initial import 2020-03-16 16:40:02 +01:00
Arnaud Cogoluègnes b9de5bc80b Initial commit 2020-03-16 16:21:18 +01:00