Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 384DA11D2C for ; Thu, 28 Aug 2014 12:37:26 +0000 (UTC) Received: (qmail 81403 invoked by uid 500); 28 Aug 2014 12:37:24 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 81071 invoked by uid 500); 28 Aug 2014 12:37:24 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 80505 invoked by uid 99); 28 Aug 2014 12:37:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2014 12:37:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4936FA02ECE; Thu, 28 Aug 2014 12:37:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Thu, 28 Aug 2014 12:37:33 -0000 Message-Id: In-Reply-To: <4cd3c9085adc4e6aa1bc12b6e6af4b37@git.apache.org> References: <4cd3c9085adc4e6aa1bc12b6e6af4b37@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/23] couchdb commit: updated refs/heads/master to aa9f32d Fix replication.js test Tweak hard coded assumptions about update_seq ordering for documents posted to _bulk_updates. See the comment in replication.js for more information. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/d8f1825f Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d8f1825f Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d8f1825f Branch: refs/heads/master Commit: d8f1825fa62ed9fa4308c4b72f2e9d31215776d8 Parents: e01e3a4 Author: Paul J. Davis Authored: Mon Aug 11 16:15:16 2014 -0500 Committer: Paul J. Davis Committed: Mon Aug 11 16:23:07 2014 -0500 ---------------------------------------------------------------------- share/www/script/test/replication.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8f1825f/share/www/script/test/replication.js ---------------------------------------------------------------------- diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js index 7e4ecc1..de62b3f 100644 --- a/share/www/script/test/replication.js +++ b/share/www/script/test/replication.js @@ -700,11 +700,24 @@ couchTests.replication = function(debug) { TEquals(true, repResult.history instanceof Array); TEquals(1, repResult.history.length); - // NOT 31 (31 is db seq for last doc - the ddoc, which was not replicated) - TEquals(30, repResult.source_last_seq); + // We (incorrectly) don't record update sequences for things + // that don't pass the changse feed filter. Historically the + // last document to pass was the second to last doc which has + // an update sequence of 30. Work that has been applied to avoid + // conflicts from duplicate IDs breaking _bulk_docs updates added + // a sort to the logic which changes this. Now the last document + // to pass has an doc id of "8" and is at update_seq 29 (because only + // "9" and the design doc are after it). + // + // In the future the fix ought to be that we record that update + // sequence of the database. BigCouch has some existing work on + // this in the clustered case because if you have very few documents + // that pass the filter then (given single node's behavior) you end + // up having to rescan a large portion of the database. + TEquals(29, repResult.source_last_seq); TEquals(0, repResult.history[0].start_last_seq); - TEquals(30, repResult.history[0].end_last_seq); - TEquals(30, repResult.history[0].recorded_seq); + TEquals(29, repResult.history[0].end_last_seq); + TEquals(29, repResult.history[0].recorded_seq); // 16 => 15 docs with even integer field + 1 doc with string field "7" TEquals(16, repResult.history[0].missing_checked); TEquals(16, repResult.history[0].missing_found); @@ -750,7 +763,7 @@ couchTests.replication = function(debug) { TEquals(36, repResult.source_last_seq); TEquals(true, repResult.history instanceof Array); TEquals(2, repResult.history.length); - TEquals(30, repResult.history[0].start_last_seq); + TEquals(29, repResult.history[0].start_last_seq); TEquals(36, repResult.history[0].end_last_seq); TEquals(36, repResult.history[0].recorded_seq); TEquals(3, repResult.history[0].missing_checked);