You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/11/03 15:56:40 UTC

[GitHub] [couchdb] nickva commented on a change in pull request #3815: Using _bulk_docs with new_edits false and without _rev should respond 400 Bad Request

nickva commented on a change in pull request #3815:
URL: https://github.com/apache/couchdb/pull/3815#discussion_r742089495



##########
File path: src/chttpd/src/chttpd_db.erl
##########
@@ -569,15 +569,23 @@ db_req(#httpd{method='POST',path_parts=[_,<<"_bulk_docs">>], user_ctx=Ctx}=Req,
             send_json(Req, 417, ErrorsJson)
         end;
     false ->
-        case fabric:update_docs(Db, Docs, [replicated_changes|Options]) of
-        {ok, Errors} ->
-            chttpd_stats:incr_writes(length(Docs)),
-            ErrorsJson = lists:map(fun update_doc_result_to_json/1, Errors),
-            send_json(Req, 201, ErrorsJson);
-        {accepted, Errors} ->
-            chttpd_stats:incr_writes(length(Docs)),
-            ErrorsJson = lists:map(fun update_doc_result_to_json/1, Errors),
-            send_json(Req, 202, ErrorsJson)
+        Docs2 = [Doc || Doc <- Docs, element(3, Doc) =/= {0, []}],

Review comment:
       Silently dropping documents seems a bit worrying. It's worth keeping in mind that `new_edits=false` option is intended intended for replication [mostly](https://docs.couchdb.org/en/stable/api/document/common.html#put--db-docid) : 
   
    > The ``false`` value is intended for use only by the replicator.
   
   So we want to make sure a broken replicator implementation doesn't just drop documents on the floor and continue on without noticing




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org