[
https://issues.apache.org/jira/browse/COUCHDB-911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918816#action_12918816
]
Klaus Trainer commented on COUCHDB-911:
---------------------------------------
Sorry, I need to currect myself. I was too stupid to correctly specify the
_bulk_docs URL.
I can confirm that the described behavior also applies to CouchDB 1.0.1.
curl http://127.0.0.1:5984/db/_bulk_docs -d '{"docs": [{"_id":"foo"},
{"_id":"foo"}]}' -H 'Content-Type: application/json'
[{"id":"foo","error":"conflict","reason":"Document update
conflict."},{"id":"foo","error":"conflict","reason":"Document update
conflict."}]
However, one of the updates actually succeeded.
Note that when "all_or_nothing": true is specified, the result is different.
curl http://127.0.0.1:5984/db/_bulk_docs -d '{"all_or_nothing": true, "docs":
[{"_id":"foo"}, {"_id":"foo"}]}' -H 'Content-Type: application/json'
[{"id":"foo","rev":"1-967a00dff5e02add41819138abb3284d"},{"id":"foo","rev":"1-967a00dff5e02add41819138abb3284d"}]
> Repeating a doc._id in a _bulk_docs request results in erroneous "Document
> conflict" error
> ------------------------------------------------------------------------------------------
>
> Key: COUCHDB-911
> URL: https://issues.apache.org/jira/browse/COUCHDB-911
> Project: CouchDB
> Issue Type: Bug
> Components: HTTP Interface
> Affects Versions: 1.0
> Environment: Cloudant BigCouch EC2 node
> Reporter: Jay Nelson
> Priority: Minor
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Repeating an "_id" in a _bulk_docs post data file results in both entries
> being reported as document conflict errors. The first occurrence actual
> inserts into the database, and only the second occurrence should report a
> conflict.
> curl -d '{ "docs": [ {"_id":"foo"}, {"_id","foo"} ] }' -H
> 'Content-Type:application/json' -X POST
> http://appadvice.cloudant.com/foo/_bulk_docs
> [{"id":"foo","error":"conflict","reason":"Document update
> conflict."},{"id":"foo","error":"conflict","reason":"Document update
> conflict."}]
> But the database shows that one new document was actually inserted.
> Only the second occurrence should report conflict. The first occurrence
> should report the "_rev" property of the newly inserted doc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.