WIP: pre-dinner paranoid checkin

This commit is contained in:
Scott Lystig Fritchie 2015-08-27 18:45:27 +09:00
parent 65cd18939c
commit 12b74a52fd
3 changed files with 13 additions and 21 deletions

View file

@ -2672,7 +2672,7 @@ poll_private_proj_is_upi_unanimous3(#ch_mgr{name=MyName, proj=P_current,
EpochID = machi_projection:make_epoch_id(Proj_ios), EpochID = machi_projection:make_epoch_id(Proj_ios),
{Rs, S2} = read_latest_projection_call_only2(private, UPI, S), {Rs, S2} = read_latest_projection_call_only2(private, UPI, S),
Rs2 = [if is_record(P, projection_v1) -> Rs2 = [if is_record(P, projection_v1) ->
machi_projection:make_epoch_id(P); machi_projection:make_epoch_id(inner_projection_or_self(P));
true -> true ->
P P
end || #projection_v1{}=P <- Rs], end || #projection_v1{}=P <- Rs],
@ -2688,9 +2688,7 @@ poll_private_proj_is_upi_unanimous3(#ch_mgr{name=MyName, proj=P_current,
PStr -> PStr ->
PStr PStr
end, end,
[io:format(user, "whereis(~w) ~w, ", [X, whereis(X)]) || io:format(user, "POLL: ~w: ~w updates ~w ~W ~w\n", [S#ch_mgr.name, P_current#projection_v1.epoch_csum == (machi_projection:update_checksum(P_current))#projection_v1.epoch_csum, NewProj#projection_v1.epoch_number, NewProj#projection_v1.epoch_csum, 6, NewProj#projection_v1.epoch_csum == (machi_projection:update_checksum(NewProj))#projection_v1.epoch_csum]),
X <- [a_pstore, a_pstore2]],
io:format(user, "POLL: ~w updates ~w ~W\n", [S#ch_mgr.name, NewProj#projection_v1.epoch_number, NewProj#projection_v1.epoch_csum, 6]),
ok = machi_projection_store:write(ProjStore, private, NewProj), ok = machi_projection_store:write(ProjStore, private, NewProj),
%% Unwedge our FLU. %% Unwedge our FLU.
io:format(user, "\nUnwedge ~w @ ~W\n", [MyName, EpochID, 7]), io:format(user, "\nUnwedge ~w @ ~W\n", [MyName, EpochID, 7]),

View file

@ -276,22 +276,15 @@ do_proj_read(ProjType, Epoch, S_or_Dir) ->
{{error, Else}, S_or_Dir} {{error, Else}, S_or_Dir}
end. end.
do_proj_write(public=ProjType, Proj, S) -> do_proj_write(ProjType, Proj, S) ->
do_proj_write2(ProjType, Proj, S); do_proj_write2(ProjType, Proj, S).
do_proj_write(private=ProjType, #projection_v1{epoch_number=Epoch}=Proj, S) ->
case S#state.max_public_epochid of
{PublicEpoch, _} when PublicEpoch =< Epoch ->
do_proj_write2(ProjType, Proj, S);
{_PublicEpoch, _} ->
{{error, bad_arg}, S}
end.
do_proj_write2(ProjType, #projection_v1{epoch_csum=CSum}=Proj, S) -> do_proj_write2(ProjType, #projection_v1{epoch_csum=CSum}=Proj, S) ->
case (machi_projection:update_checksum(Proj))#projection_v1.epoch_csum of case (machi_projection:update_checksum(Proj))#projection_v1.epoch_csum of
CSum2 when CSum2 == CSum -> CSum2 when CSum2 == CSum ->
do_proj_write3(ProjType, Proj, S); do_proj_write3(ProjType, Proj, S);
_Else -> _Else ->
{{error, bad_arg}, S} {{error, bad_arg_badddddddddddddddddddddddddd_csum, CSum, _Else}, S}
end. end.
do_proj_write3(ProjType, #projection_v1{epoch_number=Epoch, do_proj_write3(ProjType, #projection_v1{epoch_number=Epoch,

View file

@ -371,13 +371,14 @@ convergence_demo_testfun(NumFLUs, MgrOpts0) ->
make_partition_list(All_list) -> make_partition_list(All_list) ->
[ [
[{b,c}], [{b,c}]
[], %% [{b,c}],
[{c,d}], %% [],
[], %% [{c,d}],
[{d,e}], %% [],
[], %% [{d,e}],
[{c,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],