diff options
| author | Matthew Sackman <matthew@lshift.net> | 2010-05-05 15:44:41 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2010-05-05 15:44:41 +0100 |
| commit | 1b0cf4e6a13fc943ee84ca3985eb6ea9ae2931af (patch) | |
| tree | 88e2508f1d4fe02cf2cf0f38965a1342a5153dad | |
| parent | 81964120f447a2286eb3c86cdd5e165aad53cbef (diff) | |
| download | rabbitmq-server-git-1b0cf4e6a13fc943ee84ca3985eb6ea9ae2931af.tar.gz | |
Correct insertions into dedup cache
| -rw-r--r-- | src/rabbit_msg_store.erl | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 6c5a1c6e77..217446a61e 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -436,9 +436,7 @@ client_read2(Server, false, _Right, fun (_) -> client_read3(Server, MsgLocation, Defer, CState) end, fun () -> read(Server, Guid, CState) end). -client_read3(Server, - #msg_location { guid = Guid, ref_count = RefCount, file = File }, - Defer, +client_read3(Server, #msg_location { guid = Guid, file = File }, Defer, CState = #client_msstate { file_handles_ets = FileHandlesEts, file_summary_ets = FileSummaryEts, dedup_cache_ets = DedupCacheEts }) -> @@ -483,8 +481,6 @@ client_read3(Server, CState1 = close_all_indicated(CState), {Msg, CState2} = read_from_disk(MsgLocation, CState1, DedupCacheEts), - ok = maybe_insert_into_cache(DedupCacheEts, RefCount, Guid, - Msg), Release(), %% this MUST NOT fail with badarg {{ok, Msg}, CState2}; MsgLocation -> %% different file! @@ -864,9 +860,10 @@ read_message1(From, #msg_location { guid = Guid, ref_count = RefCount, end, read_from_disk(MsgLoc, State, DedupCacheEts); [{Guid, Msg1, _CacheRefCount}] -> + ok = maybe_insert_into_cache(DedupCacheEts, RefCount, + Guid, Msg1), {Msg1, State} end, - ok = maybe_insert_into_cache(DedupCacheEts, RefCount, Guid, Msg), gen_server2:reply(From, {ok, Msg}), State1; false -> |
