diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-08-19 18:47:51 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-08-19 18:47:51 +0100 |
commit | 61ba0737222114c4b0034f6b225cb0f4b4b1f1b3 (patch) | |
tree | 9280304eee4dc77edf2db35b812b7cab69eb530e | |
parent | beacc11d3c9ec6e8550706a1cbceb8dce5b88aba (diff) | |
download | rabbitmq-server-bug23152.tar.gz |
Grab the msg from the cur ets file cache, thus avoiding having to send the same message many timesbug23152
-rw-r--r-- | src/rabbit_msg_store.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 5bc1f9d5..207ddcb8 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -317,7 +317,7 @@ start_link(Server, Dir, ClientRefs, StartupFunState) -> write(Server, Guid, Msg, CState = #client_msstate { cur_file_cache_ets = CurFileCacheEts }) -> ok = update_msg_cache(CurFileCacheEts, Guid, Msg), - {gen_server2:cast(Server, {write, Guid, Msg}), CState}. + {gen_server2:cast(Server, {write, Guid}), CState}. read(Server, Guid, CState = #client_msstate { dedup_cache_ets = DedupCacheEts, @@ -611,7 +611,7 @@ handle_call({delete_client, CRef}, _From, reply(ok, State #msstate { client_refs = sets:del_element(CRef, ClientRefs) }). -handle_cast({write, Guid, Msg}, +handle_cast({write, Guid}, State = #msstate { current_file_handle = CurHdl, current_file = CurFile, sum_valid_data = SumValid, @@ -619,6 +619,7 @@ handle_cast({write, Guid, Msg}, file_summary_ets = FileSummaryEts, cur_file_cache_ets = CurFileCacheEts }) -> true = 0 =< ets:update_counter(CurFileCacheEts, Guid, {3, -1}), + [{Guid, Msg, _CacheRefCount}] = ets:lookup(CurFileCacheEts, Guid), case index_lookup(Guid, State) of not_found -> %% New message, lots to do |