Skip to content

Commit

Permalink
Merge pull request #164 from basho/feature/invalid-hintfile-error-mes…
Browse files Browse the repository at this point in the history
…sage-level

Invalid hintfile error message is too severe

Reviewed-by: evanmcc
  • Loading branch information
borshop committed Apr 17, 2014
2 parents c3e544c + 08c873c commit 2a7e950
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/bitcask_fileops.erl
Expand Up @@ -336,16 +336,16 @@ fold_keys(#filestate{fd=Fd}=State, Fun, Acc, recovery, _, true) ->
Acc0;
{error, Reason} ->
HintFile = hintfile_name(State),
error_logger:error_msg("Hintfile '~s' failed fold: ~p\n",
[HintFile, Reason]),
error_logger:warning_msg("Hintfile '~s' failed fold: ~p\n",
[HintFile, Reason]),
fold_keys_loop(Fd, 0, Fun, Acc);
Acc1 ->
Acc1
end;
fold_keys(#filestate{fd=Fd}=State, Fun, Acc, recovery, _, false) ->
HintFile = hintfile_name(State),
error_logger:error_msg("Hintfile '~s' invalid\n",
[HintFile]),
error_logger:warning_msg("Hintfile '~s' invalid\n",
[HintFile]),
fold_keys_loop(Fd, 0, Fun, Acc).

-spec mk_filename(string(), integer()) -> string().
Expand Down Expand Up @@ -590,9 +590,9 @@ fold_hintfile_loop(<<Tstamp:?TSTAMPFIELD, KeySz:?KEYSIZEFIELD,
fold_hintfile_loop(Rest, Fun, Acc,
Consumed, Args, EOI);
false ->
error_logger:error_msg("Hintfile '~s' contains pointer ~p ~p "
"that is greater than total data size ~p\n",
[HintFile, Offset, TotalSz, DataSize]),
error_logger:warning_msg("Hintfile '~s' contains pointer ~p ~p "
"that is greater than total data size ~p\n",
[HintFile, Offset, TotalSz, DataSize]),
{error, {trunc_hintfile, Acc0}}
end;
%% error case where we've gotten to the end of the file without the CRC match
Expand Down

0 comments on commit 2a7e950

Please sign in to comment.