diff options
| author | Daniil Fedotov <hairyhum@gmail.com> | 2018-05-18 12:31:28 +0100 |
|---|---|---|
| committer | Daniil Fedotov <hairyhum@gmail.com> | 2018-05-18 12:31:28 +0100 |
| commit | d0423f958599cba5148864997aa8446c873dad00 (patch) | |
| tree | 650a86c059267c99776fbb0bbeab1bbba3a80461 | |
| parent | c39524625d0f3dc3cb46b9737093144ee6b21114 (diff) | |
| download | rabbitmq-server-git-d0423f958599cba5148864997aa8446c873dad00.tar.gz | |
Bring back transactional match_object for bindings cleanup.
Follow up to 5cdee1530d5002b316b80f488a5d87417e1d0db0
dirty_match_object does not provide much performance improvement
while it's breaking auto-delete exchanges cleanup.
A transaction with a binding deletion will call auto-delete
exchange removal, which will call a cleanup. On this cleanup
the deleted binding should not be dirty-deleted again.
Follow-up to #1589
[#156352963]
| -rw-r--r-- | src/rabbit_binding.erl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index 5e6cd48ce9..090e30b2b4 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -315,8 +315,8 @@ remove_for_source(SrcName) -> Match = #route{binding = #binding{source = SrcName, _ = '_'}}, remove_routes( lists:usort( - mnesia:dirty_match_object(rabbit_route, Match) ++ - mnesia:dirty_match_object(rabbit_semi_durable_route, Match))). + mnesia:match_object(rabbit_route, Match, read) ++ + mnesia:match_object(rabbit_semi_durable_route, Match, read))). remove_for_destination(DstName, OnlyDurable) -> remove_for_destination(DstName, OnlyDurable, fun remove_routes/1). @@ -405,8 +405,8 @@ remove_routes(Routes) -> %% This partitioning allows us to suppress unnecessary delete %% operations on disk tables, which require an fsync. {RamRoutes, DiskRoutes} = - lists:partition(fun (R) -> mnesia:dirty_match_object( - rabbit_durable_route, R) == [] end, + lists:partition(fun (R) -> mnesia:match_object( + rabbit_durable_route, R, read) == [] end, Routes), %% Of course the destination might not really be durable but it's %% just as easy to try to delete it from the semi-durable table @@ -430,13 +430,13 @@ remove_for_destination(DstName, OnlyDurable, Fun) -> Routes = case OnlyDurable of false -> [reverse_route(R) || - R <- mnesia:dirty_match_object( - rabbit_reverse_route, MatchRev)]; + R <- mnesia:match_object( + rabbit_reverse_route, MatchRev, read)]; true -> lists:usort( - mnesia:dirty_match_object( - rabbit_durable_route, MatchFwd) ++ - mnesia:dirty_match_object( - rabbit_semi_durable_route, MatchFwd)) + mnesia:match_object( + rabbit_durable_route, MatchFwd, read) ++ + mnesia:match_object( + rabbit_semi_durable_route, MatchFwd, read)) end, Bindings = Fun(Routes), group_bindings_fold(fun maybe_auto_delete/4, new_deletions(), |
