Mas d31 i410looptoclose (#421)
* Mas i410 looptoclose (#420) * Stop waiting full SHUTDOWN_PAUSE If there is a snapshot outstanding at shutdown time, there was a wait of SHUTDOWN_PAUSE to give the snapshot time to close down. This causes an issue in kv_index_tictactree when rebuilds complete, when an exchange was in flight at the point the rebuild completed - the aae_controller will become blocked for the full shutdown pause, whilst it waits for the replaced key store to be closed. This change is to loop within the shutdown pause, so that if the snapshot supporting the exchange is closed, the paused bookie can close more quickly (unblocking the controller). Without this fix, there are intermittent issues in kv_index_tictactree's mockvnode_SUITE tests. * Address test reliability Be a bit clearer with waiting round seconds, Was intermittently failing on QR4 previously (but QR5 1s later was always OK). * Update iterator_SUITE.erl * Refine test assertion At Stage C there might be 0 files left, in which case equality with Stage D result is ok.
This commit is contained in:
parent
d544db5461
commit
6223b801f3
5 changed files with 88 additions and 27 deletions
|
@ -2614,6 +2614,37 @@ generate_multiple_objects(Count, KeyNumber, ObjL) ->
|
|||
ObjL ++ [{Key, Value, IndexSpec}]).
|
||||
|
||||
|
||||
shutdown_test_() ->
|
||||
{timeout, 10, fun shutdown_tester/0}.
|
||||
|
||||
shutdown_tester() ->
|
||||
RootPath = reset_filestructure(),
|
||||
{ok, Bookie1} = book_start([{root_path, RootPath}]),
|
||||
lists:foreach(
|
||||
fun({K, V, S}) ->
|
||||
ok = book_put(Bookie1, <<"Bucket">>, K, V, S, ?STD_TAG)
|
||||
end,
|
||||
generate_multiple_objects(5000, 1)),
|
||||
{ok, SnpPCL1, SnpJrnl1} =
|
||||
leveled_bookie:book_snapshot(Bookie1, store, undefined, true),
|
||||
|
||||
TestPid = self(),
|
||||
spawn(
|
||||
fun() ->
|
||||
ok = leveled_bookie:book_close(Bookie1),
|
||||
TestPid ! ok
|
||||
end),
|
||||
|
||||
timer:sleep(2000),
|
||||
ok = leveled_penciller:pcl_close(SnpPCL1),
|
||||
ok = leveled_inker:ink_close(SnpJrnl1),
|
||||
SW = os:timestamp(),
|
||||
receive ok -> ok end,
|
||||
WaitForShutDown = timer:now_diff(SW, os:timestamp()) div 1000,
|
||||
?assert(WaitForShutDown =< (1000 + 1)),
|
||||
_ = reset_filestructure().
|
||||
|
||||
|
||||
ttl_test() ->
|
||||
RootPath = reset_filestructure(),
|
||||
{ok, Bookie1} = book_start([{root_path, RootPath}]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue