[ 
https://issues.apache.org/jira/browse/COUCHDB-3113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15861726#comment-15861726
 ] 

ASF GitHub Bot commented on COUCHDB-3113:
-----------------------------------------

GitHub user tonysun83 opened a pull request:

    https://github.com/apache/couchdb-fabric/pull/88

    Use RealReplyCount to distinguish worker replies and invalid docs

    We use {ok, []} in couch_db:open_doc_revs_int/3 as a return value
    when the document does not exist and open_revs=all. This leads to an
    incorrect all_workers_died error. We use ReplyCount and RealReplyCount
    to distinguish between when no workers were actually used in a reply
    versus when the document does not exist
    
    COUCHDB-3113

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-fabric 
68661-separate-reply-count

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fabric/pull/88.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #88
    
----
commit 70535eeb9b9c226129bdc96cbca8492fbc867cf6
Author: Tony Sun <tony....@cloudant.com>
Date:   2017-02-10T19:23:07Z

    Use RealReplyCount to distinguish worker replies and invalid docs
    
    We use {ok, []} in couch_db:open_doc_revs_int/3 as a return value
    when the document does not exist and open_revs=all. This leads to an
    incorrect all_workers_died error. We use ReplyCount and RealReplyCount
    to distinguish between when no workers were actually used in a reply
    versus when the document does not exist
    
    COUCHDB-3113

----


> fabric:open_revs can return {ok, []}
> ------------------------------------
>
>                 Key: COUCHDB-3113
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3113
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: ILYA
>
> According to typespec fabric:open_revs should return
>  - {ok, #doc{}}  
>  - {{not_found,missing}, revision()} 
> However in the case when the coordinator receive rexi_EXIT from multiple 
> workers before the reply (for example when the worker crashes) the open_revs 
> reply becomes \{ok, []}.
> This is due to the fact that we dispatch rexi_DOWN and rexi_EXIT recursively 
> to handle_message(\{ok, Replies} [see 
> here|https://github.com/apache/couchdb-fabric/blob/master/src/fabric_doc_open_revs.erl#L73
>  clause]. Note that we set reply to be [] and worker to be nil. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to