Finish fixups to the chmgr state transition checking
This commit is contained in:
parent
3aa3e00806
commit
297d29c79b
3 changed files with 33 additions and 25 deletions
|
@ -154,7 +154,7 @@ convergence_demo_testfun(NumFLUs, MgrOpts0) ->
|
||||||
%% Faster test startup, commented: timer:sleep(3000),
|
%% Faster test startup, commented: timer:sleep(3000),
|
||||||
|
|
||||||
TcpPort = 62877,
|
TcpPort = 62877,
|
||||||
ok = filelib:ensure_dir("/tmp/c/data.a"),
|
ok = filelib:ensure_dir("/tmp/c/not-used"),
|
||||||
FluInfo = [{a,TcpPort+0,"/tmp/c/data.a"}, {b,TcpPort+1,"/tmp/c/data.b"},
|
FluInfo = [{a,TcpPort+0,"/tmp/c/data.a"}, {b,TcpPort+1,"/tmp/c/data.b"},
|
||||||
{c,TcpPort+2,"/tmp/c/data.c"}, {d,TcpPort+3,"/tmp/c/data.d"},
|
{c,TcpPort+2,"/tmp/c/data.c"}, {d,TcpPort+3,"/tmp/c/data.d"},
|
||||||
{e,TcpPort+4,"/tmp/c/data.e"}, {f,TcpPort+5,"/tmp/c/data.f"}],
|
{e,TcpPort+4,"/tmp/c/data.e"}, {f,TcpPort+5,"/tmp/c/data.f"}],
|
||||||
|
|
|
@ -106,15 +106,15 @@ postcondition(_S, {call, _, _Func, _Args}, _Res) ->
|
||||||
all_list_extra() ->
|
all_list_extra() ->
|
||||||
[ %% Genenerators assume that this list is at least 2 items
|
[ %% Genenerators assume that this list is at least 2 items
|
||||||
{#p_srvr{name=a, address="localhost", port=7400,
|
{#p_srvr{name=a, address="localhost", port=7400,
|
||||||
props=[{chmgr, a_chmgr}]}, "./data.pulse.a"}
|
props=[{chmgr, a_chmgr}]}, "/tmp/c/data.pulse.a"}
|
||||||
, {#p_srvr{name=b, address="localhost", port=7401,
|
, {#p_srvr{name=b, address="localhost", port=7401,
|
||||||
props=[{chmgr, b_chmgr}]}, "./data.pulse.b"}
|
props=[{chmgr, b_chmgr}]}, "/tmp/c/data.pulse.b"}
|
||||||
, {#p_srvr{name=c, address="localhost", port=7402,
|
, {#p_srvr{name=c, address="localhost", port=7402,
|
||||||
props=[{chmgr, c_chmgr}]}, "./data.pulse.c"}
|
props=[{chmgr, c_chmgr}]}, "/tmp/c//data.pulse.c"}
|
||||||
, {#p_srvr{name=d, address="localhost", port=7403,
|
, {#p_srvr{name=d, address="localhost", port=7403,
|
||||||
props=[{chmgr, d_chmgr}]}, "./data.pulse.d"}
|
props=[{chmgr, d_chmgr}]}, "/tmp/c/data.pulse.d"}
|
||||||
, {#p_srvr{name=e, address="localhost", port=7404,
|
, {#p_srvr{name=e, address="localhost", port=7404,
|
||||||
props=[{chmgr, e_chmgr}]}, "./data.pulse.e"}
|
props=[{chmgr, e_chmgr}]}, "/tmp/c/data.pulse.e"}
|
||||||
].
|
].
|
||||||
|
|
||||||
all_list() ->
|
all_list() ->
|
||||||
|
@ -126,7 +126,10 @@ setup(Num, Seed) ->
|
||||||
All_list = lists:sublist(all_list(), Num),
|
All_list = lists:sublist(all_list(), Num),
|
||||||
All_listE = lists:sublist(all_list_extra(), Num),
|
All_listE = lists:sublist(all_list_extra(), Num),
|
||||||
%% shutdown_hard() has taken care of killing all relevant procs.
|
%% shutdown_hard() has taken care of killing all relevant procs.
|
||||||
[machi_flu1_test:clean_up_data_dir(Dir) || {_P, Dir} <- All_listE],
|
[begin
|
||||||
|
machi_flu1_test:clean_up_data_dir(Dir),
|
||||||
|
filelib:ensure_dir(Dir ++ "/not-used")
|
||||||
|
end || {_P, Dir} <- All_listE],
|
||||||
?QC_FMT(",z~w", [?LINE]),
|
?QC_FMT(",z~w", [?LINE]),
|
||||||
|
|
||||||
%% Start partition simulator
|
%% Start partition simulator
|
||||||
|
@ -318,7 +321,11 @@ prop_pulse() ->
|
||||||
%% written during any given epoch, confirm that all chain
|
%% written during any given epoch, confirm that all chain
|
||||||
%% members appear in only one unique chain, i.e., the sets of
|
%% members appear in only one unique chain, i.e., the sets of
|
||||||
%% unique chains are disjoint.
|
%% unique chains are disjoint.
|
||||||
AllDisjointP = ?MGRTEST:all_reports_are_disjoint(Report),
|
{AllDisjointP, AllDisjointDetail} =
|
||||||
|
case ?MGRTEST:all_reports_are_disjoint(Report) of
|
||||||
|
true -> {true, true};
|
||||||
|
Else -> {false, Else}
|
||||||
|
end,
|
||||||
|
|
||||||
%% For each chain transition experienced by a particular FLU,
|
%% For each chain transition experienced by a particular FLU,
|
||||||
%% confirm that each state transition is OK.
|
%% confirm that each state transition is OK.
|
||||||
|
@ -331,29 +338,31 @@ prop_pulse() ->
|
||||||
{_LastEpoch, {ok_disjoint, LastRepXs}} = lists:last(Report),
|
{_LastEpoch, {ok_disjoint, LastRepXs}} = lists:last(Report),
|
||||||
|
|
||||||
%% TODO: Check that we've converged to a single chain with no repairs.
|
%% TODO: Check that we've converged to a single chain with no repairs.
|
||||||
SingleChainNoRepair = case LastRepXs of
|
{SingleChainNoRepair_p, SingleChainNoRepairDetail} =
|
||||||
[{_UPI,[]}] ->
|
case LastRepXs of
|
||||||
true;
|
[LastUPI] when length(LastUPI) == S2#state.num_pids ->
|
||||||
_ ->
|
{true, true};
|
||||||
false
|
_ ->
|
||||||
end,
|
{false, LastRepXs}
|
||||||
|
end,
|
||||||
|
|
||||||
ok = shutdown_hard(),
|
ok = shutdown_hard(),
|
||||||
?WHENFAIL(
|
?WHENFAIL(
|
||||||
begin
|
begin
|
||||||
|
?QC_FMT("PrivProjs = ~p\n", [PrivProjs]),
|
||||||
|
?QC_FMT("Report = ~p\n", [Report]),
|
||||||
?QC_FMT("Cmds = ~p\n", [Cmds]),
|
?QC_FMT("Cmds = ~p\n", [Cmds]),
|
||||||
?QC_FMT("Res = ~p\n", [Res]),
|
?QC_FMT("Res = ~p\n", [Res]),
|
||||||
?QC_FMT("Diag = ~s\n", [Diag]),
|
?QC_FMT("Diag = ~s\n", [Diag]),
|
||||||
?QC_FMT("Report = ~p\n", [Report]),
|
|
||||||
?QC_FMT("PrivProjs = ~p\n", [PrivProjs]),
|
|
||||||
?QC_FMT("Sane = ~p\n", [Sane]),
|
?QC_FMT("Sane = ~p\n", [Sane]),
|
||||||
?QC_FMT("SingleChainNoRepair failure =\n ~p\n", [SingleChainNoRepair])
|
?QC_FMT("AllDisjointDetail = ~p\n", [AllDisjointDetail]),
|
||||||
|
?QC_FMT("SingleChainNoRepair failure = ~p\n", [SingleChainNoRepairDetail])
|
||||||
%% ,erlang:halt(0)
|
%% ,erlang:halt(0)
|
||||||
end,
|
end,
|
||||||
conjunction([{res, Res == true orelse Res == ok},
|
conjunction([{res, Res == true orelse Res == ok},
|
||||||
{all_disjoint, AllDisjointP},
|
{all_disjoint, AllDisjointP},
|
||||||
{sane, SaneP},
|
{sane, SaneP},
|
||||||
{single_chain_no_repair, SingleChainNoRepair}
|
{single_chain_no_repair, SingleChainNoRepair_p}
|
||||||
]))
|
]))
|
||||||
end)).
|
end)).
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
%% {'bummer_NOT_DISJOINT', {flat(), summaries()}
|
%% {'bummer_NOT_DISJOINT', {flat(), summaries()}
|
||||||
%% unique_upi_repair_lists(): list(upi_and_repair_lists_concatenated())
|
%% unique_upi_repair_lists(): list(upi_and_repair_lists_concatenated())
|
||||||
%% flat(): debugging term; any duplicate in this list is an invalid FLU.
|
%% flat(): debugging term; any duplicate in this list is an invalid FLU.
|
||||||
%% summaries(): list(ProjectionSummary:string())
|
%% summaries(): list({FLU, ProjectionSummary:string() | 'not_in_this_epoch'})
|
||||||
%%
|
%%
|
||||||
%% Example:
|
%% Example:
|
||||||
%%
|
%%
|
||||||
|
@ -98,15 +98,14 @@ unanimous_report2(FLU_Projs) ->
|
||||||
Proj#projection_v1.epoch_csum} ||
|
Proj#projection_v1.epoch_csum} ||
|
||||||
{_FLUname, Proj} <- FLU_Projs,
|
{_FLUname, Proj} <- FLU_Projs,
|
||||||
is_record(Proj, projection_v1)],
|
is_record(Proj, projection_v1)],
|
||||||
UniqueUPIsRepairs = lists:usort([{UPI,Repairing} ||
|
UniqueUPIs = lists:usort([UPI || {UPI, _Repairing, _CSum} <- UPI_R_Sums]),
|
||||||
{UPI, Repairing, _CSum} <- UPI_R_Sums]),
|
if length(UniqueUPIs) =< 1 ->
|
||||||
if length(UniqueUPIsRepairs) =< 1 ->
|
{ok_disjoint, UniqueUPIs};
|
||||||
{ok_disjoint, UniqueUPIsRepairs};
|
|
||||||
true ->
|
true ->
|
||||||
Flat = lists:flatten([UPI++Rep || {UPI,Rep} <- UniqueUPIsRepairs]),
|
Flat = lists:flatten(UniqueUPIs),
|
||||||
case lists:usort(Flat) == lists:sort(Flat) of
|
case lists:usort(Flat) == lists:sort(Flat) of
|
||||||
true ->
|
true ->
|
||||||
{ok_disjoint, UniqueUPIsRepairs};
|
{ok_disjoint, UniqueUPIs};
|
||||||
false ->
|
false ->
|
||||||
{bummer_NOT_DISJOINT, {lists:sort(Flat), ProjsSumms}}
|
{bummer_NOT_DISJOINT, {lists:sort(Flat), ProjsSumms}}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue