diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2010-09-09 15:21:18 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-09-09 15:21:18 +0100 |
| commit | 45bb0b24f01f07b289d814f762c67f8870677197 (patch) | |
| tree | 7aa25b1618c94b15dd8e1676e3bd5f25a825e60f | |
| parent | 6204be98647d55e4ce678679964fea69933ab565 (diff) | |
| download | rabbitmq-server-git-45bb0b24f01f07b289d814f762c67f8870677197.tar.gz | |
when a message is written the ref_count is always 1
| -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, |
