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

Filipe Manana updated COUCHDB-911:
----------------------------------

    Attachment: 0001-Add-test-test-etap-074-doc-update-conflicts.t.patch

Hi Bob, the patch looks correct to me, so +1.

While I understand the issue with bulk docs (because of the way we collect the 
results in the dictionary), looking briefly at the code, I don't see yet how 
the same issue can happen when we have multiple clients updating the same doc.

I made a test to confirm this, which is attached here and spawns many clients 
which attempt to update the same doc.

Running this test, with the following one liner on top of it:

http://friendpaste.com/I466uiIaQ8yzk0LUKPWAf

I get the following sample output:

http://friendpaste.com/3aMN5N8IWRuvw62hTbrZzB

So effectively it seems to me it covers that case. For 5000 clients for e.g., 
the updater was able to collect 80 updates for the same document.

Anyway, this is a good test to have around.


Minor detail: you're using some Emacs mode indentation which is very different 
from what we use everywhere else.

+    Docs2 = lists:map(fun(Doc) ->
+                          {Doc, make_ref()}
+                      end,Docs),

                
> Concurrent updates to the same document generate erroneous conflict messages
> ----------------------------------------------------------------------------
>
>                 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
>             Fix For: 1.2
>
>         Attachments: 
> 0001-Add-test-test-etap-074-doc-update-conflicts.t.patch, 
> 0001-Fix-whitespace.patch, 
> 0002-Failing-test-for-duplicates-in-bulk-docs.patch, 
> 0003-Add-references-to-docs-to-prevent-dups-from-being-co.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to