couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [2/3] couch-replicator commit: updated refs/heads/master to 93c4cea
Date Tue, 04 Oct 2016 14:29:52 GMT
Fix handling of 413 responses for single document PUT requests

When replicator finds a document which has an attachment size greater than 64k,
or has more than 8 attachments, it switches to a non-batching mode and posts
each document separately using a PUT request with a multipart/related
Content-Type.

Explicitly handle the case when the response to the PUT request is a 413. Skip
the document and dump `doc_write_failures` count, just like in the case of the
413 response for a _bulk_docs POST request.

Jira: COUCHDB-3168


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/e5747dba
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/e5747dba
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/e5747dba

Branch: refs/heads/master
Commit: e5747dbaa2fb10760eb2cd3e289a01b51694c7cd
Parents: 2f23b57
Author: Nick Vatamaniuc <vatamane@apache.org>
Authored: Tue Oct 4 00:18:25 2016 -0400
Committer: Nick Vatamaniuc <vatamane@apache.org>
Committed: Tue Oct 4 00:45:56 2016 -0400

----------------------------------------------------------------------
 src/couch_replicator_api_wrap.erl | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/e5747dba/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_api_wrap.erl b/src/couch_replicator_api_wrap.erl
index 9043314..d20260f 100644
--- a/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator_api_wrap.erl
@@ -392,6 +392,8 @@ update_doc(#httpdb{} = HttpDb, #doc{id = DocId} = Doc, Options, Type)
->
                     throw({forbidden, get_value(<<"reason">>, Props)});
                 {412, <<"missing_stub">>} ->
                     throw({missing_stub, get_value(<<"reason">>, Props)});
+                {413, _} ->
+                    {error, request_body_too_large};
                 {_, Error} ->
                     {error, Error}
                 end


Mime
View raw message