Merge branch 'master' into mas-aae-segementfoldplus
This commit is contained in:
commit
8f27b3b628
12 changed files with 605 additions and 309 deletions
|
@ -9,7 +9,8 @@
|
|||
load_and_count/1,
|
||||
load_and_count_withdelete/1,
|
||||
space_clear_ondelete/1,
|
||||
is_empty_test/1
|
||||
is_empty_test/1,
|
||||
many_put_fetch_switchcompression/1
|
||||
]).
|
||||
|
||||
all() -> [
|
||||
|
@ -20,7 +21,8 @@ all() -> [
|
|||
load_and_count,
|
||||
load_and_count_withdelete,
|
||||
space_clear_ondelete,
|
||||
is_empty_test
|
||||
is_empty_test,
|
||||
many_put_fetch_switchcompression
|
||||
].
|
||||
|
||||
|
||||
|
@ -72,7 +74,8 @@ many_put_fetch_head(_Config) ->
|
|||
RootPath = testutil:reset_filestructure(),
|
||||
StartOpts1 = [{root_path, RootPath},
|
||||
{max_pencillercachesize, 16000},
|
||||
{sync_strategy, riak_sync}],
|
||||
{sync_strategy, riak_sync},
|
||||
{compression_point, on_compact}],
|
||||
{ok, Bookie1} = leveled_bookie:book_start(StartOpts1),
|
||||
{TestObject, TestSpec} = testutil:generate_testobject(),
|
||||
ok = testutil:book_riakput(Bookie1, TestObject, TestSpec),
|
||||
|
@ -81,7 +84,8 @@ many_put_fetch_head(_Config) ->
|
|||
StartOpts2 = [{root_path, RootPath},
|
||||
{max_journalsize, 500000000},
|
||||
{max_pencillercachesize, 32000},
|
||||
{sync_strategy, testutil:sync_strategy()}],
|
||||
{sync_strategy, testutil:sync_strategy()},
|
||||
{compression_point, on_receipt}],
|
||||
{ok, Bookie2} = leveled_bookie:book_start(StartOpts2),
|
||||
testutil:check_forobject(Bookie2, TestObject),
|
||||
GenList = [2, 20002, 40002, 60002, 80002,
|
||||
|
@ -683,3 +687,49 @@ is_empty_test(_Config) ->
|
|||
true = sets:size(BLpd3()) == 0,
|
||||
|
||||
ok = leveled_bookie:book_close(Bookie1).
|
||||
|
||||
|
||||
many_put_fetch_switchcompression(_Config) ->
|
||||
RootPath = testutil:reset_filestructure(),
|
||||
StartOpts1 = [{root_path, RootPath},
|
||||
{max_pencillercachesize, 16000},
|
||||
{sync_strategy, riak_sync},
|
||||
{compression_method, native}],
|
||||
{ok, Bookie1} = leveled_bookie:book_start(StartOpts1),
|
||||
{TestObject, TestSpec} = testutil:generate_testobject(),
|
||||
ok = testutil:book_riakput(Bookie1, TestObject, TestSpec),
|
||||
testutil:check_forobject(Bookie1, TestObject),
|
||||
ok = leveled_bookie:book_close(Bookie1),
|
||||
StartOpts2 = [{root_path, RootPath},
|
||||
{max_journalsize, 500000000},
|
||||
{max_pencillercachesize, 32000},
|
||||
{sync_strategy, testutil:sync_strategy()},
|
||||
{compression_method, lz4}],
|
||||
|
||||
%% Change compression method
|
||||
{ok, Bookie2} = leveled_bookie:book_start(StartOpts2),
|
||||
testutil:check_forobject(Bookie2, TestObject),
|
||||
GenList = [2, 40002, 80002, 120002],
|
||||
CLs = testutil:load_objects(40000, GenList, Bookie2, TestObject,
|
||||
fun testutil:generate_smallobjects/2),
|
||||
CL1A = lists:nth(1, CLs),
|
||||
ChkListFixed = lists:nth(length(CLs), CLs),
|
||||
testutil:check_forlist(Bookie2, CL1A),
|
||||
ObjList2A = testutil:generate_objects(5000, 2),
|
||||
testutil:riakload(Bookie2, ObjList2A),
|
||||
ChkList2A = lists:sublist(lists:sort(ObjList2A), 1000),
|
||||
testutil:check_forlist(Bookie2, ChkList2A),
|
||||
testutil:check_forlist(Bookie2, ChkListFixed),
|
||||
testutil:check_forobject(Bookie2, TestObject),
|
||||
testutil:check_forlist(Bookie2, ChkList2A),
|
||||
testutil:check_forlist(Bookie2, ChkListFixed),
|
||||
testutil:check_forobject(Bookie2, TestObject),
|
||||
ok = leveled_bookie:book_close(Bookie2),
|
||||
|
||||
%% Change method back again
|
||||
{ok, Bookie3} = leveled_bookie:book_start(StartOpts1),
|
||||
testutil:check_forlist(Bookie3, ChkList2A),
|
||||
testutil:check_forlist(Bookie3, ChkListFixed),
|
||||
testutil:check_forobject(Bookie3, TestObject),
|
||||
testutil:check_formissingobject(Bookie3, "Bookie1", "MissingKey0123"),
|
||||
ok = leveled_bookie:book_destroy(Bookie3).
|
|
@ -305,17 +305,21 @@ aae_bustedjournal(_Config) ->
|
|||
|
||||
journal_compaction_bustedjournal(_Config) ->
|
||||
% Different circumstances will be created in different runs
|
||||
busted_journal_test(10000000),
|
||||
busted_journal_test(7777777).
|
||||
busted_journal_test(10000000, native, on_receipt, true),
|
||||
busted_journal_test(7777777, lz4, on_compact, true),
|
||||
busted_journal_test(8888888, lz4, on_receipt, true),
|
||||
busted_journal_test(7777777, lz4, on_compact, false).
|
||||
|
||||
|
||||
busted_journal_test(MaxJournalSize) ->
|
||||
busted_journal_test(MaxJournalSize, PressMethod, PressPoint, Bust) ->
|
||||
% Simply confirms that none of this causes a crash
|
||||
RootPath = testutil:reset_filestructure(),
|
||||
StartOpts1 = [{root_path, RootPath},
|
||||
{max_journalsize, MaxJournalSize},
|
||||
{max_run_length, 10},
|
||||
{sync_strategy, testutil:sync_strategy()}],
|
||||
{sync_strategy, testutil:sync_strategy()},
|
||||
{compression_method, PressMethod},
|
||||
{compression_point, PressPoint}],
|
||||
{ok, Bookie1} = leveled_bookie:book_start(StartOpts1),
|
||||
{TestObject, TestSpec} = testutil:generate_testobject(),
|
||||
ok = testutil:book_riakput(Bookie1, TestObject, TestSpec),
|
||||
|
@ -331,11 +335,18 @@ busted_journal_test(MaxJournalSize) ->
|
|||
ObjList2),
|
||||
ok = leveled_bookie:book_close(Bookie1),
|
||||
|
||||
CDBFiles = testutil:find_journals(RootPath),
|
||||
lists:foreach(fun(FN) ->
|
||||
testutil:corrupt_journal(RootPath, FN, 100, 2048, 1000)
|
||||
end,
|
||||
CDBFiles),
|
||||
case Bust of
|
||||
true ->
|
||||
CDBFiles = testutil:find_journals(RootPath),
|
||||
lists:foreach(fun(FN) ->
|
||||
testutil:corrupt_journal(RootPath,
|
||||
FN,
|
||||
100, 2048, 1000)
|
||||
end,
|
||||
CDBFiles);
|
||||
false ->
|
||||
ok
|
||||
end,
|
||||
|
||||
{ok, Bookie2} = leveled_bookie:book_start(StartOpts1),
|
||||
|
||||
|
@ -358,6 +369,7 @@ busted_journal_test(MaxJournalSize) ->
|
|||
testutil:reset_filestructure(10000).
|
||||
|
||||
|
||||
|
||||
rotating_object_check(BookOpts, B, NumberOfObjects) ->
|
||||
{ok, Book1} = leveled_bookie:book_start(BookOpts),
|
||||
{KSpcL1, V1} = testutil:put_indexed_objects(Book1, B, NumberOfObjects),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue