WIP: debugging, uff da

This commit is contained in:
Scott Lystig Fritchie 2015-08-27 22:02:23 +09:00
parent efb89efb0d
commit 93b9b948fc
3 changed files with 14 additions and 4 deletions

View file

@ -1857,7 +1857,9 @@ react_to_env_C100(P_newprop, #projection_v1{author_server=Author_latest,
?REACT(c100),
Sane = projection_transition_is_sane(P_current, P_latest, MyName),
if Sane == true -> ok; true -> ?V("~w-insane-~w-auth=~w:~w:~w:~w:~w:~w:~w-~p,", [?LINE, MyName, P_newprop#projection_v1.author_server, P_newprop#projection_v1.epoch_number, P_newprop#projection_v1.upi, P_newprop#projection_v1.repairing, (inner_projection_or_self(P_newprop))#projection_v1.epoch_number, (inner_projection_or_self(P_newprop))#projection_v1.upi, (inner_projection_or_self(P_newprop))#projection_v1.repairing, Sane]) end, %%% DELME!!!
QQ_current = lists:flatten(io_lib:format("~w:~w,~w/~w:~w,~w", [P_current#projection_v1.epoch_number, P_current#projection_v1.upi, P_current#projection_v1.repairing, (inner_projection_or_self(P_current))#projection_v1.epoch_number, (inner_projection_or_self(P_current))#projection_v1.upi, (inner_projection_or_self(P_current))#projection_v1.repairing])),
QQ_latest = lists:flatten(io_lib:format("~w:~w,~w/~w:~w,~w", [P_latest#projection_v1.epoch_number, P_latest#projection_v1.upi, P_latest#projection_v1.repairing, (inner_projection_or_self(P_latest))#projection_v1.epoch_number, (inner_projection_or_self(P_latest))#projection_v1.upi, (inner_projection_or_self(P_latest))#projection_v1.repairing])),
if Sane == true -> ok; true -> ?V("\n~w-insane-~w-auth=~w ~s -> ~s ~w\n", [?LINE, MyName, P_newprop#projection_v1.author_server, QQ_current, QQ_latest, Sane]) end,
Flap_latest = if is_record(Flap_latest0, flap_i) ->
Flap_latest0;
true ->
@ -2687,7 +2689,12 @@ poll_private_proj_is_upi_unanimous3(#ch_mgr{name=MyName, proj=P_current,
PStr ->
PStr
end,
io:format(user, "\nCONFIRM epoch ~w ~W upi ~w rep ~w by ~w\n", [NewProj#projection_v1.epoch_number, NewProj#projection_v1.epoch_csum, 6, NewProj#projection_v1.upi, NewProj#projection_v1.repairing, MyName]),
#projection_v1{epoch_number=_EpochRep,
epoch_csum= <<_CSumRep:4/binary, _/binary>>,
upi=_UPIRep,
repairing=_RepairingRep} =
inner_projection_or_self(NewProj),
io:format(user, "\nCONFIRM epoch ~w ~w upi ~w rep ~w by ~w ~w\n", [_EpochRep, _CSumRep, _UPIRep, _RepairingRep, MyName, if P_current#projection_v1.inner == undefined -> outer; true -> {inner,{outer,P_current#projection_v1.epoch_number}} end]),
ok = machi_projection_store:write(ProjStore, private, NewProj),
%% Unwedge our FLU.
{ok, NotifyPid} = machi_projection_store:get_wedge_notify_pid(ProjStore),

View file

@ -174,7 +174,7 @@ make_summary(#projection_v1{epoch_number=EpochNum,
true ->
[]
end,
[{epoch,EpochNum}, %% {csum,CSum4},
[{epoch,EpochNum}, {csum,_CSum4},
{author,Author}, {mode,CMode},{witnesses, Witness_list},
{upi,UPI_list},{repair,Repairing_list},{down,Down_list}] ++
InnerInfo ++

View file

@ -306,7 +306,10 @@ do_proj_write3(ProjType, #projection_v1{epoch_number=Epoch,
if CurEpoch == Epoch, CurCSum == CSum ->
do_proj_write4(ProjType, Proj, Path, Epoch, S);
true ->
{{error, written}, S}
io:format(user, "OUCH: on disk: ~w\n", [machi_projection:make_summary(binary_to_term(Bin))]),
io:format(user, "OUCH: clobber: ~w\n", [machi_projection:make_summary(Proj)]),
io:format(user, "OUCH: clobber: ~p\n", [Proj#projection_v1.dbg2]),
{{error, written, CurEpoch, Epoch, CurCSum, CSum}, S}
end;
{error, enoent} ->
do_proj_write4(ProjType, Proj, Path, Epoch, S);