From dev-return-4981-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Mon Jul 06 16:09:28 2009 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 82227 invoked from network); 6 Jul 2009 16:09:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Jul 2009 16:09:27 -0000 Received: (qmail 50470 invoked by uid 500); 6 Jul 2009 16:09:37 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 50386 invoked by uid 500); 6 Jul 2009 16:09:37 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 50366 invoked by uid 99); 6 Jul 2009 16:09:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2009 16:09:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2009 16:09:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E5141234C1E6 for ; Mon, 6 Jul 2009 09:09:14 -0700 (PDT) Message-ID: <1902264611.1246896554937.JavaMail.jira@brutus> Date: Mon, 6 Jul 2009 09:09:14 -0700 (PDT) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-389) [PATCH] Make offset calculation more available during btree folding In-Reply-To: <807846367.1245359647369.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727604#action_12727604 ] Paul Joseph Davis commented on COUCHDB-389: ------------------------------------------- For reference, this patch makes sure that an offset is calculated for all view responses. Before if the view didn't return any rows, no offset was calculated. I plan on adding this tonight unless someone spots an error. > [PATCH] Make offset calculation more available during btree folding > ------------------------------------------------------------------- > > Key: COUCHDB-389 > URL: https://issues.apache.org/jira/browse/COUCHDB-389 > Project: CouchDB > Issue Type: Improvement > Components: Database Core > Affects Versions: 0.9 > Reporter: Brad Anderson > Priority: Minor > Attachments: clustered_offset.patch, couchdb-389-2.svn.patch, couchdb-389-3.git.patch, couchdb-389.svn.patch > > > When CouchDB returns no values for _all_docs (or potentially any fold over the btree), then no offset is calculated, either. This is not a problem in non-clustered CouchDB. However, when you are in a clustered environment and treat each shard as its own CouchDB, then not returning an offset when no values are found on the shard can be problematic. The specific case is if there is a startkey or skip specified, and there were values before (or after with descending=true) the startkey or skip values, but there are no current values. > Moving the Offset calculation to be available for all clauses in the return fun of couch_httpd_view:make_view_fold_fun/6 allows the user to store Offsets in the RowFunAcc and client code using this function will work as expected. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.