summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Corbacho <diana@rabbitmq.com>2018-08-30 14:18:10 +0100
committerDiana Corbacho <diana@rabbitmq.com>2018-08-30 14:42:35 +0100
commit495ead38956b2d1bcde5db071118ca4b50ab2812 (patch)
tree10811e8130c8c9b30f7fde3f4aca02a8f3dd20d9
parent46ca0db8b09cd8e7f3d73da6b0695ce8832ce083 (diff)
downloadrabbitmq-server-git-495ead38956b2d1bcde5db071118ca4b50ab2812.tar.gz
Idempotent binding removal
Optimizations introduced in #1589 caused the removal of bindings to be non-idempotent, as the removal of routing information with dirty deletes did not allow for full transaction rollback. This commit reverts that change, losing some of the performance improvements in favour of data correctness. [#160100569]
-rw-r--r--src/rabbit_binding.erl9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index a6907b8ce6..e01ca060a9 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -343,9 +343,6 @@ binding_action(Binding = #binding{source = SrcName,
Fun(Src, Dst, Binding#binding{args = SortedArgs})
end, ErrFun).
-dirty_delete_object(Table, Record, _LockKind) ->
- mnesia:dirty_delete_object(Table, Record).
-
sync_route(Route, true, true, Fun) ->
ok = Fun(rabbit_durable_route, Route, write),
sync_route(Route, false, true, Fun);
@@ -415,15 +412,15 @@ remove_routes(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
%% than check first
- [ok = sync_route(R, false, true, fun dirty_delete_object/3) ||
+ [ok = sync_route(R, false, true, fun mnesia:delete_object/3) ||
R <- RamRoutes],
- [ok = sync_route(R, true, true, fun dirty_delete_object/3) ||
+ [ok = sync_route(R, true, true, fun mnesia:delete_object/3) ||
R <- DiskRoutes],
[R#route.binding || R <- Routes].
remove_transient_routes(Routes) ->
[begin
- ok = sync_transient_route(R, fun dirty_delete_object/3),
+ ok = sync_transient_route(R, fun mnesia:delete_object/3),
R#route.binding
end || R <- Routes].