Commit Graph

37 Commits

Author SHA1 Message Date
Rin Kuryloski a944439fba Replace globs in bazel with explicit lists of files
As this is preferred in rules_erlang 3.9.14
2023-04-25 17:29:12 +02:00
Rin Kuryloski 854d01d9a5 Restore the original -include_lib statements from before #6466
since this broke erlang_ls

requires rules_erlang 3.9.13
2023-04-20 12:40:45 +02:00
Rin Kuryloski 8de8f59d47 Use gazelle generated bazel files
Bazel build files are now maintained primarily with `bazel run
gazelle`. This will analyze and merge changes into the build files as
necessitated by certain code changes (e.g. the introduction of new
modules).

In some cases there hints to gazelle in the build files, such as `#
gazelle:erlang...` or `# keep` comments. xref checks on plugins that
depend on the cli are a good example.
2023-04-17 18:13:18 +02:00
Rin Kuryloski 8a7eee6a86 Ignore warnings when building plt files for dependencies
As we don't generally care if a dependency has warnings, only the
target
2023-04-17 10:09:24 +02:00
Alexey Lebedeff 949b53543d Fix all dependencies for the dialyzer
This is the latest commit in the series, it fixes (almost) all the
problems with missing and circular dependencies for typing.

The only 2 unsolved problems are:

- `lg` dependency for `rabbit` - the problem is that it's the only
  dependency that contains NIF. And there is no way to make dialyzer
  ignore it - looks like unknown check is not suppressable by dialyzer
  directives. In the future making `lg` a proper dependency can be a
  good thing anyway.

- some missing elixir function in `rabbitmq_cli` (CSV, JSON and
  logging related).

- `eetcd` dependency for `rabbitmq_peer_discovery_etcd` - this one
  uses sub-directories in `src/`, which confuses dialyzer (or our bazel
  machinery is not able to properly handle it). I've tried the latest
  rules_erlang which flattens directory for .beam files, but it wasn't
  enough for dialyzer - it wasn't able to find core erlang files. This
  is a niche plugin and an unusual dependency, so probably not worth
  investigating further.
2023-02-13 17:37:44 +01:00
Rin Kuryloski a317b30807 Use improved assert_suites2 macro from rules_erlang 3.9.0 2023-01-18 15:07:06 +01:00
Alexey Lebedeff 2c4e4fb691 Fix all dialyzer warnings in rabbitmq_stream
There are some elixir-related messages about undefined functions, but
they don't produce warnings (yet).
2023-01-16 17:11:24 +01:00
Michael Klishin ec4f1dba7d
(c) year bump: 2022 => 2023 2023-01-01 23:17:36 -05:00
Rin Kuryloski 88a17b70ba Remove reference to non-existent module 2022-12-15 16:46:50 +01:00
Arnaud Cogoluègnes 0c1eeab92b
Fix keys for route and partitions responses
These 2 responses were not using the `rabbit_stream_core` utilities
so they were not using the "prefix" for responses.

Fixes #5956
2022-10-03 09:42:40 +02:00
Arnaud Cogoluègnes 93c33f2423
Rename StreamInfo to StreamStats
Other changes: returns a map of int64, use the new osiris:get_stats/1 API.

References #5412
2022-08-08 18:02:51 +02:00
Arnaud Cogoluègnes f223845d43
Keep stream_* return codes
To keep compatibility with the Erlang client's users.

References #5412
2022-08-03 16:46:22 +02:00
Arnaud Cogoluègnes 8687e73c7e
Add StreamInfo command to stream protocol
It returns general information on a stream, the first
and committed offsets for now.

Fixes #5412
2022-08-03 14:38:45 +02:00
Arnaud Cogoluègnes 95f3fdef19
Use "committed offset" instead of "last committed offset"
References #5307
2022-07-26 11:37:46 +02:00
Arnaud Cogoluègnes 9795727b9f
Include last committed offset in "deliver" stream command
Fixes #5307
2022-07-25 16:15:04 +02:00
Arnaud Cogoluègnes 67aac95f3e
Add exchange command versions command to stream plugin
References #5308
2022-07-25 16:15:03 +02:00
Philip Kuryloski 15a79466b1 Use the new xref2 macro from rules_erlang
That adopts the modern erlang.mk xref behaviour
2022-06-09 23:18:28 +02:00
Philip Kuryloski 327f075d57 Make rabbitmq-server work with rules_erlang 3
Also rework elixir dependency handling, so we no longer rely on mix to
fetch the rabbitmq_cli deps

Also:

- Specify ra version with a commit rather than a branch
- Fixup compilation options for erlang 23
- Add missing ra reference in MODULE.bazel
- Add missing flag in oci.yaml
- Reduce bazel rbe jobs to try to save memory
- Use bazel built erlang for erlang git master tests
- Use the same cache for all the workflows but windows
- Avoid using `mix local.hex --force` in elixir rules
  - Fetching seems blocked in CI, and this should reduce hex api usage in
    all builds, which is always nice
- Remove xref and dialyze tags since rules_erlang 3 includes them in
  the defaults
2022-06-08 14:04:53 +02:00
Loïc Hoguin dc70cbf281
Update Erlang.mk and switch to new xref code 2022-05-31 13:51:12 +02:00
Karl Nilsson 5ede74b448 Move all rebar.config files into the root directory
Some tools such as nvim + erlang_ls sometimes change the cwd if
they encounter a rebar.config. Here we move all rebar.config files
into the root of the project to avoid this and also have a single
point for formatting configuration.
2022-05-18 09:37:38 +01:00
Arnaud Cogoluègnes a1e92b82a0
Add active and activity_status to list_stream_consumers
References #3753
2022-05-09 10:52:33 +02:00
Arnaud Cogoluègnes 5ad9e349e0
Add list_stream_group_consumers CLI command
References #3753
2022-05-09 10:52:31 +02:00
Arnaud Cogoluègnes 434d7b5c54
Add colums argument to list_stream_consumer_groups
References #3753
2022-05-09 10:52:30 +02:00
Arnaud Cogoluègnes d5ae62b1a9
Handle single active consumer registration
WIP. Uses a simple in-memory coordinator for now.
No failover yet.

References #3753
2022-05-09 10:52:20 +02:00
Luke Bakken dba25f6462
Replace files with symlinks
This prevents duplicated and out-of-date instructions.
2022-04-15 06:04:29 -07:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
Arnaud Cogoluègnes 17d0ba9317
Return "no offset" (19) code when stored offset is undefined
Fixes #3783
2021-12-01 17:59:14 +01:00
Michal Kuratczyk 1a2126676d Update CLA URL 2021-09-23 14:29:36 +02: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 3eac3cf8a8 Remove unused load statements from bazel files 2021-07-12 12:10:26 +02:00
Arnaud Cogoluègnes 8ddff0faf8
Use "store" instead of "commit" for offset tracking 2021-07-08 11:28:33 +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
dcorbacho 7e5163690d Remove dependency from rabbit_common 2021-06-14 15:47:03 +02:00
Philip Kuryloski a3bffb4d18 Fixup bazel compilation for rabbitmq_stream_common 2021-06-14 10:07:49 +02:00
dcorbacho 38f474688f Stream common library 2021-06-11 17:24:00 +02:00