You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Michael Phan-Ba (JIRA)" <ji...@apache.org> on 2012/05/27 18:04:23 UTC

[jira] [Created] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Michael Phan-Ba created COUCHDB-1485:
----------------------------------------

             Summary: COPY behavior changed between 1.1.1 to 1.2
                 Key: COUCHDB-1485
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
             Project: CouchDB
          Issue Type: Question
          Components: HTTP Interface
    Affects Versions: 1.2
         Environment: Mac OS X 10.7.4
            Reporter: Michael Phan-Ba


I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.

Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?

--
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

        

Re: [jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Oct 30, 2012 at 7:13 PM, Robert Newson <rn...@apache.org> wrote:
> #!/bin/sh
>
> URL="localhost:5984/db1"
>
> curl "localhost:5984"
> curl $URL -XDELETE
> curl $URL -XPUT
> curl $URL/doc1 -XPUT -d '{}'
> curl $URL/doc1 -HDestination:doc2 -XCOPY
>
> {"couchdb":"Welcome","version":"1.1.1"}
> {"error":"not_found","reason":"missing"}
> {"ok":true}
> {"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
> {"id":"doc2","rev":"1-967a00dff5e02add41819138abb3284d"}
>
> vs
>
> {"couchdb":"Welcome","version":"1.2.0"}
> {"ok":true}
> {"ok":true}
> {"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
> {"ok":true,"id":"doc2","rev":"1-6aaf7080aad9d1a9482e07c46581dac0"}
>

odd. I never paid attention. Though I wouldn't care about it... It is
somehow unexpected (how could revisions be the same since the docids
changed)

Re: [jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Posted by Robert Newson <rn...@apache.org>.
#!/bin/sh

URL="localhost:5984/db1"

curl "localhost:5984"
curl $URL -XDELETE
curl $URL -XPUT
curl $URL/doc1 -XPUT -d '{}'
curl $URL/doc1 -HDestination:doc2 -XCOPY

{"couchdb":"Welcome","version":"1.1.1"}
{"error":"not_found","reason":"missing"}
{"ok":true}
{"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
{"id":"doc2","rev":"1-967a00dff5e02add41819138abb3284d"}

vs

{"couchdb":"Welcome","version":"1.2.0"}
{"ok":true}
{"ok":true}
{"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
{"ok":true,"id":"doc2","rev":"1-6aaf7080aad9d1a9482e07c46581dac0"}

On 30 October 2012 17:47, Benoit Chesneau <bc...@gmail.com> wrote:
> On Mon, Oct 29, 2012 at 8:52 PM, Randall Leeds (JIRA) <ji...@apache.org> wrote:
>
>
>>
>> Whatever the case, it's always been that COPY returns the new revision in the response. I don't know if it was every guaranteed that the revision id would stay the same after a COPY.
>
> I'm pretty sure the revision in the new doc resulting from the copy
> has always been different from the source.

Re: [jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Posted by Benoit Chesneau <bc...@gmail.com>.
On Mon, Oct 29, 2012 at 8:52 PM, Randall Leeds (JIRA) <ji...@apache.org> wrote:


>
> Whatever the case, it's always been that COPY returns the new revision in the response. I don't know if it was every guaranteed that the revision id would stay the same after a COPY.

I'm pretty sure the revision in the new doc resulting from the copy
has always been different from the source.

[jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Randall Leeds commented on COUCHDB-1485:
----------------------------------------

7e3c69ba951de7cfaa095145ba49c58d539a28ea does not seem to be responsible for this change but I can verify that the revision hash does not change with the COPY command on 1.1.1.

I'm currently searching through the 1.2.x branch trying to determine where this change was introduced.

Whatever the case, it's always been that COPY returns the new revision in the response. I don't know if it was every guaranteed that the revision id would stay the same after a COPY.
                
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>            Assignee: Randall Leeds
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Michael Phan-Ba updated COUCHDB-1485:
-------------------------------------

    Description: 
I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.

Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?

See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

  was:
I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.

Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?

See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
https://github.com/mikepb/clerk

    
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
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

        

[jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Randall Leeds commented on COUCHDB-1485:
----------------------------------------

Thanks, Robert. I'll take a look.
                
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>            Assignee: Randall Leeds
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Jan Lehnardt reassigned COUCHDB-1485:
-------------------------------------

    Assignee: Randall Leeds
    
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>            Assignee: Randall Leeds
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
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

        

[jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Randall Leeds commented on COUCHDB-1485:
----------------------------------------

This change actually happened with the introduction of ejson.

The COPY handler doesn't open the doc with the ejson_body option and the revision calculation includes the body. The disk binary is used in the rev id on the COPY destination, but the ejson body is used when the doc is first created.

A related behavior was noticed and brought up by Kxepal. When PUT'ing attachments to a document, the document is opened without ejson_body and so the revision id is calculated from the binary body if the old document while the original revision would have been calculated from the ejson parsed from the request body on doc updates.

In both cases, parsing the document body an unnecessary operation. I will ilkely call both of these "won't fix" if I don't hear anything for a few days, but I'll give others a chance to weigh in.
                
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>            Assignee: Randall Leeds
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Robert Newson commented on COUCHDB-1485:
----------------------------------------

I bisected and it pointed to e2e8554d4de18c4ad3765fb105491c77997aff39 for this change.
                
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>            Assignee: Randall Leeds
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

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

Michael Phan-Ba updated COUCHDB-1485:
-------------------------------------

    Description: 
I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.

Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?

See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
https://github.com/mikepb/clerk

  was:
I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.

Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?

    
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk

--
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