Deferred Deletion of Journals

This allows for deleted journals to be retained for a period (the
waste_retnetion_period).  The idea being that a backup strategy can
ensure that all journals are backed up, even ones created and removed
from within a backup period - so that any restore pont is possible.

This is also a pre-cursor to removing some of the PromptDelete
complexity from the Inker Clerk - all compactions can prompt deletion as
deletion is now deferred.
This commit is contained in:
martinsumner 2016-11-14 11:17:14 +00:00
parent dbb840d75e
commit 44738f7c75
8 changed files with 147 additions and 44 deletions

View file

@ -39,7 +39,8 @@
restore_file/2,
restore_topending/2,
find_journals/1,
riak_hash/1]).
riak_hash/1,
wait_for_compaction/1]).
-define(RETURN_TERMS, {true, undefined}).
-define(SLOWOFFER_DELAY, 5).
@ -85,7 +86,20 @@ reset_filestructure(Wait) ->
leveled_penciller:clean_testdir(RootPath ++ "/ledger"),
RootPath.
wait_for_compaction(Bookie) ->
F = fun leveled_bookie:book_islastcompactionpending/1,
lists:foldl(fun(X, Pending) ->
case Pending of
false ->
false;
true ->
io:format("Loop ~w waiting for journal "
++ "compaction to complete~n", [X]),
timer:sleep(20000),
F(Bookie)
end end,
true,
lists:seq(1, 15)).
check_bucket_stats(Bookie, Bucket) ->
FoldSW1 = os:timestamp(),