You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Nuutti Kotivuori (JIRA)" <ji...@apache.org> on 2011/06/03 19:51:47 UTC

[jira] [Created] (COUCHDB-1185) Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert

Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert
--------------------------------------------------------------------------------------------------

                 Key: COUCHDB-1185
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1185
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 0.11
            Reporter: Nuutti Kotivuori


First, a reproduction recipe:

$ curl -X PUT http://localhost:5984/repltest
{"ok":true}
$ curl -H "Content-type: application/json" -X PUT --data '{"_id":"_design/a"}' http://localhost:5984/repltest/_design/a
{"ok":true,"id":"_design/a","rev":"1-967a00dff5e02add41819138abb3284d"}
$ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"_design/a","_rev":"1-967a00dff5e02add41819138abb3284d"},{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
[{"id":"_design/a","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"},{"id":"b","error":"conflict","reason":"Document update conflict."}]
$ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
[{"id":"b","rev":"2-4d0fe113895b8471147756712e3f42bb"}]

The first post failed, because it had a design document update in it, where as the second succeeded when it didn't. The first post succeeds if the other inserted document does not have "_rev" member.

So, having a design document in a bulk inserts causes document conflicts for documents that have "_rev" set that are missing from the database currently.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (COUCHDB-1185) Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert

Posted by "Nuutti Kotivuori (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043921#comment-13043921 ] 

Nuutti Kotivuori commented on COUCHDB-1185:
-------------------------------------------

There is also a difference in behaviour - bulk inserts for normal documents end up with rev "11-..." if the inserted document was "10-...", where as a normal PUT causes the revision to start with "1-...".

> Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert
> --------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1185
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1185
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Nuutti Kotivuori
>
> First, a reproduction recipe:
> $ curl -X PUT http://localhost:5984/repltest
> {"ok":true}
> $ curl -H "Content-type: application/json" -X PUT --data '{"_id":"_design/a"}' http://localhost:5984/repltest/_design/a
> {"ok":true,"id":"_design/a","rev":"1-967a00dff5e02add41819138abb3284d"}
> $ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"_design/a","_rev":"1-967a00dff5e02add41819138abb3284d"},{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
> [{"id":"_design/a","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"},{"id":"b","error":"conflict","reason":"Document update conflict."}]
> $ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
> [{"id":"b","rev":"2-4d0fe113895b8471147756712e3f42bb"}]
> The first post failed, because it had a design document update in it, where as the second succeeded when it didn't. The first post succeeds if the other inserted document does not have "_rev" member.
> So, having a design document in a bulk inserts causes document conflicts for documents that have "_rev" set that are missing from the database currently.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (COUCHDB-1185) Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert

Posted by "Nuutti Kotivuori (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043916#comment-13043916 ] 

Nuutti Kotivuori commented on COUCHDB-1185:
-------------------------------------------

This seems to be present in 1.0.2 as well.

> Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert
> --------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1185
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1185
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Nuutti Kotivuori
>
> First, a reproduction recipe:
> $ curl -X PUT http://localhost:5984/repltest
> {"ok":true}
> $ curl -H "Content-type: application/json" -X PUT --data '{"_id":"_design/a"}' http://localhost:5984/repltest/_design/a
> {"ok":true,"id":"_design/a","rev":"1-967a00dff5e02add41819138abb3284d"}
> $ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"_design/a","_rev":"1-967a00dff5e02add41819138abb3284d"},{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
> [{"id":"_design/a","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"},{"id":"b","error":"conflict","reason":"Document update conflict."}]
> $ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
> [{"id":"b","rev":"2-4d0fe113895b8471147756712e3f42bb"}]
> The first post failed, because it had a design document update in it, where as the second succeeded when it didn't. The first post succeeds if the other inserted document does not have "_rev" member.
> So, having a design document in a bulk inserts causes document conflicts for documents that have "_rev" set that are missing from the database currently.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (COUCHDB-1185) Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis resolved COUCHDB-1185.
----------------------------------------

    Resolution: Duplicate

Duplicate of COUCHDB-1184

I assumed the duplicate of link would've closed this.

> Design documents in bulk inserts cause change in behavior for normal documents in same bulk insert
> --------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1185
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1185
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Nuutti Kotivuori
>
> First, a reproduction recipe:
> $ curl -X PUT http://localhost:5984/repltest
> {"ok":true}
> $ curl -H "Content-type: application/json" -X PUT --data '{"_id":"_design/a"}' http://localhost:5984/repltest/_design/a
> {"ok":true,"id":"_design/a","rev":"1-967a00dff5e02add41819138abb3284d"}
> $ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"_design/a","_rev":"1-967a00dff5e02add41819138abb3284d"},{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
> [{"id":"_design/a","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"},{"id":"b","error":"conflict","reason":"Document update conflict."}]
> $ curl -H "Content-type: application/json" -X POST --data '{"docs":[{"_id":"b","_rev":"1-2f4a8d26d103e914167052aea70a5031"}]}' http://localhost:5984/repltest/_bulk_docs
> [{"id":"b","rev":"2-4d0fe113895b8471147756712e3f42bb"}]
> The first post failed, because it had a design document update in it, where as the second succeeded when it didn't. The first post succeeds if the other inserted document does not have "_rev" member.
> So, having a design document in a bulk inserts causes document conflicts for documents that have "_rev" set that are missing from the database currently.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira