We already were using Cowlib 2.12.1 and therefore were
compatible with OTP-26. This simply updates Cowboy to
the version that depends on Cowlib 2.12.1.
This change should be reverted once emqx/emqtt is OTP26 compatible.
Our fork/branch isn't either at this point, but at least partially
works. Let's use this branch for now to uncover server-side OTP26
incompatibilities (and continue working on OTP26 support for emqtt of
course).
* Fetch all prod cli deps with bazel
This avoids issues with hex and OTP 26, and is needed for offline
bazel builds anyway
* Fetch test cli deps with bazel
* mix format
Previously osiris did not support uncorrelated writes which means
we could not use a "stateless" queue type delivery and these were
silently dropped.
This had the impact that at-most-once dead letter was not possible
where the dead letter target is a stream.
This change bumps the osiris version that has the required API
to allow for uncorrelated writes (osiris:write/2).
Currently there is no feature flag to control this as osiris writer
processes just logs and drops any messages they don't understand.
Returns reaching a Ra member that used to be leader but now has stepped
down would cause that follower to crash and restart.
This commit avoids this scenario as well as giving the return commands
a good chance of being resent to the new leader in a timeley manner.
(see the Ra release for this).
deps/rabbitmq_ct_helpers depends on proper and meck, so unfortunately
if proper and meck are marked as dev dependencies, bazel modules
depending on rabbitmq-server cannot build it
Another way of putting it is that they are not actually "dev"
dependencies of for all components that rabbitmq-server exposes
This Ra release includes improvements to Ra server GC behaviour when receiving a lot
of low priority commands with large binary payloads (e.g. quorum queue messages).
Practically this allows quorum queues to accept large amounts of messages in a more predicatble and performant manner.
This change also removes ra_file_handle cache that was used as a bridge between ra file operations and RabbitMQ io metrics. Lots of components in RabbitMQ such as streams and CQv2s do not record io metrics in the previous manner due to overhead incurred for every file io operation. These metrics are better inspected at the OS level anyway.
This Ra release
* Omproves election availability in certain mixed versions failure
scenarios
* Optimises segment reference compaction which may becomes expensive
in quorum queues with very long backlogs
* Various log message improvements and level tweaks
* Better cleans up machine monitor records after quorum queue rebalancing
* Add rabbitmq_cli dialyze to bazel
and fix a number of warnings
Because we stop mix from recompiling rabbit_common in bazel, many
unknown functions are reported, so this dialyzer analysis is somewhat
incomplete.
* Use erlang dialyzer for rabbitmq_cli rather than mix dialyzer
Since this resolves all of the rabbit functions, there are far fewer
unknown functions.
Requires yet to be released rules_erlang 3.9.2
* Temporarily use pre-release rules_erlang
So that checks can run on this PR without a release
* Fix additional dialyzer warnings in rabbitmq_cli
* rabbitmq_cli: mix format
* Additional fixes for ignored return values
* Revert "Temporarily use pre-release rules_erlang"
This reverts commit c16b5b6815.
* Use rules_erlang 3.9.2
* Add gazelle for use with update-repos command
* Use explicit BUILD.app_name files for erlang app deps
This allows us to remove the duplicate definitions in
workspace_helpers.bzl
These files are generated with gazelle. For instance:
BUILD.ra is generated with `bazel run gazelle -- update-repos
--verbose --build_files_dir=bazel hex.pm/ra@2.4.6`
Running gazelle this way will modify the WORKSPACE file, as gazelle
does not yet support MODULE.bazel files. Such changes to the WORKSPACE
can be dropped, and should not be committed. It may also update the
`moduleindex.yaml` file. Changes to `moduleindex.yaml` should be
committed.
However
* skip the explicit bazel/BUILD.osiris file, as osiris already contains the file in its repo
* skip the explict BUILD.inet_tcp_proxy_dist file, since the repo already contains a bazel BUILD.bazel file
gazelle command: `bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
inet_tcp_proxy_dist=github.com/rabbitmq/inet_tcp_proxy@master`
* jose is imported with `bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
jose=github.com/michaelklishin/erlang-jose@d63c1c5c8f9c1a4f1438e234b886de8607a0034e`
* Move the bats dep directly to WORKSPACE, drop workspace_helpers.bzl
* Use bzlmod in windows tests
Also change consumer credit top-ups to delay calling send_chunks until there is a "batch"
of credit to consume. Most clients at the time of writing send single credit updates after receiving each chunk so here we won't enter the send loop unless there are more than half the initial credits available.
osiris v1.4.3
Since 4.10.0 was released specifically to address an issue we
encountered in RabbitMQ integration with prometheus.erl, new test was
added to validate this functionality in the future.
Currently ra is not published to hex.pm with the bazel files that are
available when fetched directly from github, so additional hints must
be provided in the MODULE.bazel for now
This includes:
* async replica initialisation - making definitions import
and bulk restarts faster.
* Faster end of stream handling - lowering cpu use in clusters
with many low throughput streams
* Makes osiris binary string friendly so that paths do not have to be lists
anymore.
* Periodic max_age retention evaluation. Streams with max_age retention settings
are now re-evaluated every 1hr to reclaim disk space for streams that are idle but
have segments that only have old message data. Before retention would only be evaluated
when streams were written to and a new segment was opened.
When the version of osiris is a published version, there is no longer
a need to inject the git sha as its version. Other patches are no
longer needed now that osiris is caught up to the same rules_erlang
major.
The quality of auto-detection of properities of a hex dependency was
improved with bzlmod, thus in the MODULE.bazel file, ra is handled
correctly with no hints. In WORKSPACE.bazel/workspace_helpers.bzl,
this not the case, so a full build_file_content is needed.
Bazel 6, due this month, takes bzlmod out of experimental status, so I
don't expect to close up the difference between the systems.
The easier solution is to publish ra to hex.pm with the BUILD.bazel
file included, as it exists in the ra source, and is correct,
eliminating the need for any auto-generation of it when
imported/referenced by rabbitmq-server
If it's a dev dependency, projects that depend on rabbitmq-server as a
bzlmod module cannot borrow rabbitmq-server's platform definitions, as
the rbe repo won't be visible to rabbitmq-server in such a scenario
Since I force pushed to master branch of
https://github.com/ansd/emqtt, the old commit does
not belong to any branch anymore.
While Bazel is happy, make complains:
```
make -C deps/rabbitmq_mqtt ct
DEP emqtt (f6d7ddd391890f4db5f77c775e83cf0ffe3d2d76)
fatal: reference is not a tree: f6d7ddd391890f4db5f77c775e83cf0ffe3d2d76
```
The rabbitmq_mqtt tests used an outdated MQTT Erlang client.
It was a fork that has not been updated for > 4 years.
This commit upgrades the client to the latest version.
Therefore, we can delete our fork https://github.com/rabbitmq/emqttc.git
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
rules_erlang 3.2.0 fails the BCR ci due to recent breakage on the
bazel side, but works perfectly fine with rabbitmq-server
using our fork of the registry allows use to use 3.2.0 without an
override, which is convenient for our other projects that depend on
rabbitmq-server for testing
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