-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rabbit_db_queue: Update durable queues outside of Khepri transactions
`rabbit_db_queue:update_durable/2`'s caller (`rabbit_amqqueue:mark_local_durable_queues_stopped`/1) passes a filter function that performs some operations that aren't allowed within Khepri transactions like looking up and using the current node and executing an RPC. Calling `rabbit_amqqueue:mark_local_durable_queues_stopped/1` on a Rabbit with the `khepri_db` feature flag enabled will result in an error. We can safely update a number of queues by using Khepri's `khepri_adv:get_many/3` advanced API which returns the internal version number of each queue. We can filter and update the queues outside of a transaction function and then perform all updates at once, failing if any queue has changed since the `khepri_adv:get_many/3` query. So we get the main benefits of a transaction but we can still execute any update or filter function.
- Loading branch information
1 parent
919ed46
commit 091d74c
Showing
2 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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