Recovery strategy testing

Test added for the "retain" recovery strategy.  This strategy makes sure
a full history of index changes is made so that if the Ledger is wiped
out, the Ledger cna be fully rebuilt from the Journal.

This exposed two journal compaction problems

- The BestRun selected did not have the source files correctly sorted in
order before compaction
-  The compaction process incorrectly dealt with the KeyDelta object
left after a compaction - i.e. compacting twice the same key caused that
key history to be lost.

These issues have now been corrected.
This commit is contained in:
martinsumner 2016-10-27 00:57:19 +01:00
parent 4cdc6211a0
commit a00a123817
6 changed files with 259 additions and 107 deletions

View file

@ -8,7 +8,7 @@
fetchput_snapshot/1,
load_and_count/1,
load_and_count_withdelete/1,
space_clear_ondelete_test/1
space_clear_ondelete/1
]).
all() -> [
@ -18,7 +18,7 @@ all() -> [
fetchput_snapshot,
load_and_count ,
load_and_count_withdelete,
space_clear_ondelete_test
space_clear_ondelete
].
@ -398,8 +398,7 @@ load_and_count_withdelete(_Config) ->
testutil:reset_filestructure().
space_clear_ondelete_test(_Config) ->
% Test is a work in progress
space_clear_ondelete(_Config) ->
RootPath = testutil:reset_filestructure(),
StartOpts1 = #bookie_options{root_path=RootPath, max_journalsize=20000000},
{ok, Book1} = leveled_bookie:book_start(StartOpts1),