Further testing of compaction
Check we avoid crashing in challenging compaction scenarios
This commit is contained in:
parent
7d35ef7126
commit
84a92b5f95
5 changed files with 113 additions and 39 deletions
|
@ -1025,7 +1025,12 @@ saferead_keyvalue(Handle) ->
|
|||
eof ->
|
||||
false;
|
||||
{ok, Value} ->
|
||||
{Key, Value, KeyL, ValueL}
|
||||
case crccheck_value(Value) of
|
||||
true ->
|
||||
{Key, Value, KeyL, ValueL};
|
||||
false ->
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
check_forinkertype/2,
|
||||
create_value_for_journal/1,
|
||||
build_metadata_object/2,
|
||||
generate_ledgerkv/4,
|
||||
generate_ledgerkv/5,
|
||||
get_size/2,
|
||||
get_keyandhash/2,
|
||||
|
@ -170,6 +169,8 @@ from_inkerkv(Object) ->
|
|||
from_journalkey({SQN, _Type, LedgerKey}) ->
|
||||
{SQN, LedgerKey}.
|
||||
|
||||
compact_inkerkvc({_InkerKey, crc_wonky, false}, _Strategy) ->
|
||||
skip;
|
||||
compact_inkerkvc({{_SQN, ?INKT_TOMB, _LK}, _V, _CrcCheck}, _Strategy) ->
|
||||
skip;
|
||||
compact_inkerkvc({{SQN, ?INKT_KEYD, LK}, V, CrcCheck}, Strategy) ->
|
||||
|
@ -271,9 +272,6 @@ convert_indexspecs(IndexSpecs, Bucket, Key, SQN, TTL) ->
|
|||
end,
|
||||
IndexSpecs).
|
||||
|
||||
generate_ledgerkv(PrimaryKey, SQN, Obj, Size) ->
|
||||
generate_ledgerkv(PrimaryKey, SQN, Obj, Size, infinity).
|
||||
|
||||
generate_ledgerkv(PrimaryKey, SQN, Obj, Size, TS) ->
|
||||
{Tag, Bucket, Key, _} = PrimaryKey,
|
||||
Status = case Obj of
|
||||
|
|
|
@ -149,12 +149,7 @@ handle_cast({compact, Checker, InitiateFun, FilterFun, Inker, _Timeout},
|
|||
State) ->
|
||||
% Need to fetch manifest at start rather than have it be passed in
|
||||
% Don't want to process a queued call waiting on an old manifest
|
||||
Manifest = case leveled_inker:ink_getmanifest(Inker) of
|
||||
[] ->
|
||||
[];
|
||||
[_Active|Tail] ->
|
||||
Tail
|
||||
end,
|
||||
[_Active|Manifest] = leveled_inker:ink_getmanifest(Inker),
|
||||
MaxRunLength = State#state.max_run_length,
|
||||
{FilterServer, MaxSQN} = InitiateFun(Checker),
|
||||
CDBopts = State#state.cdb_options,
|
||||
|
@ -462,11 +457,7 @@ filter_output(KVCs, FilterFun, FilterServer, MaxSQN, ReloadStrategy) ->
|
|||
{false, true, false, retain} ->
|
||||
{Acc ++ [KVC1], PromptDelete};
|
||||
{false, true, false, _} ->
|
||||
{Acc, PromptDelete};
|
||||
{_, false, _, _} ->
|
||||
io:format("Corrupted value found for "
|
||||
++ "Journal Key ~w~n", [K]),
|
||||
{Acc, false}
|
||||
{Acc, PromptDelete}
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue