diff options
| author | Matthias Radestock <matthias@lshift.net> | 2009-09-23 12:00:05 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2009-09-23 12:00:05 +0100 |
| commit | 97fcedd1cd8d5946eb68b18311eb2aa3d37c4769 (patch) | |
| tree | fe23019f528d999de70d93f5fc199ecdd62098ea | |
| parent | 49b6351e1b2c0733eb3313513d1009e207acfbee (diff) | |
| download | rabbitmq-server-git-97fcedd1cd8d5946eb68b18311eb2aa3d37c4769.tar.gz | |
remove verify_messages_referenced check
This can actually fail, e.g. when a message got ack'ed but the
corresponding mnesia delete in dq hasn't been flushed yet.
load_messages and the pruning in dq take care of this situation.
| -rw-r--r-- | src/rabbit_msg_store.erl | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index f9d27e122a..cdf8bf4029 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -263,7 +263,7 @@ init(Dir, FileSizeLimit, ReadFileHandlesLimit, sort_file_names(filelib:wildcard("*" ++ ?FILE_EXTENSION, Dir)), TmpFileNames = sort_file_names(filelib:wildcard("*" ++ ?FILE_EXTENSION_TMP, Dir)), - ok = recover_crashed_compactions(Dir, FileNames, TmpFileNames, State), + ok = recover_crashed_compactions(Dir, FileNames, TmpFileNames), %% There should be no more tmp files now, so go ahead and load the %% whole lot Files = [filename_to_num(FileName) || FileName <- FileNames], @@ -577,27 +577,18 @@ count_msg_refs(Gen, Seed, State) -> count_msg_refs(Gen, Next, State) end. -verify_messages_referenced(State, MsgIds) -> - lists:foreach(fun (MsgId) -> - #msg_location {} = index_lookup(MsgId, State) - end, MsgIds). - -recover_crashed_compactions(Dir, FileNames, TmpFileNames, State) -> +recover_crashed_compactions(Dir, FileNames, TmpFileNames) -> lists:foreach(fun (TmpFileName) -> ok = recover_crashed_compactions1( - Dir, FileNames, TmpFileName, State) - end, - TmpFileNames), + Dir, FileNames, TmpFileName) + end, TmpFileNames), ok. -recover_crashed_compactions1(Dir, FileNames, TmpFileName, State) -> +recover_crashed_compactions1(Dir, FileNames, TmpFileName) -> NonTmpRelatedFileName = filename:rootname(TmpFileName) ++ ?FILE_EXTENSION, true = lists:member(NonTmpRelatedFileName, FileNames), {ok, UncorruptedMessagesTmp, MsgIdsTmp} = scan_file_for_valid_messages_msg_ids(Dir, TmpFileName), - %% all of these messages should be referenced - %% otherwise they wouldn't have been copied out - verify_messages_referenced(State, MsgIdsTmp), {ok, UncorruptedMessages, MsgIds} = scan_file_for_valid_messages_msg_ids(Dir, NonTmpRelatedFileName), %% 1) It's possible that everything in the tmp file is also in the @@ -651,8 +642,6 @@ recover_crashed_compactions1(Dir, FileNames, TmpFileName, State) -> 2 + length(Dropped), length(Rest))} end, - %% Check that everything in the main file prefix is referenced - verify_messages_referenced(State, MsgIds1), %% The main file prefix should be contiguous {Top, MsgIds1} = find_contiguous_block_prefix( lists:reverse(UncorruptedMessages1)), |
