diff options
| author | Rob Harrop <rob@rabbitmq.com> | 2011-03-07 15:12:17 +0000 |
|---|---|---|
| committer | Rob Harrop <rob@rabbitmq.com> | 2011-03-07 15:12:17 +0000 |
| commit | 1e6c32ed2248a5fcc780633b9137e19e313f3420 (patch) | |
| tree | a52c8877a3705f665a8de4c011c46ec35eee7bfe /src | |
| parent | f40da1a778c8452b325b3fa66ec1a9b718489a82 (diff) | |
| download | rabbitmq-server-git-1e6c32ed2248a5fcc780633b9137e19e313f3420.tar.gz | |
Comment describing the why behind the refactoring of remove_bindings
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_exchange_type_topic.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rabbit_exchange_type_topic.erl b/src/rabbit_exchange_type_topic.erl index f9ac69ba1e..5c5d760e05 100644 --- a/src/rabbit_exchange_type_topic.erl +++ b/src/rabbit_exchange_type_topic.erl @@ -68,6 +68,11 @@ add_binding(false, _Exchange, _Binding) -> ok. remove_bindings(true, X, Bs) -> + %% The remove process is split into two distinct phases. In the + %% first phase, we first gather the lists of bindings and edges to + %% delete, then in the second phase we process all the + %% deletions. This is to prevent interleaving of read/write + %% operations in mnesia that can adversely affect performance. {ToDelete, Paths} = lists:foldl( fun(B = #binding{destination = D}, {Acc, PathAcc}) -> |
