Repository navigation
A few related fixes around binding deletion - #17257
Merged
Merged
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
michaelklishin
force-pushed
the
rabbitmq-server-17255
branch
from
August 28, 2026 03:49
0fd45dd to
ac9eb33
Compare
michaelklishin
marked this pull request as draft
August 28, 2026 06:17
michaelklishin
force-pushed
the
rabbitmq-server-17255
branch
from
August 28, 2026 06:48
ac9eb33 to
b2a104d
Compare
Collaborator
Author
|
@dumbbell my first attempt turned out to have a regression, so I've left a comment in the part that had to be revisited. |
michaelklishin
marked this pull request as ready for review
August 29, 2026 02:49
With `tie_binding_to_dest_with_keep_while_cond` enabled, deleting the exchange record first makes Khepri cascade delete the routes where the exchange is the destination, so the subsequent binding query finds nothing: no `remove_bindings/3` callback, no `binding.deleted` events. Fixes #17255
The queue record delete cascades the routes where the queue is the destination. Derive the deletions from the delete's return value, using a new transaction-safe variant of `node_props_to_deletions/2` (renamed from `khepri_ret_to_deletions/2`). References #17255
The exchange subtree delete cascades all exchange-to-exchange routes before the fold can collect them. Derive the deletions from the delete's return value. References #17255
… exchanges on bind With the `tie_binding_to_dest_with_keep_while_cond` feature flag enabled, an auto-delete exchange is deleted by a `keep_while` condition on its record that requires at least one binding where it is the source. The feature flag migration skips exchanges without such bindings (#16823), and nothing attaches the condition later, so an exchange skipped this way is never auto-deleted once it gains and then loses bindings. Attach the condition when a binding is created, in the same transaction: the new route satisfies it, and the re-put changes nothing for exchanges that already carry it. References #16823.
michaelklishin
force-pushed
the
rabbitmq-server-17255
branch
from
September 1, 2026 01:26
c84983f to
5dc55c7
Compare
Collaborator
Author
|
The forced push was a rebase on top of |
dumbbell
reviewed
Sep 1, 2026
michaelklishin
added a commit
that referenced
this pull request
Sep 2, 2026
…ile` Deleting the routes of a destination can remove an auto-delete source exchange's last binding, so Khepri deletes that exchange in the same `khepri_tx_adv:delete_many/1` call. `maybe_auto_delete_exchange_in_khepri/4` then finds no record and adds nothing: no `exchange.deleted`, no `binding.deleted` events. Derive them from the delete's return value as well. `rabbit_db_exchange:delete_in_khepri/3` now does the same for the exchange record delete, per JSP's suggestion in #17257. Older Khepri machine versions fall back to the previous flow: collect the bindings first, then delete the record.
michaelklishin
added a commit
that referenced
this pull request
Sep 2, 2026
…ile` Deleting the routes of a destination can remove an auto-delete source exchange's last binding, so Khepri deletes that exchange in the same `khepri_tx_adv:delete_many/1` call. `maybe_auto_delete_exchange_in_khepri/4` then finds no record and adds nothing: no `exchange.deleted`, no `binding.deleted` events. Derive them from the delete's return value as well. `rabbit_db_exchange:delete_in_khepri/3` now does the same for the exchange record delete, per JSP's suggestion in #17257. Older Khepri machine versions fall back to the previous flow: collect the bindings first, then delete the record.
michaelklishin
force-pushed
the
rabbitmq-server-17255
branch
from
September 2, 2026 01:04
8ae03ec to
2dbc0f6
Compare
michaelklishin
added a commit
that referenced
this pull request
Sep 2, 2026
…ile` Deleting the routes of a destination can remove an auto-delete source exchange's last binding, so Khepri deletes that exchange in the same `khepri_tx_adv:delete_many/1` call. `maybe_auto_delete_exchange_in_khepri/4` then finds no record and adds nothing: no `exchange.deleted`, no `binding.deleted` events. Derive them from the delete's return value as well. `rabbit_db_exchange:delete_in_khepri/3` now does the same for the exchange record delete, per JSP's suggestion in #17257. Older Khepri machine versions fall back to the previous flow: collect the bindings first, then delete the record.
michaelklishin
force-pushed
the
rabbitmq-server-17255
branch
from
September 2, 2026 01:04
2dbc0f6 to
9268aa9
Compare
Collaborator
Author
|
With the most recent implementation, you can notice that some delete operations will no no-ops in practice because their "deletion targets" are removed by the underlying functions. I intentionally left that as instead of continuing the refactoring. These no-ops are cheap and safe, and the goal of this PR is to fix a few remaining bugs in that corner of the codebase, not refactor it in a major way. |
…ile` Deleting the routes of a destination can remove an auto-delete source exchange's last binding, so Khepri deletes that exchange in the same `khepri_tx_adv:delete_many/1` call. `maybe_auto_delete_exchange_in_khepri/4` then finds no record and adds nothing: no `exchange.deleted`, no `binding.deleted` events. Derive them from the delete's return value as well. `rabbit_db_exchange:delete_in_khepri/3` now does the same for the exchange record delete, per JSP's suggestion in #17257. Older Khepri machine versions fall back to the previous flow: collect the bindings first, then delete the record.
michaelklishin
force-pushed
the
rabbitmq-server-17255
branch
from
September 2, 2026 02:28
9268aa9 to
ba84296
Compare
michaelklishin
added a commit
that referenced
this pull request
Sep 2, 2026
A few related fixes around binding deletion (backport #17257)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes started with a fix for what #17255 describes but some deeper digging found a couple of remaining comparable problems.
This should be safe to backport to
v4.3.xwithout a feature flag.