Adjustments for CP mode (still slightly experimental)

This commit is contained in:
Scott Lystig Fritchie 2015-09-13 14:56:28 +09:00
parent 32c4d39156
commit 0a20417682
2 changed files with 7 additions and 8 deletions

View file

@ -1516,12 +1516,8 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP,
repairing=P_latest_repairing} = P_latest, repairing=P_latest_repairing} = P_latest,
I_am_in_P_latest_upi = lists:member(MyName, P_latest_upi), I_am_in_P_latest_upi = lists:member(MyName, P_latest_upi),
I_am_in_P_latest_repairing = lists:member(MyName, P_latest_repairing), I_am_in_P_latest_repairing = lists:member(MyName, P_latest_repairing),
IsRelevantToMe_p = if CMode == cp_mode -> IsRelevantToMe_p = if P_latest_author == MyName ->
true; true;
CMode == ap_mode,
P_latest_author == MyName ->
true;
CMode == ap_mode,
not (I_am_in_P_latest_upi not (I_am_in_P_latest_upi
orelse I_am_in_P_latest_repairing) -> orelse I_am_in_P_latest_repairing) ->
%% There is no sense for me to leave whatever %% There is no sense for me to leave whatever
@ -1532,7 +1528,6 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP,
%% now P_latest and it's unanimous. But that %% now P_latest and it's unanimous. But that
%% doesn't make it a good idea. ^_^ %% doesn't make it a good idea. ^_^
false; false;
CMode == ap_mode,
I_am_in_P_latest_repairing -> I_am_in_P_latest_repairing ->
%% If I'm already in the current UPI, and the %% If I'm already in the current UPI, and the
%% UPI is longer than 1 (i.e., more than just %% UPI is longer than 1 (i.e., more than just
@ -1543,7 +1538,7 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP,
%% join a repairing list is relevant. %% join a repairing list is relevant.
not (lists:member(MyName, P_current_upi) andalso not (lists:member(MyName, P_current_upi) andalso
length(P_current_upi) > 1); length(P_current_upi) > 1);
CMode == ap_mode -> true ->
true true
end, end,
?REACT({b10,?LINE,[{newprop_epoch,P_newprop#projection_v1.epoch_number}, ?REACT({b10,?LINE,[{newprop_epoch,P_newprop#projection_v1.epoch_number},

View file

@ -312,7 +312,11 @@ do_incoming_spam(Author, Map,
NewMap = map_merge(OldMap, Map), NewMap = map_merge(OldMap, Map),
%% NewMapV = map_value(NewMap), %% NewMapV = map_value(NewMap),
%% io:format(user, "YY3 ~p\n", [NewMapV]), %% io:format(user, "YY3 ~p\n", [NewMapV]),
S2 = do_map_change(NewMap, [MyFluName, Author], MembersDict, S),
%% Hrm, we may have changes that are interesting to the
%% Author of this update, so perhaps we shouldn't exclude
%% Author from our update, right?
S2 = do_map_change(NewMap, [MyFluName], MembersDict, S),
{ok, S2} {ok, S2}
end. end.