diff options
| author | Ben Hood <0x6e6562@gmail.com> | 2008-10-06 17:42:58 +0100 |
|---|---|---|
| committer | Ben Hood <0x6e6562@gmail.com> | 2008-10-06 17:42:58 +0100 |
| commit | b8530a54f96d0302b5ef45f6a6113b91a89ffb76 (patch) | |
| tree | be3a66ccc8ffac23331797b5c680c889850c0d1f /src | |
| parent | ca5b562728fcf5c3558fdfb4d073bc61d7e51f01 (diff) | |
| download | rabbitmq-server-git-b8530a54f96d0302b5ef45f6a6113b91a89ffb76.tar.gz | |
Lock demotion
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_exchange.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 5811b055d6..5b11836ad9 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -43,8 +43,6 @@ -import(qlc). -import(regexp). --define(CHUNK_SIZE, 1). - %%---------------------------------------------------------------------------- -ifdef(use_specs). @@ -221,7 +219,11 @@ lookup_qpids(Queues) -> %% TODO: Should all of the route and binding management not be %% refactored to its own module, especially seeing as unbind will have %% to be implemented for 0.91 ? -%% This uses the reverse routes as the primary index + +%% This function looks crazy because when you delete stuff within an mnesia +%% transaction, the effects of which are not visible to subsequent reads +%% within the same transaction. +%% This uses the reverse routes as the primary index. delete_bindings(Binding = #binding{exchange_name = X, queue_name = QueueName}) when QueueName /= '_' andalso X == '_' -> @@ -242,7 +244,7 @@ delete_bindings(Binding = #binding{exchange_name = X, indexed_delete(reverse_route(#route{binding = Binding}), fun mnesia:delete_object/1, fun delete_forward_routes/1); -%% This uses the forward routes as the primary index +%% This uses the forward routes as the primary index. delete_bindings(Binding = #binding{exchange_name = ExchangeName, queue_name = QueueName}) when QueueName == '_' @@ -284,7 +286,7 @@ has_bindings_helper(ExchangeName, Condition) -> MatchHead = #route{binding = #binding{exchange_name = ExchangeName, queue_name = '$1', key = '_'}}, - case mnesia:select(route, [{MatchHead, Condition, ['$1']}], ?CHUNK_SIZE, write) of + case mnesia:select(route, [{MatchHead, Condition, ['$1']}], 1, read) of '$end_of_table' -> false; _ -> true end. |
