summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-12-01 22:23:44 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2011-12-01 22:23:44 +0000
commit1b3b5ba1a1081cd86e257dc35bd90615ba40fc0f (patch)
tree7d0dc606d05a0ca3f7942dd15ab7bcde581cf040
parent10eee87f98bd2de23f8416c978bef370053c9143 (diff)
downloadrabbitmq-server-bug23938.tar.gz
refer to rationale from bug 24607bug23938
-rw-r--r--src/rabbit_exchange_type_topic.erl17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/rabbit_exchange_type_topic.erl b/src/rabbit_exchange_type_topic.erl
index b35105ed..91c7b5d3 100644
--- a/src/rabbit_exchange_type_topic.erl
+++ b/src/rabbit_exchange_type_topic.erl
@@ -65,21 +65,8 @@ add_binding(none, _Exchange, _Binding) ->
ok.
remove_bindings(transaction, _X, Bs) ->
- %% We need to lock the tables we are operating on in order to
- %% reduce the time complexity. Without the table locks we end up
- %% with K*length(Bs) row-level locks. Inserting each lock takes
- %% time proportional to the number of existing locks, thus
- %% resulting in O(length(Bs)^2) complexity.
- %%
- %% The locks need to be write locks since ultimately we end up
- %% removing all these rows.
- %%
- %% The downside of all this is that no other binding operations
- %% except lookup/routing (which uses dirty ops) on topic exchanges
- %% can take place concurrently. However, that is the case for any
- %% bulk binding removal operations since the removal of bindings
- %% from the rabbit_route etc table, which precedes all this, calls
- %% match_object with a partial key, which results in a table lock.
+ %% See rabbit_binding:lock_route_tables for the rationale for
+ %% taking table locks.
case Bs of
[_] -> ok;
_ -> [mnesia:lock({table, T}, write) ||