diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-19 17:20:09 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-19 17:20:09 +0100 |
| commit | 0877754d1515bf361a0fbab7cdf693fc998dd396 (patch) | |
| tree | 5cb7954b6496349d1fc3b61d39b9b8a7c8be371d | |
| parent | 8fbfd5c7eaf2c272d4d7647a8e7b74e1130d188e (diff) | |
| download | rabbitmq-server-git-0877754d1515bf361a0fbab7cdf693fc998dd396.tar.gz | |
fixed an ever-expanding dictionary
The problem with the current design is that the lowest layer that knows
about confirmations is amqqueue_process. This means that
amqqueue_process, variable_queue, msg_store and queue_index need to do
all the bookkeeping associated with confirmations even if they're not
enabled. Mind you, this doesn't slow things down noticeably.
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 9521158a7d..0abd2108a9 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -410,16 +410,13 @@ confirm_message_internal(Guid, State = #q { guid_to_channel = GTC, msgs_on_disk = MOD, msg_indices_on_disk = MIOD }) -> case dict:find(Guid, GTC) of - {ok, {_, undefined}} -> - State; - {ok, {ChPid, MsgSeqNo}} -> - rabbit_channel:confirm(ChPid, MsgSeqNo), - State #q { guid_to_channel = dict:erase(Guid, GTC), - msgs_on_disk = gb_sets:delete_any(Guid, MOD), - msg_indices_on_disk = gb_sets:delete_any(Guid, MIOD) }; - _ -> - State - end. + {ok, {ChPid, undefined}} -> ok; + {ok, {ChPid, MsgSeqNo}} -> rabbit_channel:confirm(ChPid, MsgSeqNo); + _ -> ok + end, + State #q { guid_to_channel = dict:erase(Guid, GTC), + msgs_on_disk = gb_sets:delete_any(Guid, MOD), + msg_indices_on_disk = gb_sets:delete_any(Guid, MIOD) }. maybe_record_confirm_message(undefined, _, _, State) -> State; |
