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

[01/23] couchdb commit: updated refs/heads/master to aa9f32d

Repository: couchdb
Updated Branches:
  refs/heads/master 73a03074d -> aa9f32d8f


Import new applications


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/699ad9c1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/699ad9c1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/699ad9c1

Branch: refs/heads/master
Commit: 699ad9c143fee85ca3cc97518f6bccda304b7310
Parents: 5c94e81
Author: Robert Newson <rn...@apache.org>
Authored: Tue Jul 22 17:12:26 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Aug 6 12:44:16 2014 +0100

----------------------------------------------------------------------
 rebar.config.script | 4 ++++
 rel/reltool.config  | 6 ++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/699ad9c1/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index 2525865..afe0b0f 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -17,6 +17,7 @@ os:putenv("COUCHDB_CONFIG", ConfigureEnv).
 
 
 DepDescs = [
+    {cassim, "couchdb-cassim", {branch, "windsor-merge"}, []},
     {couch_log, "couchdb-couch-log", {branch, "master"}, []},
     {config, "couchdb-config", {branch, "master"}, []},
     {chttpd, "couchdb-chttpd", {branch, "master"}, []},
@@ -26,16 +27,19 @@ DepDescs = [
     {couch_replicator, "couchdb-couch-replicator", {branch,  "master"}, []},
     {couch_dbupdates, "couchdb-couch-dbupdates", {branch, "master"}, []},
     {couch_plugins, "couchdb-couch-plugins", {branch, "master"}, []},
+    {couch_event, "couchdb-couch-event", {branch, "windsor-merge"}, []},
     {ddoc_cache, "couchdb-ddoc-cache", {branch, "master"}, []},
     {ets_lru, "couchdb-ets-lru", {branch, "master"}, []},
     {fabric, "couchdb-fabric", {branch,  "master"}, []},
     {ibrowse, "couchdb-ibrowse", {tag,  "master"}, []},
     {jiffy, "couchdb-jiffy", {branch, "master"}, []},
+    {khash, "couchdb-khash", {branch, "windsor-merge"}, []},
     {mem3, "couchdb-mem3", {branch, "master"}, []},
     {mochiweb, "couchdb-mochiweb", {branch, "master"}, []},
     {oauth, "couchdb-oauth", {branch, "master"}, []},
     {rexi, "couchdb-rexi", {branch, "master"}, []},
     {snappy, "couchdb-snappy", {branch, "1994-merge-rcouch"}, []},
+    {b64url, "couchdb-b64url", {branch, "windsor-merge"}, []},
     {fauxton, "couchdb-fauxton", {branch, "master"}, [raw]},
     {docs, "couchdb-documentation", {branch, "master"}, [raw]}
 ],

http://git-wip-us.apache.org/repos/asf/couchdb/blob/699ad9c1/rel/reltool.config
----------------------------------------------------------------------
diff --git a/rel/reltool.config b/rel/reltool.config
index d1b0321..6e2507c 100644
--- a/rel/reltool.config
+++ b/rel/reltool.config
@@ -27,6 +27,7 @@
         syntax_tools,
         xmerl,
         %% couchdb
+        cassim,
         chttpd,
         config,
         couch,
@@ -36,12 +37,14 @@
         couch_mrview,
         couch_plugins,
         couch_replicator,
+        couch_event,
         ddoc_cache,
         ets_lru,
         fabric,
         goldrush,
         ibrowse,
         jiffy,
+        khash,
         lager,
         mem3,
         mochiweb,
@@ -72,6 +75,7 @@
     {app, xmerl, [{incl_cond, include}]},
 
     %% couchdb
+    {app, cassim, [{incl_cond, include}]},
     {app, chttpd, [{incl_cond, include}]},
     {app, config, [{incl_cond, include}]},
     {app, couch, [{incl_cond, include}]},
@@ -81,12 +85,14 @@
     {app, couch_mrview, [{incl_cond, include}]},
     {app, couch_plugins, [{incl_cond, include}]},
     {app, couch_replicator, [{incl_cond, include}]},
+    {app, couch_event, [{incl_cond, include}]},
     {app, ddoc_cache, [{incl_cond, include}]},
     {app, ets_lru, [{incl_cond, include}]},
     {app, fabric, [{incl_cond, include}]},
     {app, goldrush, [{incl_cond, include}]},
     {app, ibrowse, [{incl_cond, include}]},
     {app, jiffy, [{incl_cond, include}]},
+    {app, khash, [{incl_cond, include}]},
     {app, lager, [{incl_cond, include}]},
     {app, mem3, [{incl_cond, include}]},
     {app, mochiweb, [{incl_cond, include}]},


[10/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Disabling this assertion until we figure out lager

The change to lager changed how w configure logging in CouchDB. We'll
need to figure out if we want to update things so that we can configure
lager from the INI files at which point we can either reenable this test
or remove it.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e01e3a4f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e01e3a4f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e01e3a4f

Branch: refs/heads/master
Commit: e01e3a4f742222327dc84e0f0ba6818c11ed4213
Parents: 99a5a0b
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Aug 11 14:13:56 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Mon Aug 11 14:13:56 2014 -0500

----------------------------------------------------------------------
 share/www/script/test/config.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e01e3a4f/share/www/script/test/config.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/config.js b/share/www/script/test/config.js
index 193aa89..37b339b 100644
--- a/share/www/script/test/config.js
+++ b/share/www/script/test/config.js
@@ -53,7 +53,7 @@ couchTests.config = function(debug) {
   T(config.couchdb.database_dir);
   T(config.daemons.httpd);
   T(config.httpd_global_handlers._config);
-  T(config.log.level);
+  // T(config.log.level);
   T(config.query_servers.javascript);
 
   // test that settings can be altered, and that an undefined whitelist allows any change


[18/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Include global changes in the release


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/91f51216
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/91f51216
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/91f51216

Branch: refs/heads/master
Commit: 91f51216b39368bb3dfc71258da6c78dc93bdb42
Parents: ed4f496
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Aug 14 12:04:23 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Thu Aug 14 12:04:23 2014 -0500

----------------------------------------------------------------------
 rel/reltool.config | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/91f51216/rel/reltool.config
----------------------------------------------------------------------
diff --git a/rel/reltool.config b/rel/reltool.config
index 6e2507c..d5c76bc 100644
--- a/rel/reltool.config
+++ b/rel/reltool.config
@@ -41,6 +41,7 @@
         ddoc_cache,
         ets_lru,
         fabric,
+        global_changes,
         goldrush,
         ibrowse,
         jiffy,
@@ -89,6 +90,7 @@
     {app, ddoc_cache, [{incl_cond, include}]},
     {app, ets_lru, [{incl_cond, include}]},
     {app, fabric, [{incl_cond, include}]},
+    {app, global_changes, [{incl_cond, include}]},
     {app, goldrush, [{incl_cond, include}]},
     {app, ibrowse, [{incl_cond, include}]},
     {app, jiffy, [{incl_cond, include}]},


[03/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Move attachment code into couch_att

This is moves a majority of the attachment representation
into the couch_att module. This serves to isolate the
current record to allow easier in-place upgrades as well as
a place to start collecting common attachment related
functionality.

The upgrades are handled lazily to allow rollbacks to older
code if the new attachment format has not yet been required
via storage of any of the new extended attributes supported
by the fetch/store APIs. There are some caveats to this in
that the extended attributes are not enforced by couch_att
at this time so it'd be quite easy to store garbage. As the
extent of attachment concerns becomes more stable, a set of
more permanent fetch_[field]/store_[field] functions may be
added to help enforce both field types as well as common
field names and defaults (all fields will default to
undefined except for those defaults present in the orignal
record definition, which carry over automatically).

Finally, while this patch does move a lot of code to
couch_att, it hasn't refined the interfaces much. These
changes will follow in later patches to improve and
simplify the organization of attachment code. This
includes the addition of more unit tests which currently
only cover some portions of the attachment functionality
related to upgrades and field fetching & storage.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/91294eb3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/91294eb3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/91294eb3

Branch: refs/heads/master
Commit: 91294eb3fa05da59ed93718a4be2f7fc1bfe9d6a
Parents: 5b1f7ce
Author: Brian Mitchell <br...@p2p.io>
Authored: Wed Dec 11 23:07:50 2013 -0500
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 7 16:39:17 2014 +0100

----------------------------------------------------------------------
 test/etap/030-doc-from-json.t | 38 ++++++++++------------
 test/etap/031-doc-to-json.t   | 66 ++++++++++++++++++--------------------
 2 files changed, 48 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/91294eb3/test/etap/030-doc-from-json.t
----------------------------------------------------------------------
diff --git a/test/etap/030-doc-from-json.t b/test/etap/030-doc-from-json.t
index 79d5692..1a11d8d 100755
--- a/test/etap/030-doc-from-json.t
+++ b/test/etap/030-doc-from-json.t
@@ -14,11 +14,7 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-%% XXX: Figure out how to -include("couch_db.hrl")
--record(doc, {id= <<"">>, revs={0, []}, body={[]},
-            atts=[], deleted=false, meta=[]}).
--record(att, {name, type, att_len, disk_len, md5= <<>>, revpos=0, data,
-            encoding=identity}).
+-include_lib("couch/include/couch_db.hrl").
 
 main(_) ->
     test_util:init_code_path(),
@@ -84,22 +80,22 @@ test_from_json_success() ->
                 ]}}
             ]}}]},
             #doc{atts=[
