Remove all flap counting and inner projection stuff

This commit is contained in:
Scott Lystig Fritchie 2015-09-04 17:17:49 +09:00
parent 42aeecd9db
commit 4376ce9ec1
9 changed files with 156 additions and 1399 deletions

View file

@ -59,8 +59,6 @@
upi :: [pv1_server()], upi :: [pv1_server()],
repairing :: [pv1_server()], repairing :: [pv1_server()],
down :: [pv1_server()], down :: [pv1_server()],
flap :: 'undefined' | #flap_i{}, % flapping information
inner :: 'undefined' | #projection_v1{},
dbg :: list(), %proplist(), is checksummed dbg :: list(), %proplist(), is checksummed
dbg2 :: list(), %proplist(), is not checksummed dbg2 :: list(), %proplist(), is not checksummed
members_dict :: p_srvr_dict() members_dict :: p_srvr_dict()

File diff suppressed because it is too large Load diff

View file

@ -699,8 +699,6 @@ conv_to_projection_v1(#mpb_projectionv1{epoch_number=Epoch,
upi=UPI, upi=UPI,
repairing=Repairing, repairing=Repairing,
down=Down, down=Down,
opaque_flap=Flap,
opaque_inner=Inner,
opaque_dbg=Dbg, opaque_dbg=Dbg,
opaque_dbg2=Dbg2, opaque_dbg2=Dbg2,
members_dict=MembersDict}) -> members_dict=MembersDict}) ->
@ -714,8 +712,6 @@ conv_to_projection_v1(#mpb_projectionv1{epoch_number=Epoch,
upi=[to_atom(X) || X <- UPI], upi=[to_atom(X) || X <- UPI],
repairing=[to_atom(X) || X <- Repairing], repairing=[to_atom(X) || X <- Repairing],
down=[to_atom(X) || X <- Down], down=[to_atom(X) || X <- Down],
flap=dec_optional_sexp(Flap),
inner=dec_optional_sexp(Inner),
dbg=dec_sexp(Dbg), dbg=dec_sexp(Dbg),
dbg2=dec_sexp(Dbg2), dbg2=dec_sexp(Dbg2),
members_dict=conv_to_members_dict(MembersDict)}. members_dict=conv_to_members_dict(MembersDict)}.
@ -871,8 +867,6 @@ conv_from_projection_v1(#projection_v1{epoch_number=Epoch,
upi=UPI, upi=UPI,
repairing=Repairing, repairing=Repairing,
down=Down, down=Down,
flap=Flap,
inner=Inner,
dbg=Dbg, dbg=Dbg,
dbg2=Dbg2, dbg2=Dbg2,
members_dict=MembersDict}) -> members_dict=MembersDict}) ->
@ -886,8 +880,6 @@ conv_from_projection_v1(#projection_v1{epoch_number=Epoch,
upi=[to_list(X) || X <- UPI], upi=[to_list(X) || X <- UPI],
repairing=[to_list(X) || X <- Repairing], repairing=[to_list(X) || X <- Repairing],
down=[to_list(X) || X <- Down], down=[to_list(X) || X <- Down],
opaque_flap=enc_optional_sexp(Flap),
opaque_inner=enc_optional_sexp(Inner),
opaque_dbg=enc_sexp(Dbg), opaque_dbg=enc_sexp(Dbg),
opaque_dbg2=enc_sexp(Dbg2), opaque_dbg2=enc_sexp(Dbg2),
members_dict=conv_from_members_dict(MembersDict)}. members_dict=conv_from_members_dict(MembersDict)}.

View file

