Allow pstore -> FLU unwedge only in ap_mode, machi_cr_client_test broken (uses cp_mode)

This commit is contained in:
Scott Lystig Fritchie 2015-08-26 15:51:14 +09:00
parent e8f3ab381d
commit 568e165f4f

View file

@ -314,7 +314,7 @@ do_proj_write3(ProjType, #projection_v1{epoch_number=Epoch,
{{error, Else}, S} {{error, Else}, S}
end. end.
do_proj_write4(ProjType, Proj, Path, Epoch, S) -> do_proj_write4(ProjType, Proj, Path, Epoch, #state{consistency_mode=CMode}=S) ->
{ok, FH} = file:open(Path, [write, raw, binary]), {ok, FH} = file:open(Path, [write, raw, binary]),
ok = file:write(FH, term_to_binary(Proj)), ok = file:write(FH, term_to_binary(Proj)),
ok = file:sync(FH), ok = file:sync(FH),
@ -340,11 +340,14 @@ do_proj_write4(ProjType, Proj, Path, Epoch, S) ->
end, end,
S#state{max_public_epochid=EpochId}; S#state{max_public_epochid=EpochId};
ProjType == private, ProjType == private,
CMode == ap_mode,
Epoch > element(1, S#state.max_private_epochid) -> Epoch > element(1, S#state.max_private_epochid) ->
update_wedge_state( update_wedge_state(
S#state.wedge_notify_pid, false, S#state.wedge_notify_pid, false,
EffectiveEpochId), EffectiveEpochId),
S#state{max_private_epochid=EpochId}; S#state{max_private_epochid=EpochId};
%% If ProjType == private and CMode == cp_mode, then
%% the unwedge action is not performed here!
true -> true ->
S S
end, end,