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 2018/07/17 19:28:53 UTC

[couchdb] branch switch-fabric-to-use-message-based-attachment-receiver updated (8d6d2e9 -> d65e226)

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

vatamane pushed a change to branch switch-fabric-to-use-message-based-attachment-receiver
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 8d6d2e9  Switch fabric attachment reciever to use messages instead of function closures
     new d65e226  Switch fabric attachment receiver to use messages

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (8d6d2e9)
            \
             N -- N -- N   refs/heads/switch-fabric-to-use-message-based-attachment-receiver (d65e226)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:


[couchdb] 01/01: Switch fabric attachment receiver to use messages

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

vatamane pushed a commit to branch switch-fabric-to-use-message-based-attachment-receiver
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d65e2264c1260f0ea4e9c91d3583c5b15de89f4d
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Tue Jul 17 14:53:26 2018 -0400

    Switch fabric attachment receiver to use messages
    
    Function closures are fragile and attachment uploads would break if
    fabric_doc_attachments is different on any of the nodes in a cluster, like it
    might happen during a roling cluster upgrade.
    
    Previously fe53e437ca5ec9d23aa1b55d7934daced157a9e3 introduced two versions of
    the module one which handles function closure, other which handled message but
    only in this commit messages are starting to be sent.
    
    To avoid breakages in attachemnt uploads during the period of a rolling cluster
    upgrade, make sure to upgrade to that commit first then upgrade to this change.
    
    Issue #1394
---
 src/fabric/src/fabric.erl | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/fabric/src/fabric.erl b/src/fabric/src/fabric.erl
index 4a07271..f5c7937 100644
--- a/src/fabric/src/fabric.erl
+++ b/src/fabric/src/fabric.erl
@@ -271,13 +271,14 @@ purge_docs(_DbName, _IdsRevs) ->
     not_implemented.
 
 %% @doc spawns a process to upload attachment data and
-%%      returns a function that shards can use to communicate
-%%      with the spawned middleman process
+%%      returns a fabric attachment receiver context tuple
+%%      with the spawned middleman process, an empty binary,
+%%      or exits with an error tuple {Error, Arg}
 -spec att_receiver(#httpd{}, Length :: undefined | chunked | pos_integer() |
         {unknown_transfer_encoding, any()}) ->
-    function() | binary().
+    {fabric_attachment_receiver, pid(), chunked | pos_integer()} | binary().
 att_receiver(Req, Length) ->
-    fabric_doc_attachments:receiver(Req, Length).
+    fabric_doc_atts:receiver(Req, Length).
 
 %% @equiv all_docs(DbName, [], Callback, Acc0, QueryArgs)
 all_docs(DbName, Callback, Acc, QueryArgs) ->