Bugfixes for a->b column transition & flap dampening
This commit is contained in:
parent
18aac6e489
commit
9edd91f48e
1 changed files with 21 additions and 5 deletions
|
@ -1491,6 +1491,8 @@ react_to_env_A40(Retries, P_newprop, P_latest, LatestUnanimousP,
|
||||||
LatestAuthorDownP = a40_latest_author_down(P_latest, P_newprop, S)
|
LatestAuthorDownP = a40_latest_author_down(P_latest, P_newprop, S)
|
||||||
andalso
|
andalso
|
||||||
P_latest#projection_v1.author_server /= MyName,
|
P_latest#projection_v1.author_server /= MyName,
|
||||||
|
P_latestStable = make_comparison_stable(P_latest),
|
||||||
|
P_currentStable = make_comparison_stable(P_current),
|
||||||
?REACT({a40, ?LINE,
|
?REACT({a40, ?LINE,
|
||||||
[{latest_author, P_latest#projection_v1.author_server},
|
[{latest_author, P_latest#projection_v1.author_server},
|
||||||
{author_is_down_p, LatestAuthorDownP},
|
{author_is_down_p, LatestAuthorDownP},
|
||||||
|
@ -1518,7 +1520,7 @@ react_to_env_A40(Retries, P_newprop, P_latest, LatestUnanimousP,
|
||||||
andalso
|
andalso
|
||||||
(P_latest#projection_v1.epoch_number < P_current#projection_v1.epoch_number
|
(P_latest#projection_v1.epoch_number < P_current#projection_v1.epoch_number
|
||||||
orelse
|
orelse
|
||||||
P_latest /= P_current) ->
|
P_latestStable /= P_currentStable) ->
|
||||||
?REACT({a40, ?LINE,
|
?REACT({a40, ?LINE,
|
||||||
[{latest_epoch, P_latest#projection_v1.epoch_number},
|
[{latest_epoch, P_latest#projection_v1.epoch_number},
|
||||||
{current_epoch, P_current#projection_v1.epoch_number},
|
{current_epoch, P_current#projection_v1.epoch_number},
|
||||||
|
@ -1706,6 +1708,9 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP,
|
||||||
%% compound predicate below. I'm yanking it out now. TODO re-study?
|
%% compound predicate below. I'm yanking it out now. TODO re-study?
|
||||||
#projection_v1{upi=P_newprop_upi_ooi, repairing=P_newprop_repairing_ooi} =
|
#projection_v1{upi=P_newprop_upi_ooi, repairing=P_newprop_repairing_ooi} =
|
||||||
inner_projection_or_self(P_newprop),
|
inner_projection_or_self(P_newprop),
|
||||||
|
CurrentZerfInStatus = proplists:get_value(make_zerf,
|
||||||
|
P_current#projection_v1.dbg2),
|
||||||
|
CurrentEpoch = P_current#projection_v1.epoch_number,
|
||||||
EnoughAreFlapping_and_IamBad_p =
|
EnoughAreFlapping_and_IamBad_p =
|
||||||
%% Ignore inner_projection_exists(P_current): We might need to
|
%% Ignore inner_projection_exists(P_current): We might need to
|
||||||
%% shut up quickly (adopting a new P_current can take a long
|
%% shut up quickly (adopting a new P_current can take a long
|
||||||
|
@ -1720,14 +1725,21 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP,
|
||||||
(not lists:member(MyName, P_newprop_upi_ooi++P_newprop_repairing_ooi))
|
(not lists:member(MyName, P_newprop_upi_ooi++P_newprop_repairing_ooi))
|
||||||
andalso
|
andalso
|
||||||
%% My down lists are the same, i.e., no state change to announce
|
%% My down lists are the same, i.e., no state change to announce
|
||||||
P_current#projection_v1.down == P_newprop#projection_v1.down,
|
%% Or if P_current is a CP mode result of zerf_in & valid (epoch #),
|
||||||
|
%% then this down list comparison should be skipped.
|
||||||
|
((P_current#projection_v1.down == P_newprop#projection_v1.down)
|
||||||
|
orelse
|
||||||
|
(CurrentZerfInStatus == CurrentEpoch)),
|
||||||
?REACT({b10, ?LINE, [{0,EnoughAreFlapping_and_IamBad_p},
|
?REACT({b10, ?LINE, [{0,EnoughAreFlapping_and_IamBad_p},
|
||||||
{1,inner_projection_exists(P_current)},
|
{1,inner_projection_exists(P_current)},
|
||||||
{2,inner_projection_exists(P_latest)},
|
{2,inner_projection_exists(P_latest)},
|
||||||
{3,inner_projection_exists(P_newprop)},
|
{3,inner_projection_exists(P_newprop)},
|
||||||
{4,MyUniquePropCount},
|
{4,MyUniquePropCount},
|
||||||
{5,{MyName, P_newprop_AllHosedPlus}},
|
{5,{MyName, P_newprop_AllHosedPlus}},
|
||||||
{6,UnanimousLatestInnerNotRelevant_p}]}),
|
%% {6,UnanimousLatestInnerNotRelevant_p},
|
||||||
|
{7,P_current#projection_v1.down},
|
||||||
|
{8,P_newprop#projection_v1.down},
|
||||||
|
{9,{CurrentZerfInStatus,CurrentEpoch}}]}),
|
||||||
if
|
if
|
||||||
EnoughAreFlapping_and_IamBad_p ->
|
EnoughAreFlapping_and_IamBad_p ->
|
||||||
?REACT({b10, ?LINE, []}),
|
?REACT({b10, ?LINE, []}),
|
||||||
|
@ -3211,8 +3223,9 @@ make_zerf(#projection_v1{epoch_number=OldEpochNum,
|
||||||
make_zerf2(OldEpochNum, Up, MajoritySize, MyName, AllMembers, OldWitness_list,
|
make_zerf2(OldEpochNum, Up, MajoritySize, MyName, AllMembers, OldWitness_list,
|
||||||
MembersDict, OldFlap, S) ->
|
MembersDict, OldFlap, S) ->
|
||||||
try
|
try
|
||||||
Proj = zerf_find_last_common(MajoritySize, Up, S),
|
#projection_v1{epoch_number=Epoch} = Proj =
|
||||||
Proj2 = Proj#projection_v1{flap=OldFlap, dbg2=[]},
|
zerf_find_last_common(MajoritySize, Up, S),
|
||||||
|
Proj2 = Proj#projection_v1{flap=OldFlap, dbg2=[{make_zerf,Epoch}]},
|
||||||
%% io:format(user, "ZERF ~w\n",[machi_projection:make_summary(Proj2)]),
|
%% io:format(user, "ZERF ~w\n",[machi_projection:make_summary(Proj2)]),
|
||||||
Proj2
|
Proj2
|
||||||
catch
|
catch
|
||||||
|
@ -3427,3 +3440,6 @@ make_annotation(EpochID, Time) ->
|
||||||
|
|
||||||
is_annotated(#projection_v1{dbg2=Dbg2}) ->
|
is_annotated(#projection_v1{dbg2=Dbg2}) ->
|
||||||
proplists:get_value(private_proj_is_upi_unanimous, Dbg2, false).
|
proplists:get_value(private_proj_is_upi_unanimous, Dbg2, false).
|
||||||
|
|
||||||
|
make_comparison_stable(P) ->
|
||||||
|
P#projection_v1{flap=undefined, dbg2=[]}.
|
||||||
|
|
Loading…
Reference in a new issue