You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2019/05/01 14:03:56 UTC

[couchdb] branch fix-replacements-ring-assertion-logic created (now 8e57fd7)

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a change to branch fix-replacements-ring-assertion-logic
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 8e57fd7  Fix full ring assertion in fabric stream shard replacements

This branch includes the following new commits:

     new 8e57fd7  Fix full ring assertion in fabric stream shard replacements

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Fix full ring assertion in fabric stream shard replacements

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch fix-replacements-ring-assertion-logic
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 8e57fd78e28935fa0ea59cc11953b4ab906a9517
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Wed May 1 02:29:55 2019 -0400

    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 d0a549d..59c8b8a 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,