diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_msg_store.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 7d17a4b37e..b13269ac51 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -611,14 +611,14 @@ handle_cast({write, Guid}, [{Guid, Msg, _CacheRefCount}] = ets:lookup(CurFileCacheEts, Guid), case index_lookup(Guid, State) of not_found -> - write_message(Guid, Msg, 1, State); + write_message(Guid, Msg, State); #msg_location { ref_count = 0, file = File, total_size = TotalSize } -> [#file_summary { locked = Locked, file_size = FileSize } = Summary] = ets:lookup(FileSummaryEts, File), case Locked of true -> ok = index_delete(Guid, State), - write_message(Guid, Msg, 1, State); + write_message(Guid, Msg, State); false -> ok = index_update_ref_count(Guid, 1, State), ok = add_to_file_summary(Summary, TotalSize, FileSize, State), @@ -782,7 +782,7 @@ internal_sync(State = #msstate { current_file_handle = CurHdl, State1 #msstate { on_sync = [] } end. -write_message(Guid, Msg, RefCount, +write_message(Guid, Msg, State = #msstate { current_file_handle = CurHdl, current_file = CurFile, sum_valid_data = SumValid, @@ -791,7 +791,7 @@ write_message(Guid, Msg, RefCount, {ok, CurOffset} = file_handle_cache:current_virtual_offset(CurHdl), {ok, TotalSize} = rabbit_msg_file:append(CurHdl, Guid, Msg), ok = index_insert( - #msg_location { guid = Guid, ref_count = RefCount, file = CurFile, + #msg_location { guid = Guid, ref_count = 1, file = CurFile, offset = CurOffset, total_size = TotalSize }, State), [#file_summary { right = undefined, locked = false, |