-                #att{
-                    name = <<"my_attachment.fu">>,
-                    data = stub,
-                    type = <<"application/awesome">>,
-                    att_len = 45,
-                    disk_len = 45,
-                    revpos = nil
-                },
-                #att{
-                    name = <<"noahs_private_key.gpg">>,
-                    data = <<"I have a pet fish!">>,
-                    type = <<"application/pgp-signature">>,
-                    att_len = 18,
-                    disk_len = 18,
-                    revpos = 0
-                }
+                couch_att:new([
+                    {name, <<"my_attachment.fu">>},
+                    {data, stub},
+                    {type, <<"application/awesome">>},
+                    {att_len, 45},
+                    {disk_len, 45},
+                    {revpos, undefined}
+                ]),
+                couch_att:new([
+                    {name, <<"noahs_private_key.gpg">>},
+                    {data, <<"I have a pet fish!">>},
+                    {type, <<"application/pgp-signature">>},
+                    {att_len, 18},
+                    {disk_len, 18},
+                    {revpos, 0}
+                ])
             ]},
             "Attachments are parsed correctly."
         },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/91294eb3/test/etap/031-doc-to-json.t
----------------------------------------------------------------------
diff --git a/test/etap/031-doc-to-json.t b/test/etap/031-doc-to-json.t
index e0aaf70..d4227e7 100755
--- a/test/etap/031-doc-to-json.t
+++ b/test/etap/031-doc-to-json.t
@@ -14,11 +14,7 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-%% XXX: Figure out how to -include("couch_db.hrl")
--record(doc, {id= <<"">>, revs={0, []}, body={[]},
-            atts=[], deleted=false, meta=[]}).
--record(att, {name, type, att_len, disk_len, md5= <<>>, revpos=0, data,
-            encoding=identity}).
+-include_lib("couch/include/couch_db.hrl").
 
 main(_) ->
     test_util:init_code_path(),
