couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r754970 - /couchdb/trunk/src/couchdb/couch_key_tree.erl
Date Mon, 16 Mar 2009 17:57:06 GMT
Author: damien
Date: Mon Mar 16 17:57:06 2009
New Revision: 754970

URL: http://svn.apache.org/viewvc?rev=754970&view=rev
Log:
Fix for sporatic replication error during tests.

Modified:
    couchdb/trunk/src/couchdb/couch_key_tree.erl

Modified: couchdb/trunk/src/couchdb/couch_key_tree.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_key_tree.erl?rev=754970&r1=754969&r2=754970&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_key_tree.erl (original)
+++ couchdb/trunk/src/couchdb/couch_key_tree.erl Mon Mar 16 17:57:06 2009
@@ -86,8 +86,8 @@
         {ok, [{Key, Value, Merged} | Sibs], Conflicts};
     no ->
         case merge_at(Sibs, Place, Insert) of
-        {ok, Merged} ->
-            [{Key, Value, SubTree} | Merged];
+        {ok, Merged, Conflicts} ->
+            {ok, [{Key, Value, SubTree} | Merged], Conflicts};
         no ->
             no
         end
@@ -316,8 +316,12 @@
     TwoChild = [{0, {"1","foo", [{"1a", "bar", [{"1aa", "bar", []}]}]}}],
     TwoChildSibs = [{0, {"1","foo", [{"1a", "bar", []},
                                      {"1b", "bar", []}]}}],
+    TwoChildSibs2 = [{0, {"1","foo", [{"1a", "bar", []},
+                                     {"1b", "bar", [{"1bb", "boo", []}]}]}}],
+    Stemmed1b = [{1, {"1a", "bar", []}}],
     Stemmed1a = [{1, {"1a", "bar", [{"1aa", "bar", []}]}}],
     Stemmed1aa = [{2, {"1aa", "bar", []}}],
+    Stemmed1bb = [{2, {"1bb", "boo", []}}],
     
     {EmptyTree, no_conflicts} = merge(EmptyTree, EmptyTree),
     {One, no_conflicts} = merge(EmptyTree, One),
@@ -326,6 +330,10 @@
     {One, no_conflicts} = merge(One, One),
     {TwoChild, no_conflicts} = merge(TwoChild, TwoChild),
     {TwoChildSibs, no_conflicts} = merge(TwoChildSibs, TwoChildSibs),
+    {TwoChildSibs, no_conflicts} = merge(TwoChildSibs, Stemmed1b),
+    {TwoChildSibs, no_conflicts} = merge(Stemmed1b, TwoChildSibs),
+    {TwoChildSibs2, no_conflicts} = merge(TwoChildSibs2, Stemmed1bb),
+    {TwoChildSibs2, no_conflicts} = merge(Stemmed1bb, TwoChildSibs2),
     {TwoChild, no_conflicts} = merge(TwoChild, Stemmed1aa),
     {TwoChild, no_conflicts} = merge(TwoChild, Stemmed1a),
     {Stemmed1a, no_conflicts} = merge(Stemmed1a, Stemmed1aa),



Mime
View raw message