You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/08/11 23:16:12 UTC

[3/3] couchdb commit: updated refs/heads/windsor-merge to 36c806f

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/36c806f0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/36c806f0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/36c806f0

Branch: refs/heads/windsor-merge
Commit: 36c806f0d57631093f65745eec98b3d3cd49d893
Parents: e01e3a4
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Aug 11 16:15:16 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Mon Aug 11 16:15:16 2014 -0500

----------------------------------------------------------------------
 share/www/script/test/replication.js | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/36c806f0/share/www/script/test/replication.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js
index 7e4ecc1..eba2d58 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);