From dc04164e6f95bf29b83c82b2ab29350b4e8cc444 Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Wed, 1 May 2019 02:29:55 -0400 Subject: Fix full ring assertion in fabric stream shard replacements In fabric streams logic, after replacements are processed, the full ring assertion was made for the waiting and replaced workers. But, in cases when some of the workers already returned results, the assertion would fail, since those ranges would be missing. The fix is to consider not just waiting and replaced workers, but also the results that were already processed. --- src/fabric/src/fabric_streams.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fabric/src/fabric_streams.erl b/src/fabric/src/fabric_streams.erl index d0a549d6e..59c8b8a6b 100644 --- a/src/fabric/src/fabric_streams.erl +++ b/src/fabric/src/fabric_streams.erl @@ -106,8 +106,13 @@ handle_stream_start({rexi_EXIT, Reason}, Worker, St) -> fabric_dict:store(NewWorker, waiting, NewWorkers) end, Workers, WorkerReplacements), % Assert that our replaced worker provides us - % the oppurtunity to make progress. - true = fabric_ring:is_progress_possible(FinalWorkers), + % the oppurtunity to make progress. Need to make sure + % to include already processed responses, since we are + % checking the full range and some workers have already + % responded and were removed from the workers list + ReadyWorkers = [{W, R} || {_, W, R} <- Ready], + AllWorkers = FinalWorkers ++ ReadyWorkers, + true = fabric_ring:is_progress_possible(AllWorkers), NewRefs = fabric_dict:fetch_keys(FinalWorkers), {new_refs, NewRefs, St#stream_acc{ workers=FinalWorkers, -- cgit v1.2.1