@@ -114,22 +110,22 @@ test_to_json_success() ->
         },
         {
             #doc{atts=[
-                #att{
-                    name = <<"big.xml">>, 
-                    type = <<"xml/sucks">>, 
-                    data = fun() -> ok end,
-                    revpos = 1,
-                    att_len = 400,
-                    disk_len = 400
-                },
-                #att{
-                    name = <<"fast.json">>, 
-                    type = <<"json/ftw">>, 
-                    data = <<"{\"so\": \"there!\"}">>,
-                    revpos = 1,
-                    att_len = 16,
-                    disk_len = 16
-                }
+                couch_att:new([
+                    {name, <<"big.xml">>},
+                    {type, <<"xml/sucks">>},
+                    {data, fun() -> ok end},
+                    {revpos, 1},
+                    {att_len, 400},
+                    {disk_len, 400}
+                ]),
+                couch_att:new([
+                    {name, <<"fast.json">>},
+                    {type, <<"json/ftw">>},
+                    {data, <<"{\"so\": \"there!\"}">>},
+                    {revpos, 1},
+                    {att_len, 16},
+                    {disk_len, 16}
+                ])
             ]},
             {[
                 {<<"_id">>, <<>>},
@@ -153,20 +149,20 @@ test_to_json_success() ->
         {
             [attachments],
             #doc{atts=[
-                #att{
-                    name = <<"stuff.txt">>,
-                    type = <<"text/plain">>,
-                    data = fun() -> <<"diet pepsi">> end,
-                    revpos = 1,
-                    att_len = 10,
-                    disk_len = 10
-                },
-                #att{
-                    name = <<"food.now">>,
-                    type = <<"application/food">>,
-                    revpos = 1,
-                    data = <<"sammich">>
-                }
+                couch_att:new([
+                    {name, <<"stuff.txt">>},
+                    {type, <<"text/plain">>},
+                    {data, fun() -> <<"diet pepsi">> end},
+                    {revpos, 1},
+                    {att_len, 10},
+                    {disk_len, 10}
+                ]),
+                couch_att:new([
+                    {name, <<"food.now">>},
+                    {type, <<"application/food">>},
+                    {revpos, 1},
+                    {data, <<"sammich">>}
+                ])
             ]},
             {[
                 {<<"_id">>, <<>>},


[09/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Include the node in log messages


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/99a5a0ba
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/99a5a0ba
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/99a5a0ba

Branch: refs/heads/master
Commit: 99a5a0ba9f964d0e91b49f7408c0191a861fbc9c
Parents: 02bd48a
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Aug 11 14:02:20 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Mon Aug 11 14:02:20 2014 -0500

----------------------------------------------------------------------
 rel/files/sys.config | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/99a5a0ba/rel/files/sys.config
----------------------------------------------------------------------
diff --git a/rel/files/sys.config b/rel/files/sys.config
index e9a7bd2..6bfc775 100644
--- a/rel/files/sys.config
+++ b/rel/files/sys.config
@@ -17,7 +17,13 @@
         {handlers, [
             {lager_console_backend, [debug, {
                 lager_default_formatter,
-                [date, " ", time," [",severity,"] ",pid, " ", message, "\n"]
+                [
+                    date, " ", time,
+                    " [", severity, "] ",
+                    node, " ", pid, " ",
+                    message,
+                    "\n"
+                ]
             }]}
         ]}
     ]}


[06/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Reformat rebar.config.script


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/d07a11d3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d07a11d3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d07a11d3

Branch: refs/heads/master
Commit: d07a11d349b0920ca3d7bd8fa2df4ac3c9b4e938
Parents: 497cd1f
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Aug 7 11:21:06 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Sun Aug 10 15:03:52 2014 -0500

----------------------------------------------------------------------
 rebar.config.script | 64 ++++++++++++++++++++++++++----------------------
 1 file changed, 35 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d07a11d3/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index 3203d05..456df6e 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -17,37 +17,43 @@ os:putenv("COUCHDB_CONFIG", ConfigureEnv).
 
 
 DepDescs = [
-    {cassim, "couchdb-cassim", {branch, "windsor-merge"}, []},
-    {couch_log, "couchdb-couch-log", {branch, "master"}, []},
-    {config, "couchdb-config", {branch, "master"}, []},
-    {chttpd, "couchdb-chttpd", {branch, "windsor-merge"}, []},
-    {couch, "couchdb-couch", {branch, "windsor-merge"}, []},
-    {couch_index, "couchdb-couch-index", {branch, "windsor-merge"}, []},
-    {couch_mrview, "couchdb-couch-mrview", {branch, "windsor-merge"}, []},
-    {couch_replicator, "couchdb-couch-replicator", {branch,  "windsor-merge"}, []},
-    {couch_dbupdates, "couchdb-couch-dbupdates", {branch, "master"}, []},
-    {couch_plugins, "couchdb-couch-plugins", {branch, "master"}, []},
-    {couch_event, "couchdb-couch-event", {branch, "windsor-merge"}, []},
-    {ddoc_cache, "couchdb-ddoc-cache", {branch, "windsor-merge"}, []},
-    {ets_lru, "couchdb-ets-lru", {branch, "windsor-merge"}, []},
-    {fabric, "couchdb-fabric", {branch,  "windsor-merge"}, []},
-    {ibrowse, "couchdb-ibrowse", {tag,  "master"}, []},
-    {jiffy, "couchdb-jiffy", {branch, "master"}, []},
-    {khash, "couchdb-khash", {branch, "windsor-merge"}, []},
-    {mem3, "couchdb-mem3", {branch, "windsor-merge"}, []},
-    {mochiweb, "couchdb-mochiweb", {branch, "master"}, []},
-    {oauth, "couchdb-oauth", {branch, "master"}, []},
-    {rexi, "couchdb-rexi", {branch, "windsor-merge"}, []},
-    {snappy, "couchdb-snappy", {branch, "1994-merge-rcouch"}, []},
-    {b64url, "couchdb-b64url", {branch, "windsor-merge"}, []},
-    {global_changes, "couchdb-global-changes", {branch, "windsor-merge"}, []},
-    {fauxton, "couchdb-fauxton", {branch, "master"}, [raw]},
-    {docs, "couchdb-documentation", {branch, "master"}, [raw]}
+    {b64url,            "b64url",           {branch, "windsor-merge"}},
+    {cassim,            "cassim",           {branch, "windsor-merge"}},
+    {couch_log,         "couch-log",        {branch, "master"}},
+    {config,            "config",           {branch, "master"}},
+    {chttpd,            "chttpd",           {branch, "windsor-merge"}},
+    {couch,             "couch",            {branch, "windsor-merge"}},
+    {couch_index,       "couch-index",      {branch, "windsor-merge"}},
+    {couch_mrview,      "couch-mrview",     {branch, "windsor-merge"}},
+    {couch_replicator,  "couch-replicator", {branch, "windsor-merge"}},
+    {couch_dbupdates,   "couch-dbupdates",  {branch, "master"}},
+    {couch_plugins,     "couch-plugins",    {branch, "master"}},
+    {couch_event,       "couch-event",      {branch, "windsor-merge"}},
+    {docs,              "documentation",    {branch, "master"}, [raw]},
+    {ddoc_cache,        "ddoc-cache",       {branch, "windsor-merge"}},
+    {ets_lru,           "ets-lru",          {branch, "windsor-merge"}},
+    {fabric,            "fabric",           {branch, "windsor-merge"}},
+    {fauxton,           "fauxton",          {branch, "master"}, [raw]},
+    {global_changes,    "global-changes",   {branch, "windsor-merge"}},
+    {ibrowse,           "ibrowse",          {branch, "master"}},
+    {jiffy,             "jiffy",            {branch, "master"}},
+    {khash,             "khash",            {branch, "windsor-merge"}},
+    {mem3,              "mem3",             {branch, "windsor-merge"}},
+    {mochiweb,          "mochiweb",         {branch, "master"}},
+    {oauth,             "oauth",            {branch, "master"}},
+    {rexi,              "rexi",             {branch, "windsor-merge"}},
+    {snappy,            "snappy",           {branch, "1994-merge-rcouch"}}
 ],
 
-MakeDep = fun({AppName, RepoName, Version, Options}) ->
-    Url = "https://git-wip-us.apache.org/repos/asf/" ++ RepoName ++ ".git",
-    {AppName, ".*", {git, Url, Version}, Options}
+BaseUrl = "https://git-wip-us.apache.org/repos/asf/",
+
+MakeDep = fun
+    ({AppName, RepoName, Version}) ->
+        Url = BaseUrl ++ "couchdb-" ++ RepoName ++ ".git",
+        {AppName, ".*", {git, Url, Version}};
+    ({AppName, RepoName, Version, Options}) ->
+        Url = BaseUrl ++ "couchdb-" ++ RepoName ++ ".git",
+        {AppName, ".*", {git, Url, Version}, Options}
 end,
 
 AddConfig = [


[14/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Fix race condition in a replicator db test

There was a race condition where we could end up grabbing repDoc1 before
the replicator manager got around to updating it. Local timespans had
this in the 19ms range. Rather than slap a timeout on it I've added a
call to a longpoll on the changes feed to wait for the update.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/caba8931
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/caba8931
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/caba8931

Branch: refs/heads/master
Commit: caba893128849cf3f497bc19d5abb2b4b2fd9880
Parents: 73ca1f9
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Aug 12 14:09:26 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 12 14:09:26 2014 -0500

----------------------------------------------------------------------
 share/www/script/test/replicator_db_identical_continuous.js | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/caba8931/share/www/script/test/replicator_db_identical_continuous.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_identical_continuous.js b/share/www/script/test/replicator_db_identical_continuous.js
index 5e7f151..240c531 100644
--- a/share/www/script/test/replicator_db_identical_continuous.js
+++ b/share/www/script/test/replicator_db_identical_continuous.js
@@ -54,6 +54,13 @@ couchTests.replicator_db_identical_continuous = function(debug) {
       T(copy.value === doc.value);
     }
 
+    // Rather than a timeout we're just waiting to hear the
+    // fourth change to the database. Changes 1 and 2 were
+    // us storing repDoc1 and repDoc2. Changes 3 and 4 are
+    // the replicator manager updating each document. This
+    // just waits until the fourth change before continuing.
+    repDb.changes({"feed":"longpoll", "since":3});
+
     repDoc1 = repDb.open("foo_dup_cont_rep_doc_1");
     T(repDoc1 !== null);
     T(repDoc1._replication_state === "triggered");


[08/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Have lager log to the console only by default

This is a short term fix to get lager to send its output to
stdout/stderr so that it is directed into the appropriate logs for
dev/run.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/02bd48a9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/02bd48a9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/02bd48a9

Branch: refs/heads/master
Commit: 02bd48a975478b1a0b6b4a25dbc4a6b951879bd0
Parents: 681b993
Author: Paul J. Davis <pa...@gmail.com>
Authored: Sun Aug 10 16:31:39 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Sun Aug 10 16:31:39 2014 -0500

----------------------------------------------------------------------
 dev/run              |  1 +
 rel/files/sys.config | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/02bd48a9/dev/run
----------------------------------------------------------------------
diff --git a/dev/run b/dev/run
index 58a3c5f..a4f76cb 100755
--- a/dev/run
+++ b/dev/run
@@ -151,6 +151,7 @@ def boot_node(node):
     cmd = [
         "erl",
         "-args_file", os.path.join(DEV_PATH, "lib", node, "etc", "vm.args"),
+        "-config", os.path.join(COUCHDB, "rel", "files", "sys"),
         "-couch_ini",
             os.path.join(DEV_PATH, "lib", node, "etc", "default.ini"),
             os.path.join(DEV_PATH, "lib", node, "etc", "local.ini"),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/02bd48a9/rel/files/sys.config
----------------------------------------------------------------------
diff --git a/rel/files/sys.config b/rel/files/sys.config
index 97562f5..e9a7bd2 100644
--- a/rel/files/sys.config
+++ b/rel/files/sys.config
@@ -10,4 +10,15 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-[].
+[
+    {lager, [
+        {error_logger_hwm, 1000},
+        {error_logger_redirect, true},
+        {handlers, [
+            {lager_console_backend, [debug, {
+                lager_default_formatter,
+                [date, " ", time," [",severity,"] ",pid, " ", message, "\n"]
+            }]}
+        ]}
+    ]}
+].


[23/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Merge branch 'windsor-merge'


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/aa9f32d8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/aa9f32d8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/aa9f32d8

Branch: refs/heads/master
Commit: aa9f32d8f38b5e366e546843d1fe73bf317bb93c
Parents: 73a0307 881ead7
Author: Robert Newson <rn...@apache.org>
Authored: Thu Aug 28 13:36:13 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 28 13:36:13 2014 +0100

----------------------------------------------------------------------
 Makefile                                        |   5 +-
 dev/run                                         |   1 +
 rebar.config.script                             |  60 ++++++----
 rel/files/sys.config                            |  19 ++-
 rel/overlay/etc/default.ini                     |   5 +-
 rel/reltool.config                              |   8 ++
 share/www/script/test/config.js                 |   2 +-
 share/www/script/test/replication.js            | 120 +++++++++----------
 .../test/replicator_db_identical_continuous.js  |   7 ++
 test/etap/030-doc-from-json.t                   |  38 +++---
 test/etap/031-doc-to-json.t                     |  66 +++++-----
 test/etap/060-kt-merging.t                      |  53 ++++----
 test/javascript/run                             |  14 ++-
 13 files changed, 221 insertions(+), 177 deletions(-)
----------------------------------------------------------------------



[05/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Make clean recursive


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/497cd1f0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/497cd1f0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/497cd1f0

Branch: refs/heads/master
Commit: 497cd1f0c55d671193e45117f3e288a2acf49622
Parents: 79d2631
Author: Robert Newson <rn...@apache.org>
Authored: Thu Aug 7 19:57:02 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 7 19:58:04 2014 +0100

----------------------------------------------------------------------
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/497cd1f0/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 800b6dd..ed927ba 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ compile: config.erl
 
 clean:
 	@echo "==> couchjs (clean)"
-	@rebar clean
+	@rebar -r clean
 
 check: eunit
 


[12/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Include new replicator_db support script


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/96e25e6a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/96e25e6a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/96e25e6a

Branch: refs/heads/master
Commit: 96e25e6ae472b988b96dac08dea9e5d31d7cfc97
Parents: d8f1825
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Aug 12 12:35:46 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 12 12:35:51 2014 -0500

----------------------------------------------------------------------
 test/javascript/run | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/96e25e6a/test/javascript/run
----------------------------------------------------------------------
diff --git a/test/javascript/run b/test/javascript/run
index 65562d7..ac14112 100755
--- a/test/javascript/run
+++ b/test/javascript/run
@@ -37,6 +37,7 @@ SCRIPTS = """
     share/www/script/sha1.js
     share/www/script/oauth.js
     share/www/script/couch.js
+    share/www/script/replicator_db_inc.js
     share/www/script/couch_test_runner.js
     test/javascript/couch_http.js
     test/javascript/test_setup.js


[21/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Restore _stats endpoint


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/bf73cf4b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/bf73cf4b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/bf73cf4b

Branch: refs/heads/master
Commit: bf73cf4b19b2c9c82df3b487f04557a262378236
Parents: 6f41536
Author: Robert Newson <rn...@apache.org>
Authored: Sat Aug 23 14:20:17 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Sat Aug 23 14:29:58 2014 +0100

----------------------------------------------------------------------
 rel/overlay/etc/default.ini | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf73cf4b/rel/overlay/etc/default.ini
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 54069e8..491c76a 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -173,6 +173,7 @@ _config = {couch_httpd_misc_handlers, handle_config_req}
 _replicate = {couch_replicator_httpd, handle_req}
 _uuids = {couch_httpd_misc_handlers, handle_uuids_req}
 _restart = {couch_httpd_misc_handlers, handle_restart_req}
+_stats = {couch_stats_httpd, handle_stats_req}
 _session = {couch_httpd_auth, handle_session_req}
 _oauth = {couch_httpd_oauth, handle_oauth_req}
 _db_updates = {couch_dbupdates_httpd, handle_req}


[13/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Allow tests runs to start at a given file

If you're running this using ./dev/run you need to use the -- to stop
option processing by ./dev/run like so:

    ./dev/run -- test/javascript/run --start path/to/file/start.js


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/73ca1f9c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/73ca1f9c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/73ca1f9c

Branch: refs/heads/master
Commit: 73ca1f9c575b65ac5b805605dbae08b49ace7a46
Parents: 96e25e6
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Aug 12 12:45:54 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 12 12:45:54 2014 -0500

----------------------------------------------------------------------
 test/javascript/run | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/73ca1f9c/test/javascript/run
----------------------------------------------------------------------
diff --git a/test/javascript/run b/test/javascript/run
index ac14112..883fd37 100755
--- a/test/javascript/run
+++ b/test/javascript/run
@@ -95,7 +95,10 @@ def run_couchjs(test, fmt):
 
 
 def options():
-    return []
+    return [
+        op.make_option("-s", "--start", metavar="FILENAME", default=None,
+            help="Start from the given filename if multiple files are passed")
+    ]
 
 
 def main():
@@ -119,6 +122,14 @@ def main():
             else:
                 sys.stderr.write("Unknown test: " + name + os.linesep)
                 exit(1)
+
+    if opts.start is not None:
+        tmp = []
+        for name in tests:
+            if name >= opts.start:
+                tmp.append(name)
+        tests = tmp
+
     fmt = mkformatter(tests)
     for test in tests:
         run_couchjs(test, fmt)


[17/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Use the correct sequence for replication status

The value of source_seq is just what's been seen, not what's actually
been stored on the target. We expose through_seq now to show the actual
progress.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ed4f4961
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ed4f4961
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ed4f4961

Branch: refs/heads/master
Commit: ed4f4961a3d305c236081bb587c0cc1bdd9f72ec
Parents: 16b7ecf
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Aug 12 16:00:39 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 12 16:00:39 2014 -0500

----------------------------------------------------------------------
 share/www/script/test/replication.js | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed4f4961/share/www/script/test/replication.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js
index c883374..21a4304 100644
--- a/share/www/script/test/replication.js
+++ b/share/www/script/test/replication.js
@@ -175,7 +175,7 @@ couchTests.replication = function(debug) {
 
     do {
       var task = getTask(rep_id, 0);
-      if(task && task["source_seq"] == sourceSeq) {
+      if(task && task["through_seq"] == sourceSeq) {
         return;
       }
       t1 = new Date();
@@ -1385,19 +1385,9 @@ couchTests.replication = function(debug) {
   while (sourceDb.info().compact_running) {};
 
   TEquals(true, sourceDb.save(makeDocs(30, 31)[0]).ok);
-  xhr = CouchDB.request("GET", "/_active_tasks");
 
-  var xhr = CouchDB.request("GET", "/_active_tasks");
-  var tasks = JSON.parse(xhr.responseText);
-
-  var found_task = false;
-  for(var i = 0; i < tasks.length; i++) {
-    if(tasks[i].replication_id == repResult._local_id) {
-      found_task = true;
-      break;
-    }
-  }
-  TEquals(true, found_task);
+  var task = getTask(repResult._local_id, 1000);
+  T(task != null);
 
   waitForSeq(sourceDb, targetDb, repResult._local_id);
   T(sourceDb.open("30") !== null);


[11/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
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 <pa...@gmail.com>
Authored: Mon Aug 11 16:15:16 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
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);


[22/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
windsor-merge complete


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/881ead7e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/881ead7e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/881ead7e

Branch: refs/heads/master
Commit: 881ead7e30f7113ab5c78d684a3b577d4fa42d0f
Parents: bf73cf4
Author: Robert Newson <rn...@apache.org>
Authored: Thu Aug 28 13:25:07 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 28 13:25:07 2014 +0100

----------------------------------------------------------------------
 rebar.config.script | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/881ead7e/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index f080427..3dab22f 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -17,32 +17,32 @@ os:putenv("COUCHDB_CONFIG", ConfigureEnv).
 
 
 DepDescs = [
-    {b64url,            "b64url",           {branch, "windsor-merge"}},
-    {cassim,            "cassim",           {branch, "windsor-merge"}},
+    {b64url,            "b64url",           {branch, "master"}},
+    {cassim,            "cassim",           {branch, "master"}},
     {couch_log,         "couch-log",        {branch, "master"}},
     {config,            "config",           {branch, "master"}},
-    {chttpd,            "chttpd",           {branch, "windsor-merge"}},
-    {couch,             "couch",            {branch, "windsor-merge"}},
-    {couch_index,       "couch-index",      {branch, "windsor-merge"}},
-    {couch_mrview,      "couch-mrview",     {branch, "windsor-merge"}},
-    {couch_replicator,  "couch-replicator", {branch, "windsor-merge"}},
+    {chttpd,            "chttpd",           {branch, "master"}},
+    {couch,             "couch",            {branch, "master"}},
+    {couch_index,       "couch-index",      {branch, "master"}},
+    {couch_mrview,      "couch-mrview",     {branch, "master"}},
+    {couch_replicator,  "couch-replicator", {branch, "master"}},
     {couch_dbupdates,   "couch-dbupdates",  {branch, "master"}},
     {couch_plugins,     "couch-plugins",    {branch, "master"}},
-    {couch_event,       "couch-event",      {branch, "windsor-merge"}},
+    {couch_event,       "couch-event",      {branch, "master"}},
     {couch_stats,       "couch-stats",      {branch, "master"}},
     {docs,              "documentation",    {branch, "master"}, [raw]},
-    {ddoc_cache,        "ddoc-cache",       {branch, "windsor-merge"}},
-    {ets_lru,           "ets-lru",          {branch, "windsor-merge"}},
-    {fabric,            "fabric",           {branch, "windsor-merge"}},
+    {ddoc_cache,        "ddoc-cache",       {branch, "master"}},
+    {ets_lru,           "ets-lru",          {branch, "master"}},
+    {fabric,            "fabric",           {branch, "master"}},
     {fauxton,           "fauxton",          {branch, "master"}, [raw]},
-    {global_changes,    "global-changes",   {branch, "windsor-merge"}},
+    {global_changes,    "global-changes",   {branch, "master"}},
     {ibrowse,           "ibrowse",          {branch, "master"}},
     {jiffy,             "jiffy",            {branch, "master"}},
-    {khash,             "khash",            {branch, "windsor-merge"}},
-    {mem3,              "mem3",             {branch, "windsor-merge"}},
+    {khash,             "khash",            {branch, "master"}},
+    {mem3,              "mem3",             {branch, "master"}},
     {mochiweb,          "mochiweb",         {branch, "master"}},
     {oauth,             "oauth",            {branch, "master"}},
-    {rexi,              "rexi",             {branch, "windsor-merge"}},
+    {rexi,              "rexi",             {branch, "master"}},
     {snappy,            "snappy",           {branch, "1994-merge-rcouch"}}
 ],
 


[16/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Use waitForSeq and task statuses instead of sleeps

Further speedups to replication.js. Now runs in 32s on my machine vs.
the 1m45s it started at.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/16b7ecfb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/16b7ecfb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/16b7ecfb

Branch: refs/heads/master
Commit: 16b7ecfb9410157159f69ed59e64f359404a49a0
Parents: 641de39
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Aug 12 15:38:19 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 12 15:38:19 2014 -0500

----------------------------------------------------------------------
 share/www/script/test/replication.js | 66 ++++++++++++-------------------
 1 file changed, 26 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/16b7ecfb/share/www/script/test/replication.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js
index 0ad9e8c..c883374 100644
--- a/share/www/script/test/replication.js
+++ b/share/www/script/test/replication.js
@@ -97,7 +97,6 @@ couchTests.replication = function(debug) {
   function populateDb(db, docs, dontRecreateDb) {
     if (dontRecreateDb !== true) {
       db.deleteDb();
-      wait(100);
       db.createDb();
     }
     for (var i = 0; i < docs.length; i++) {
@@ -150,33 +149,37 @@ couchTests.replication = function(debug) {
   }
 
 
-  function waitForSeq(sourceDb, targetDb) {
-    var sourceSeq = sourceDb.info().update_seq,
-        t0 = new Date(),
-        t1,
-        ms = 3000;
-
+  function getTask(rep_id, delay) {
+    var t0 = new Date();
+    var t1;
     do {
       var xhr = CouchDB.request("GET", "/_active_tasks");
       var tasks = JSON.parse(xhr.responseText);
       for(var i = 0; i < tasks.length; i++) {
         if(tasks[i].replication_id == repResult._local_id) {
-          if(tasks[i]["source_seq"] == sourceSeq) {
-            return;
-          }
+          return tasks[i];
         }
       }
       t1 = new Date();
-    } while (((t1 - t0) <= ms));
+    } while((t1 - t0) <= delay);
+
+    return null;
   }
 
 
-  function wait(ms) {
-    var t0 = new Date(), t1;
+  function waitForSeq(sourceDb, targetDb, rep_id) {
+    var sourceSeq = sourceDb.info().update_seq,
+        t0 = new Date(),
+        t1,
+        ms = 3000;
+
     do {
-      CouchDB.request("GET", "/");
+      var task = getTask(rep_id, 0);
+      if(task && task["source_seq"] == sourceSeq) {
+        return;
+      }
       t1 = new Date();
-    } while ((t1 - t0) <= ms);
+    } while (((t1 - t0) <= ms));
   }
 
 
@@ -1310,7 +1313,6 @@ couchTests.replication = function(debug) {
 
     // delete docs from source
     TEquals(true, sourceDb.deleteDoc(newDocs[0]).ok);
-    wait(1000);
     TEquals(true, sourceDb.deleteDoc(newDocs[6]).ok);
 
     waitForSeq(sourceDb, targetDb, rep_id);
@@ -1348,7 +1350,7 @@ couchTests.replication = function(debug) {
     };
     TEquals(true, sourceDb.save(doc).ok);
 
-    wait(2000);
+    waitForSeq(sourceDb, targetDb, rep_id);
     copy = targetDb.open(doc._id);
     TEquals(null, copy);
   }
@@ -1721,21 +1723,12 @@ couchTests.replication = function(debug) {
   );
   TEquals(true, repResult.ok);
   TEquals('string', typeof repResult._local_id);
+  var repId = repResult._local_id;
 
-  // Race conditions are awesome
-  wait(500);
-
-  xhr = CouchDB.request("GET", "/_active_tasks");
-  tasks = JSON.parse(xhr.responseText);
-
-  var repId;
-  for (j = 0; j < tasks.length; j++) {
-    if (tasks[j].replication_id === repResult._local_id) {
-      repId = tasks[j].replication_id;
-    }
-  }
+  var task = getTask(repId, 3000);
+  T(task != null);
 
-  TEquals(repResult._local_id, repId, "Replication found in _active_tasks");
+  TEquals(task["replication_id"], repId, "Replication found in _active_tasks");
   xhr = CouchDB.request(
     "POST", "/_replicate", {
       body: JSON.stringify({"replication_id": repId, "cancel": true}),
@@ -1743,19 +1736,12 @@ couchTests.replication = function(debug) {
   });
   TEquals(200, xhr.status, "Replication cancel request success");
 
-  xhr = CouchDB.request("GET", "/_active_tasks");
-  tasks = JSON.parse(xhr.responseText);
-  repId = null;
-  for (j = 0; j < tasks.length; j++) {
-    if (tasks[j].replication_id === repResult._local_id) {
-      repId = tasks[j].replication_id;
-    }
-  }
-  TEquals(null, repId, "Replication was canceled");
+  task = getTask(repId);
+  TEquals(null, task, "Replication was canceled");
 
   xhr = CouchDB.request(
     "POST", "/_replicate", {
-      body: JSON.stringify({"replication_id": repResult._local_id, "cancel": true}),
+      body: JSON.stringify({"replication_id": repId, "cancel": true}),
       headers: {"Content-Type": "application/json"}
   });
   TEquals(404, xhr.status, "2nd replication cancel failed");


[07/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Remove couch_replicator_manager as its in the OTP hierarchy now.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/681b993f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/681b993f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/681b993f

Branch: refs/heads/master
Commit: 681b993f291347397d4049592a106591bd642ee2
Parents: d07a11d
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Aug 7 13:16:50 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Sun Aug 10 15:03:53 2014 -0500

----------------------------------------------------------------------
 rel/overlay/etc/default.ini | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/681b993f/rel/overlay/etc/default.ini
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index dfcd3bc..9d69029 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -158,7 +158,6 @@ stats_aggregator={couch_stats_aggregator, start, []}
 stats_collector={couch_stats_collector, start, []}
 uuids={couch_uuids, start, []}
 auth_cache={couch_auth_cache, start_link, []}
-replicator_manager={couch_replicator_manager, start_link, []}
 os_daemons={couch_os_daemons, start_link, []}
 compaction_daemon={couch_compaction_daemon, start_link, []}
 


[15/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Don't sleep mindlessly for 3s at a time

Attempting to compare the source and target update_seq values isn't
valid as any document modification on the source will permanently alter
the comparison. This changes things to just wait for the task's status
to update and reflect the source database's update sequence.

Locally this shortens the replication.js test by about 45s.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/641de396
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/641de396
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/641de396

Branch: refs/heads/master
Commit: 641de396362a3b5e3954a1e24b92500320080ab4
Parents: caba893
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Aug 12 15:15:11 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 12 15:16:43 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/641de396/share/www/script/test/replication.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js
index de62b3f..0ad9e8c 100644
--- a/share/www/script/test/replication.js
+++ b/share/www/script/test/replication.js
@@ -151,16 +151,23 @@ couchTests.replication = function(debug) {
 
 
   function waitForSeq(sourceDb, targetDb) {
-    var targetSeq,
-        sourceSeq = sourceDb.info().update_seq,
+    var sourceSeq = sourceDb.info().update_seq,
         t0 = new Date(),
         t1,
         ms = 3000;
 
     do {
-      targetSeq = targetDb.info().update_seq;
+      var xhr = CouchDB.request("GET", "/_active_tasks");
+      var tasks = JSON.parse(xhr.responseText);
+      for(var i = 0; i < tasks.length; i++) {
+        if(tasks[i].replication_id == repResult._local_id) {
+          if(tasks[i]["source_seq"] == sourceSeq) {
+            return;
+          }
+        }
+      }
       t1 = new Date();
-    } while (((t1 - t0) <= ms) && targetSeq < sourceSeq);
+    } while (((t1 - t0) <= ms));
   }
 
 
@@ -1166,7 +1173,7 @@ couchTests.replication = function(debug) {
 
     var rep_id = repResult._local_id;
 
-    waitForSeq(sourceDb, targetDb);
+    waitForSeq(sourceDb, targetDb, rep_id);
 
     for (j = 0; j < docs.length; j++) {
       doc = docs[j];
@@ -1204,7 +1211,7 @@ couchTests.replication = function(debug) {
     var ddoc = docs[docs.length - 1]; // design doc
     addAtt(sourceDb, ddoc, "readme.txt", att1_data, "text/plain");
 
-    waitForSeq(sourceDb, targetDb);
+    waitForSeq(sourceDb, targetDb, rep_id);
 
     var modifDocs = docs.slice(10, 15).concat([ddoc]);
     for (j = 0; j < modifDocs.length; j++) {
@@ -1249,7 +1256,7 @@ couchTests.replication = function(debug) {
     // add another attachment to the ddoc on source
     addAtt(sourceDb, ddoc, "data.dat", att2_data, "application/binary");
 
-    waitForSeq(sourceDb, targetDb);
+    waitForSeq(sourceDb, targetDb, rep_id);
 
     copy = targetDb.open(ddoc._id);
     var atts = copy._attachments;
@@ -1286,7 +1293,7 @@ couchTests.replication = function(debug) {
     var newDocs = makeDocs(25, 35);
     populateDb(sourceDb, newDocs, true);
 
-    waitForSeq(sourceDb, targetDb);
+    waitForSeq(sourceDb, targetDb, rep_id);
 
     for (j = 0; j < newDocs.length; j++) {
       doc = newDocs[j];
@@ -1306,7 +1313,7 @@ couchTests.replication = function(debug) {
     wait(1000);
     TEquals(true, sourceDb.deleteDoc(newDocs[6]).ok);
 
-    waitForSeq(sourceDb, targetDb);
+    waitForSeq(sourceDb, targetDb, rep_id);
 
     copy = targetDb.open(newDocs[0]._id);
     TEquals(null, copy);
@@ -1390,7 +1397,7 @@ couchTests.replication = function(debug) {
   }
   TEquals(true, found_task);
 
-  waitForSeq(sourceDb, targetDb);
+  waitForSeq(sourceDb, targetDb, repResult._local_id);
   T(sourceDb.open("30") !== null);
 
   // cancel replication


[19/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
add devclean target that cleans out the dev cluster state


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/39d3b506
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/39d3b506
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/39d3b506

Branch: refs/heads/master
Commit: 39d3b5066038d2e1da35a3d5e231bab6271eaae7
Parents: 91f5121
Author: Jan Lehnardt <ja...@apache.org>
Authored: Tue Aug 19 18:28:20 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Tue Aug 19 18:28:20 2014 +0200

----------------------------------------------------------------------
 Makefile | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/39d3b506/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index ed927ba..ea1aba8 100644
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,9 @@ dist: compile
 distclean: clean
 	@rm -rf rel/couchdb
 
+devclean:
+	@rm -rf dev/lib/*/data
+
 include install.mk
 install: dist
 	@mkdir -p $(prefix)


[20/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Switch to couch_stats


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6f415363
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6f415363
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6f415363

Branch: refs/heads/master
Commit: 6f41536331bb38a31dff76dbb2679356ca156ed1
Parents: 39d3b50
Author: Robert Newson <rn...@apache.org>
Authored: Fri Aug 22 15:34:08 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Aug 22 16:02:04 2014 +0100

----------------------------------------------------------------------
 rebar.config.script         | 1 +
 rel/overlay/etc/default.ini | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6f415363/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index 456df6e..f080427 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -29,6 +29,7 @@ DepDescs = [
     {couch_dbupdates,   "couch-dbupdates",  {branch, "master"}},
     {couch_plugins,     "couch-plugins",    {branch, "master"}},
     {couch_event,       "couch-event",      {branch, "windsor-merge"}},
+    {couch_stats,       "couch-stats",      {branch, "master"}},
     {docs,              "documentation",    {branch, "master"}, [raw]},
     {ddoc_cache,        "ddoc-cache",       {branch, "windsor-merge"}},
     {ets_lru,           "ets-lru",          {branch, "windsor-merge"}},

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6f415363/rel/overlay/etc/default.ini
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 9d69029..54069e8 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -154,8 +154,6 @@ external_manager={couch_external_manager, start_link, []}
 query_servers={couch_proc_manager, start_link, []}
 vhosts={couch_httpd_vhost, start_link, []}
 httpd={couch_httpd, start_link, []}
-stats_aggregator={couch_stats_aggregator, start, []}
-stats_collector={couch_stats_collector, start, []}
 uuids={couch_uuids, start, []}
 auth_cache={couch_auth_cache, start_link, []}
 os_daemons={couch_os_daemons, start_link, []}
@@ -175,7 +173,6 @@ _config = {couch_httpd_misc_handlers, handle_config_req}
 _replicate = {couch_replicator_httpd, handle_req}
 _uuids = {couch_httpd_misc_handlers, handle_uuids_req}
 _restart = {couch_httpd_misc_handlers, handle_restart_req}
-_stats = {couch_httpd_stats_handlers, handle_stats_req}
 _session = {couch_httpd_auth, handle_session_req}
 _oauth = {couch_httpd_oauth, handle_oauth_req}
 _db_updates = {couch_dbupdates_httpd, handle_req}


[04/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Test all windsor-merge branches


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/79d26312
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/79d26312
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/79d26312

Branch: refs/heads/master
Commit: 79d26312c2cfb3622b4a607ee05e866423b9e673
Parents: 91294eb
Author: Robert Newson <rn...@apache.org>
Authored: Thu Aug 7 16:41:51 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 7 19:58:01 2014 +0100

----------------------------------------------------------------------
 rebar.config.script | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/79d26312/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index afe0b0f..3203d05 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -20,26 +20,27 @@ DepDescs = [
     {cassim, "couchdb-cassim", {branch, "windsor-merge"}, []},
     {couch_log, "couchdb-couch-log", {branch, "master"}, []},
     {config, "couchdb-config", {branch, "master"}, []},
-    {chttpd, "couchdb-chttpd", {branch, "master"}, []},
-    {couch, "couchdb-couch", {branch, "master"}, []},
-    {couch_index, "couchdb-couch-index", {branch, "master"}, []},
-    {couch_mrview, "couchdb-couch-mrview", {branch, "master"}, []},
-    {couch_replicator, "couchdb-couch-replicator", {branch,  "master"}, []},
+    {chttpd, "couchdb-chttpd", {branch, "windsor-merge"}, []},
+    {couch, "couchdb-couch", {branch, "windsor-merge"}, []},
+    {couch_index, "couchdb-couch-index", {branch, "windsor-merge"}, []},
+    {couch_mrview, "couchdb-couch-mrview", {branch, "windsor-merge"}, []},
+    {couch_replicator, "couchdb-couch-replicator", {branch,  "windsor-merge"}, []},
     {couch_dbupdates, "couchdb-couch-dbupdates", {branch, "master"}, []},
     {couch_plugins, "couchdb-couch-plugins", {branch, "master"}, []},
     {couch_event, "couchdb-couch-event", {branch, "windsor-merge"}, []},
-    {ddoc_cache, "couchdb-ddoc-cache", {branch, "master"}, []},
-    {ets_lru, "couchdb-ets-lru", {branch, "master"}, []},
-    {fabric, "couchdb-fabric", {branch,  "master"}, []},
+    {ddoc_cache, "couchdb-ddoc-cache", {branch, "windsor-merge"}, []},
+    {ets_lru, "couchdb-ets-lru", {branch, "windsor-merge"}, []},
+    {fabric, "couchdb-fabric", {branch,  "windsor-merge"}, []},
     {ibrowse, "couchdb-ibrowse", {tag,  "master"}, []},
     {jiffy, "couchdb-jiffy", {branch, "master"}, []},
     {khash, "couchdb-khash", {branch, "windsor-merge"}, []},
-    {mem3, "couchdb-mem3", {branch, "master"}, []},
+    {mem3, "couchdb-mem3", {branch, "windsor-merge"}, []},
     {mochiweb, "couchdb-mochiweb", {branch, "master"}, []},
     {oauth, "couchdb-oauth", {branch, "master"}, []},
-    {rexi, "couchdb-rexi", {branch, "master"}, []},
+    {rexi, "couchdb-rexi", {branch, "windsor-merge"}, []},
     {snappy, "couchdb-snappy", {branch, "1994-merge-rcouch"}, []},
     {b64url, "couchdb-b64url", {branch, "windsor-merge"}, []},
+    {global_changes, "couchdb-global-changes", {branch, "windsor-merge"}, []},
     {fauxton, "couchdb-fauxton", {branch, "master"}, [raw]},
     {docs, "couchdb-documentation", {branch, "master"}, [raw]}
 ],


[02/23] couchdb commit: updated refs/heads/master to aa9f32d

Posted by rn...@apache.org.
Be more specific on the merge result

We have three results that can happen when merging a path into a
revision tree:

 * We can extend a branch which replaces a leaf
 * We can create a new branch which results in a new leaf
 * We can land on an existing internal node

The first result (new_leaf) means that there is no conflict in the
update operation. The second (new_branch) means we branched a revision
path which means the operation introduces a conflict. The third
(internal_node) means that the merge was the result of an edit that
has already been applied to this document.

For the third case we have a subtle special case in that if we have
deleted the document and want to recreate it into the same initial
state we need to give the new state a different revision. The current
code follows the edit path and extends the first deleted leaf it
finds.

BugzID: 25150

Conflicts:
	apps/couch/src/couch_key_tree.erl


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/5b1f7cea
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5b1f7cea
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5b1f7cea

Branch: refs/heads/master
Commit: 5b1f7cea04b08fea12364acae72a9898d45212d6
Parents: 699ad9c
Author: Paul J. Davis <pa...@gmail.com>
Authored: Fri Nov 15 12:13:17 2013 -0600
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Aug 6 19:29:59 2014 +0100

----------------------------------------------------------------------
 test/etap/060-kt-merging.t | 53 ++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5b1f7cea/test/etap/060-kt-merging.t
----------------------------------------------------------------------
diff --git a/test/etap/060-kt-merging.t b/test/etap/060-kt-merging.t
index efbdbf6..e0b1a9c 100755
--- a/test/etap/060-kt-merging.t
+++ b/test/etap/060-kt-merging.t
@@ -29,12 +29,12 @@ test() ->
     One = {1, {"1","foo",[]}},
 
     etap:is(
-        {[One], no_conflicts},
+        {[One], new_leaf},
         couch_key_tree:merge([], One, 10),
         "The empty tree is the identity for merge."
     ),
     etap:is(
-        {[One], no_conflicts},
+        {[One], internal_node},
         couch_key_tree:merge([One], One, 10),
         "Merging is reflexive."
     ),
@@ -43,7 +43,7 @@ test() ->
                {1, {"2","foo",[]}}],
 
     etap:is(
-        {TwoSibs, no_conflicts},
+        {TwoSibs, internal_node},
         couch_key_tree:merge(TwoSibs, One, 10),
         "Merging a prefix of a tree with the tree yields the tree."
     ),
@@ -54,7 +54,7 @@ test() ->
                  {1, {"3","foo",[]}}],
 
     etap:is(
-        {ThreeSibs, conflicts},
+        {ThreeSibs, new_branch},
         couch_key_tree:merge(TwoSibs, Three, 10),
         "Merging a third unrelated branch leads to a conflict."
     ),
@@ -63,30 +63,17 @@ test() ->
     TwoChild = {1, {"1","foo", [{"1a", "bar", [{"1aa", "bar", []}]}]}},
 
     etap:is(
-        {[TwoChild], no_conflicts},
+        {[TwoChild], internal_node},
         couch_key_tree:merge([TwoChild], TwoChild, 10),
         "Merging two children is still reflexive."
     ),
 
     TwoChildSibs = {1, {"1","foo", [{"1a", "bar", []},
                                      {"1b", "bar", []}]}},
-    etap:is(
-        {[TwoChildSibs], no_conflicts},
-        couch_key_tree:merge([TwoChildSibs], TwoChildSibs, 10),
-        "Merging a tree to itself is itself."),
-
-    TwoChildPlusSibs =
-        {1, {"1","foo", [{"1a", "bar", [{"1aa", "bar", []}]},
-                         {"1b", "bar", []}]}},
-
-    etap:is(
-        {[TwoChildPlusSibs], no_conflicts},
-        couch_key_tree:merge([TwoChild], TwoChildSibs, 10),
-        "Merging tree of uneven length at node 2."),
 
     Stemmed1b = {2, {"1a", "bar", []}},
     etap:is(
-        {[TwoChildSibs], no_conflicts},
+        {[TwoChildSibs], internal_node},
         couch_key_tree:merge([TwoChildSibs], Stemmed1b, 10),
         "Merging a tree with a stem."
     ),
@@ -95,7 +82,7 @@ test() ->
                                      {"1b", "bar", [{"1bb", "boo", []}]}]}},
     Stemmed1bb = {3, {"1bb", "boo", []}},
     etap:is(
-        {[TwoChildSibs2], no_conflicts},
+        {[TwoChildSibs2], internal_node},
         couch_key_tree:merge([TwoChildSibs2], Stemmed1bb, 10),
         "Merging a stem at a deeper level."
     ),
@@ -104,27 +91,27 @@ test() ->
                             {2,{"1b", "bar", [{"1bb", "boo", []}]}}],
 
     etap:is(
-        {StemmedTwoChildSibs2, no_conflicts},
+        {StemmedTwoChildSibs2, internal_node},
         couch_key_tree:merge(StemmedTwoChildSibs2, Stemmed1bb, 10),
         "Merging a stem at a deeper level against paths at deeper levels."
     ),
 
     Stemmed1aa = {3, {"1aa", "bar", []}},
     etap:is(
-        {[TwoChild], no_conflicts},
+        {[TwoChild], internal_node},
         couch_key_tree:merge([TwoChild], Stemmed1aa, 10),
         "Merging a single tree with a deeper stem."
     ),
 
     Stemmed1a = {2, {"1a", "bar", [{"1aa", "bar", []}]}},
     etap:is(
-        {[TwoChild], no_conflicts},
+        {[TwoChild], internal_node},
         couch_key_tree:merge([TwoChild], Stemmed1a, 10),
         "Merging a larger stem."
     ),
 
     etap:is(
-        {[Stemmed1a], no_conflicts},
+        {[Stemmed1a], internal_node},
         couch_key_tree:merge([Stemmed1a], Stemmed1aa, 10),
         "More merging."
     ),
@@ -132,13 +119,13 @@ test() ->
     OneChild = {1, {"1","foo",[{"1a", "bar", []}]}},
     Expect1 = [OneChild, Stemmed1aa],
     etap:is(
-        {Expect1, conflicts},
+        {Expect1, new_branch},
         couch_key_tree:merge([OneChild], Stemmed1aa, 10),
         "Merging should create conflicts."
     ),
 
     etap:is(
-        {[TwoChild], no_conflicts},
+        {[TwoChild], new_leaf},
         couch_key_tree:merge(Expect1, TwoChild, 10),
         "Merge should have no conflicts."
     ),
@@ -168,9 +155,21 @@ test() ->
                ]}},
 
     etap:is(
-      {[FooBar], no_conflicts},
+      {[FooBar], new_leaf},
       couch_key_tree:merge([Foo],Bar,10),
       "Merging trees with conflicts ought to behave."
     ),
 
+    etap:is(
+      {[TwoChild], internal_node},
+      couch_key_tree:merge([TwoChild],One,10),
+      "Merging tree with already-existing path."
+    ),
+
+    etap:is(
+      {[TwoChildSibs], internal_node},
+      couch_key_tree:merge([TwoChildSibs],One,10),
+      "Merging tree with already-existing path with siblings."
+    ),
+
     ok.