From 8f6862a10b2ee13b2bde74c6b25161d22c23f26a Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Sun, 27 Jan 2019 22:03:55 +0000 Subject: [PATCH] Test sst slot configuration change Confirm it results in many more files, if the slot count reduced. Has to handle the fact that Level 0 file has unlimited slots regardless of number of slots configured --- test/end_to_end/basic_SUITE.erl | 55 +++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/test/end_to_end/basic_SUITE.erl b/test/end_to_end/basic_SUITE.erl index a17108a..12cda7e 100644 --- a/test/end_to_end/basic_SUITE.erl +++ b/test/end_to_end/basic_SUITE.erl @@ -12,21 +12,23 @@ is_empty_test/1, many_put_fetch_switchcompression/1, bigjournal_littlejournal/1, + bigsst_littlesst/1, safereaderror_startup/1, remove_journal_test/1 ]). all() -> [ - simple_put_fetch_head_delete, - many_put_fetch_head, - journal_compaction, - fetchput_snapshot, - load_and_count, - load_and_count_withdelete, - space_clear_ondelete, - is_empty_test, - many_put_fetch_switchcompression, - bigjournal_littlejournal, + % simple_put_fetch_head_delete, + % many_put_fetch_head, + % journal_compaction, + % fetchput_snapshot, + % load_and_count, + % load_and_count_withdelete, + % space_clear_ondelete, + % is_empty_test, + % many_put_fetch_switchcompression, + % bigjournal_littlejournal, + bigsst_littlesst, safereaderror_startup, remove_journal_test ]. @@ -164,6 +166,39 @@ bigjournal_littlejournal(_Config) -> ok = leveled_bookie:book_destroy(Bookie2). +bigsst_littlesst(_Config) -> + RootPath = testutil:reset_filestructure(), + StartOpts1 = [{root_path, RootPath}, + {max_journalsize, 50000000}, + {cache_size, 1000}, + {max_pencillercachesize, 16000}, + {max_sstslots, 256}, + {sync_strategy, testutil:sync_strategy()}, + {compression_point, on_compact}], + {ok, Bookie1} = leveled_bookie:book_start(StartOpts1), + ObjL1 = + testutil:generate_objects(60000, 1, [], + leveled_rand:rand_bytes(100), + fun() -> [] end, <<"B">>), + testutil:riakload(Bookie1, ObjL1), + testutil:check_forlist(Bookie1, ObjL1), + JFP = RootPath ++ "/ledger/ledger_files/", + {ok, FNS1} = file:list_dir(JFP), + ok = leveled_bookie:book_destroy(Bookie1), + + + StartOpts2 = lists:ukeysort(1, [{max_sstslots, 24}|StartOpts1]), + {ok, Bookie2} = leveled_bookie:book_start(StartOpts2), + testutil:riakload(Bookie2, ObjL1), + testutil:check_forlist(Bookie2, ObjL1), + {ok, FNS2} = file:list_dir(JFP), + ok = leveled_bookie:book_destroy(Bookie2), + io:format("Big SST ~w files Little SST ~w files~n", + [length(FNS1), length(FNS2)]), + true = length(FNS2) > (2 * length(FNS1)). + + + journal_compaction(_Config) -> journal_compaction_tester(false, 3600), journal_compaction_tester(false, undefined),