@ -130,7 +130,6 @@ update_checksum(P) ->
CSum = crypto:hash(sha, CSum = crypto:hash(sha,
term_to_binary(P#projection_v1{epoch_csum= <<>>, term_to_binary(P#projection_v1{epoch_csum= <<>>,
creation_time=undefined, creation_time=undefined,
flap=undefined,
dbg2=[]})), dbg2=[]})),
P#projection_v1{epoch_csum=CSum}. P#projection_v1{epoch_csum=CSum}.
@ -173,20 +172,10 @@ make_summary(#projection_v1{epoch_number=EpochNum,
author_server=Author, author_server=Author,
upi=UPI_list, upi=UPI_list,
repairing=Repairing_list, repairing=Repairing_list,
inner=Inner,
flap=Flap,
dbg=Dbg, dbg2=Dbg2}) -> dbg=Dbg, dbg2=Dbg2}) ->
InnerInfo = if is_record(Inner, projection_v1) ->
[{inner, make_summary(Inner)}];
true ->
[]
end,
[{epoch,EpochNum}, {csum,_CSum4}, [{epoch,EpochNum}, {csum,_CSum4},
{author,Author}, {mode,CMode},{witnesses, Witness_list}, {author,Author}, {mode,CMode},{witnesses, Witness_list},
{upi,UPI_list},{repair,Repairing_list},{down,Down_list}] ++ {upi,UPI_list},{repair,Repairing_list},{down,Down_list}] ++
InnerInfo ++
[{flap, Flap}] ++
%% [{flap, lists:flatten(io_lib:format("~p", [Flap]))}] ++
[{d,Dbg}, {d2,Dbg2}]. [{d,Dbg}, {d2,Dbg2}].
%% @doc Make a `p_srvr_dict()' out of a list of `p_srvr()' or out of a %% @doc Make a `p_srvr_dict()' out of a list of `p_srvr()' or out of a

View file

@ -323,10 +323,10 @@ do_proj_write4(ProjType, Proj, Path, Epoch, #state{consistency_mode=CMode}=S) ->
ok = file:write(FH, term_to_binary(Proj)), ok = file:write(FH, term_to_binary(Proj)),
ok = file:sync(FH), ok = file:sync(FH),
ok = file:close(FH), ok = file:close(FH),
EffectiveProj = machi_chain_manager1:inner_projection_or_self(Proj), EffectiveProj = Proj,
EffectiveEpoch = EffectiveProj#projection_v1.epoch_number, EffectiveEpoch = EffectiveProj#projection_v1.epoch_number,
EpochId = {Epoch, Proj#projection_v1.epoch_csum}, EpochId = machi_projection:get_epoch_id(Proj),
EffectiveEpochId = {EffectiveEpoch, EffectiveProj#projection_v1.epoch_csum}, EffectiveEpochId = machi_projection:get_epoch_id(EffectiveProj),
%% %%
NewS = if ProjType == public, NewS = if ProjType == public,
Epoch > element(1, S#state.max_public_epochid) -> Epoch > element(1, S#state.max_public_epochid) ->

View file

@ -396,8 +396,7 @@ make_req_fun({get_epoch_id},
fun() -> case Mod:read_latest_projection(Sock, private) of fun() -> case Mod:read_latest_projection(Sock, private) of
{ok, P} -> {ok, P} ->
#projection_v1{epoch_number=Epoch, #projection_v1{epoch_number=Epoch,
epoch_csum=CSum} = epoch_csum=CSum} = P,
machi_chain_manager1:inner_projection_or_self(P),
{ok, {Epoch, CSum}}; {ok, {Epoch, CSum}};
Error -> Error ->
Error Error

View file

@ -353,7 +353,5 @@ find_common_prefix([H|L1], [H|L2]) ->
find_common_prefix(_, _) -> find_common_prefix(_, _) ->
[]. [].
inner_projection_exists(#projection_v1{inner=undefined}) -> inner_projection_exists(_) ->
false; false.
inner_projection_exists(#projection_v1{inner=_}) ->
true.

View file

@ -378,16 +378,12 @@ convergence_demo_testfun(NumFLUs, MgrOpts0) ->
%% Uncomment *one* of the following make_partition_list() bodies. %% Uncomment *one* of the following make_partition_list() bodies.
make_partition_list(All_list) -> make_partition_list(All_list) ->
Island1 = [hd(All_list), lists:last(All_list)],
Island2 = All_list -- Island1,
[ [
[{b,c}], [{X,Y} || X <- Island1, Y <- Island2]
[{a,c},{b,c}] ++
%% [{b,c}], [{X,Y} || X <- Island2, Y <- Island1]
%% [],
%% [{c,d}],
%% [],
%% [{d,e}],
%% [],
%% [{c,e}]
]. ].
%% _X_Ys1 = [[{X,Y}] || X <- All_list, Y <- All_list, X /= Y], %% _X_Ys1 = [[{X,Y}] || X <- All_list, Y <- All_list, X /= Y],
@ -405,6 +401,35 @@ make_partition_list(All_list) ->
%% %% Concat = _X_Ys1 ++ _X_Ys2 ++ _X_Ys3, %% %% Concat = _X_Ys1 ++ _X_Ys2 ++ _X_Ys3,
%% random_sort(lists:usort([lists:sort(L) || L <- Concat])). %% random_sort(lists:usort([lists:sort(L) || L <- Concat])).
%% %% for len=5 and 2 witnesses
%% [
%% [{b,c}],
%% [],
%% [{b,c}],
%% [{a,c},{b,c}],
%% [{b,c}],
%% [],
%% [{c,d}],
%% [],
%% [{d,e}],
%% [],
%% [{d,c}],
%% [{b,c}],
%% [],
%% [{c,e}]
%% ].
%% [
%% [{b,c}],
%% [{a,c},{b,c}]
%% %% [{b,c}],
%% %% [],
%% %% [{c,d}],
%% %% [],
%% %% [{d,e}],
%% %% [],
%% %% [{c,e}]
%% ].
%% [ %% [
%% [{b,c}], %% [{b,c}],
%% [{b,c},{c,d},{e,a}], %% [{b,c},{c,d},{e,a}],
@ -675,9 +700,8 @@ get_latest_inner_proj_summ(FLU) ->
{ok, Proj} = ?FLU_PC:read_latest_projection(FLU, private), {ok, Proj} = ?FLU_PC:read_latest_projection(FLU, private),
#projection_v1{epoch_number=E, epoch_csum= <<CSum4:4/binary, _/binary>>, #projection_v1{epoch_number=E, epoch_csum= <<CSum4:4/binary, _/binary>>,
upi=UPI, repairing=Repairing, upi=UPI, repairing=Repairing,
witnesses=Witnesses, down=Down} = witnesses=Witnesses, down=Down} = Proj,
machi_chain_manager1:inner_projection_or_self(Proj), Inner_p = false,
Inner_p = machi_chain_manager1:inner_projection_exists(Proj),
EpochID = {E, CSum4}, EpochID = {E, CSum4},
{EpochID, UPI, Repairing, Down, Witnesses, Inner_p}. {EpochID, UPI, Repairing, Down, Witnesses, Inner_p}.

View file

@ -81,7 +81,7 @@ unanimous_report(Epoch, Namez) ->
FLU_Projs = [{FLUName, FLU_Projs = [{FLUName,
case ?FLU_PC:read_projection(FLU, private, Epoch) of case ?FLU_PC:read_projection(FLU, private, Epoch) of
{ok, T} -> {ok, T} ->
machi_chain_manager1:inner_projection_or_self(T); T;
_Else -> _Else ->
not_in_this_epoch not_in_this_epoch
end} || {FLUName, FLU} <- Namez], end} || {FLUName, FLU} <- Namez],