You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Jan Lehnardt (JIRA)" <ji...@apache.org> on 2012/10/31 17:43:12 UTC

[jira] [Created] (COUCHDB-1584) Allow passing of open_doc parameters to _all_docs

Jan Lehnardt created COUCHDB-1584:
-------------------------------------

             Summary: Allow passing of open_doc parameters to _all_docs
                 Key: COUCHDB-1584
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
             Project: CouchDB
          Issue Type: New Feature
    Affects Versions: 1.2
            Reporter: Jan Lehnardt
            Priority: Minor


GET /_all_docs should take the same arguments as GET /db/doc

/_all_docs?revisions=true
/_all_docs?rev_info=true

See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jan Lehnardt commented on COUCHDB-1584:
---------------------------------------

>From the mail, for reference:


diff --git a/share/www/script/test/all_docs.js b/share/www/script/test/all_docs.js
index 66ad880..ff07b43 100644
--- a/share/www/script/test/all_docs.js
+++ b/share/www/script/test/all_docs.js
@@ -99,6 +99,21 @@ couchTests.all_docs = function(debug) {
  TEquals(true, rows[0].value.deleted);
  TEquals(null, rows[0].doc);

+  // try include_docs plus revision history
+  rows = db.allDocs({include_docs: true, revs: true}, ["2"]).rows;
+  TEquals(1, rows.length);
+  doc = rows[0].doc
+  TEquals("2", doc._id);
+  TEquals(3, doc.a);
+  TEquals({start: 1, ids: [doc._rev.slice(2)]}, doc._revisions);
+
+  rows = db.allDocs({include_docs: true, revs_info: true}, ["2"]).rows;
+  TEquals(1, rows.length);
+  doc = rows[0].doc
+  TEquals("2", doc._id);
+  TEquals(3, doc.a);
+  TEquals([{rev: doc._rev, status: "available"}], doc._revs_info);
+
  // add conflicts
  var conflictDoc1 = {
    _id: "3", _rev: "2-aa01552213fafa022e6167113ed01087", value: "X"

                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jens Alfke commented on COUCHDB-1584:
-------------------------------------

This may actually not be sufficient to let the replicator fetch revisions in bulk. The problem is that _all_docs takes an array of docids, but not revids — so the caller has no control over which revision of a document to get; they'll always get the winning one. So
(a) If a document is in conflict, the replicator will still have to use single-revision GETs to fetch the non-winning revision(s).
(b) There can be race conditions where a document is updated after the _changes feed is sent, so the _all_docs request will return that new revision, not the one the replicator knows about.

I don't think either of these cases will be all that common; it just means the replicator will have to be a bit careful to check the revids in the response from _all_docs, and possibly fetch some revisions one-by-one if it didn't get the right ones.
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jan Lehnardt updated COUCHDB-1584:
----------------------------------

    Description: 
GET /_all_docs should take the same arguments as GET /db/doc

/_all_docs?revisions=true
/_all_docs?revs_info=true

See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

  was:
GET /_all_docs should take the same arguments as GET /db/doc

/_all_docs?revisions=true
/_all_docs?rev_info=true

See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

    
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jan Lehnardt commented on COUCHDB-1584:
---------------------------------------

@jens, can you help by writing the JS tests? I can tackle the Erlang side then. The source is in share/www/script/test/all_docs.js and should be self-explaining. let me know if you have any questions!
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jens Alfke commented on COUCHDB-1584:
-------------------------------------

Sure. I've worked a bit with the JS tests before; I haven't actually modified the code yet, but it looks straightforward enough.

I can even do it in proper TDD fashion and write the tests before I have your implementation, then watch them fail :)
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jens Alfke commented on COUCHDB-1584:
-------------------------------------

@Jan, I've emailed you a patch that adds the tests.
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jan Lehnardt commented on COUCHDB-1584:
---------------------------------------

TBD: Paul Davis to verify that _revs_info is as cheap as _revisions.
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?rev_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jens Alfke commented on COUCHDB-1584:
-------------------------------------

+1. A major benefit of this would be to enable significant speedups to 'pull' replication, since the replicator would be able to fetch new revisions in bulk. (Presently it has to fetch them individually, AFAIK, because that's the only way to get the rev history.)
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

--
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-1584) Allow passing of open_doc parameters to _all_docs

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

Jan Lehnardt commented on COUCHDB-1584:
---------------------------------------

@Jens, that was the plan, if you could do the tests, I can make them un-fail :) #tagteam
                
> Allow passing of open_doc parameters to _all_docs
> -------------------------------------------------
>
>                 Key: COUCHDB-1584
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1584
>             Project: CouchDB
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Jan Lehnardt
>            Priority: Minor
>
> GET /_all_docs should take the same arguments as GET /db/doc
> /_all_docs?revisions=true
> /_all_docs?revs_info=true
> See http://wiki.apache.org/couchdb/HTTP_Document_API#GET for details

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