diff --git a/src/leveled_bookie.erl b/src/leveled_bookie.erl index 708bbb6..116c5b0 100644 --- a/src/leveled_bookie.erl +++ b/src/leveled_bookie.erl @@ -966,7 +966,7 @@ get_runner(State, DeprecatedQuery) -> -spec get_deprecatedrunner(book_state(), tuple()) -> {async, fun()}. %% @doc %% Get an {async, Runner} for a given fold type. Fold types have different -%% tuple inputs. These folds are currentyl used in tests, but are deprecated. +%% tuple inputs. These folds are currently used in tests, but are deprecated. %% Most of these folds should be achievable through other available folds. get_deprecatedrunner(State, {bucket_stats, Bucket}) -> SnapFun = return_snapfun(State, ledger, no_lookup, true, true), diff --git a/src/leveled_codec.erl b/src/leveled_codec.erl index 154d434..c1d21c1 100644 --- a/src/leveled_codec.erl +++ b/src/leveled_codec.erl @@ -641,9 +641,7 @@ get_size(PK, Value) -> Size; ?STD_TAG -> {_Hash, Size} = MD, - Size; - ?HEAD_TAG -> - 0 + Size end. -spec get_keyandobjhash(tuple(), tuple()) -> tuple(). diff --git a/src/leveled_imanifest.erl b/src/leveled_imanifest.erl index 702c769..09b002d 100644 --- a/src/leveled_imanifest.erl +++ b/src/leveled_imanifest.erl @@ -265,7 +265,9 @@ findpersisted_test() -> FilesToDelete3 = find_persistedentries(2999, to_list(Man)), ?assertMatch(2, length(FilesToDelete3)), FilesToDelete4 = find_persistedentries(999, to_list(Man)), - ?assertMatch([], FilesToDelete4). + ?assertMatch([], FilesToDelete4), + FilesToDelete5 = find_persistedentries(0, to_list(Man)), + ?assertMatch([], FilesToDelete5). buildrandomfashion_test() -> ManL0 = build_testmanifest_aslist(), diff --git a/test/end_to_end/tictac_SUITE.erl b/test/end_to_end/tictac_SUITE.erl index 33d3029..c6f0b70 100644 --- a/test/end_to_end/tictac_SUITE.erl +++ b/test/end_to_end/tictac_SUITE.erl @@ -1014,11 +1014,12 @@ recent_aae_expiry(_Config) -> basic_headonly(_Config) -> ObjectCount = 200000, - basic_headonly_test(ObjectCount, with_lookup), - basic_headonly_test(ObjectCount, no_lookup). + RemoveCount = 100, + basic_headonly_test(ObjectCount, RemoveCount, with_lookup), + basic_headonly_test(ObjectCount, RemoveCount, no_lookup). -basic_headonly_test(ObjectCount, HeadOnly) -> +basic_headonly_test(ObjectCount, RemoveCount, HeadOnly) -> % Load some AAE type objects into Leveled using the read_only mode. This % should allow for the items to be added in batches. Confirm that the % journal is garbage collected as expected, and that it is possible to @@ -1128,7 +1129,7 @@ basic_headonly_test(ObjectCount, HeadOnly) -> {async, Runner2} = leveled_bookie:book_returnfolder(Bookie2, RunnerDefinition), - {_AccH2, AccC2} = Runner2(), + {AccH2, AccC2} = Runner2(), true = AccC2 == ObjectCount, case HeadOnly of @@ -1148,6 +1149,19 @@ basic_headonly_test(ObjectCount, HeadOnly) -> h) end, + RemoveSpecL0 = lists:sublist(ObjectSpecL, RemoveCount), + RemoveSpecL1 = + lists:map(fun(Spec) -> setelement(1, Spec, remove) end, RemoveSpecL0), + ok = load_objectspecs(RemoveSpecL1, 32, Bookie2), + + {async, Runner3} = + leveled_bookie:book_returnfolder(Bookie2, RunnerDefinition), + + {AccH3, AccC3} = Runner3(), + true = AccC3 == (ObjectCount - RemoveCount), + false = AccH3 == AccH2, + + ok = leveled_bookie:book_close(Bookie2).