-
Notifications
You must be signed in to change notification settings - Fork 4k
Shovel: handle connection.(un)blocked messages
#6224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shovel: handle connection.(un)blocked messages
#6224
Conversation
|
Indeed in a mixed version cluster a new node can return a shovel status (flow or blocked) that an old node cannot format. There is also a failing test case in the shovel_management plugin suite that I need to fix. |
michaelklishin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds fail because rabbit_amqp091_shovel:reset_pending/1 is unused and our build system treats warnings in the RabbitMQ's own code as errors.
Once that is fixed, there are Dialyzer errors.
|
|
I will move the "report flow/blocked status" part to a separate PR as there are aspects of it I did not think of
|
6d7c296 to
246bd62
Compare
connection.(un)blocked messages and report flow/blocked statusconnection.(un)blocked messages
|
the |
|
CI uses Bazel. My build:local --@rules_erlang//:erlang_home=/path/to/otp/25.1
build:local --@rules_erlang//:erlang_version=25.1
build:local --//:elixir_home=/path/to/.kiex/elixirs/elixir-1.13.4/lib/elixir/
# rabbitmqctl wait shells out to 'ps', which is broken in the bazel macOS
# sandbox (https://github.com/bazelbuild/bazel/issues/7448)
# adding "--spawn_strategy=local" to the invocation is a workaround
build --spawn_strategy=local
# --experimental_strict_action_env breaks memory size detection on macOS,
# so turn it off for local runs
build --noexperimental_strict_action_env
build:buildbuddy --experimental_strict_action_env
# don't re-run flakes automatically on the local machine
build --flaky_test_attempts=1
build:buildbuddy --remote_header=x-buildbuddy-api-key=YOUR_API_KEY
# cross compile for linux (if on macOS) with rbe
# build:rbe --host_cpu=k8
# build:rbe --cpu=k8
build --@io_bazel_rules_docker//transitions:enable=false |
|
You can download build artifacts from the Build Buddy build results page. It takes a while to figure out what goes where at first but here are the target run results: for and then there are CT logs to download. |
|
Finally, if you want to switch to Bazel from erlang.mk, you have to either Bazel does not assume that external dependencies would be stored under |
|
The # this is WRONG and just an example, we want to add a test dependency of some kind
RUNTIME_DEPS = [
"//deps/amqp10_client:erlang_app",
"//deps/rabbitmq_top:erlang_app",
]fixed it for me. |
|
thank you very much for all the pointers and details, they are very helpful the use of |
|
Hm, the idea to add |
Also rework shovel credit_flow testcase to be more deterministic.
The pending queue can grow up to prefetch count (which is 1000 by default and can be more) while it is forwarded in chunks every time a bump_credit grants more credit to the shovel process (which is 200 by default). This change avoids trying to forward all pending entries just to put back most of them in the pending queue.
246bd62 to
68e931a
Compare
|
I removed the |
|
The change delay must have to do with the management UI minimum refresh rate but also the fact that credit flow can go in and out of effect dozens of times a second. I don't think we should discuss what to do with it in comments in a PR that intentionally ignores this part of Shovel behavior :) |
Shovel: handle `connection.(un)blocked` messages (backport #6224)
Proposed Changes
This is a follow-up of #5715 to allow a shovel to be blocked not just by credit-flow but also by an explicit
connection.blockedmessage. This is in hope so that less messages would be in flight in buffers (which can be lost if a connection is closed) when the destination cluster has resource alarms. This mostly targets on-publish mode, but works for the other ack-modes as well.(EDIT: the below part has been moved out of the scope of this PR
TODO make sure docs are up-to-date
Types of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.mddocumentFurther Comments