From ca5ddb2cf192be7c14dbce28d2f8add4943ceb24 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Thu, 30 Oct 2014 17:22:56 +0900 Subject: [PATCH] WIP: chain mgmt prototype scaffolding 9: before start of next simulator stage --- prototype/poc-machi/src/machi_chain_manager1.erl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/prototype/poc-machi/src/machi_chain_manager1.erl b/prototype/poc-machi/src/machi_chain_manager1.erl index 9dbb643..ee52565 100644 --- a/prototype/poc-machi/src/machi_chain_manager1.erl +++ b/prototype/poc-machi/src/machi_chain_manager1.erl @@ -268,17 +268,16 @@ cl_read_latest_public_projection(#ch_mgr{proj=Proj}=S) -> end, Rs = [perhaps_call_t(S, Partitions, FLU, fun() -> DoIt(FLU) end) || FLU <- All_list], + FLUsRs = lists:zip(All_list, Rs), case lists:usort(Rs) of [P] when is_record(P, projection) -> - Extra = [{all_replied, length(Rs) == length(All_list)}], - {unanimous, P, [{unanimous,true}|Extra], S2}; + U_FLUs = [FLU || {FLU, Projx} <- FLUsRs, Projx == P], + Extra = [{all_members_replied, length(Rs) == length(All_list)}], + {unanimous, P, [{unanimous_flus,U_FLUs}|Extra], S2}; _ -> - FLUsRs = lists:zip(All_list, Rs), {needs_work, FLUsRs, [flarfus], S2} % todo? end. -% {_Status, S4} = do_read_repair(FLUsRs, Extra, S3), - %% 1. Do the results contain a projection? %% perhaps figure that in cl_read_latest_public_projection()? %% 2. Were there any error_unwritten? @@ -538,6 +537,9 @@ smoke0_test() -> try pong = ping(M0), + %% If/when calculate_projection_internal_old() disappears, then + %% get rid of the comprehension below ... start/ping/stop is + %% good enough for smoke0. [begin Proj = ?MGR:calculate_projection_internal_old(M0), io:format(user, "~w\n", [?MGR:make_projection_summary(Proj)])