[ 
https://issues.apache.org/jira/browse/COUCHDB-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Shorin resolved COUCHDB-2910.
---------------------------------------
    Resolution: Not A Problem

Hi,

That's not a problem. /_bulk_docs request doesn't fails completely if one of 
the document is malformed or causes errors. Instead, it tries to store 
everything what is possible and returns response with success and error results 
which you should process.

This is useful optimization, especially when you do large bulk update since you 
have no reason to generate MiBs of traffic just because some conflict happened 
(that's common situation) or some document didn't pass validation (that's too).

> Wrong HTTP Status Code on Error
> -------------------------------
>
>                 Key: COUCHDB-2910
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2910
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>            Reporter: Kerem Güneş
>
> Hi,
> If I send  a _rev that will cos conflict, server is sending 201 code.
> POST /foo/_bulk_docs? HTTP/1.0
> Host: localhost:5984
> Connection: close
> Accept: application/json
> Content-Type: application/json
> User-Agent: Couch/v1.0.0 (+http://github.com/qeremy/couch-go)
> Content-Length: 126
> {"docs":[{"_id":"7ee9cdd673b109e030cec8c6f10020f7","_rev":"2-58967967c75f4e0223d9adb7e786a82","name":"kerem
>  3","type":"tmp"}]}
> HTTP/1.0 201 Created
> Server: CouchDB/1.5.0 (Erlang OTP/R16B03)
> Date: Thu, 03 Dec 2015 20:11:02 GMT
> Content-Type: application/json
> Content-Length: 100
> Cache-Control: must-revalidate
> [{"id":"7ee9cdd673b109e030cec8c6f10020f7","error":"conflict","reason":"Document
>  update conflict."}]
> Thank you!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to