couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [29/50] git commit: Fix unpack_seqs bug
Date Fri, 17 Jan 2014 21:50:29 GMT
Fix unpack_seqs bug

When adding shards back to fill holes I forgot to wrap each shard in a
tuple with an update_seq of zero. This caused any changes feed with a
hole in it to die with a function clause error.


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

Branch: refs/heads/import
Commit: cb9cbe0a74114026c35cd9d7ff251a6350e1e70e
Parents: 9f09897
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Sun Feb 24 19:36:57 2013 -0600
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Sun Feb 24 19:36:57 2013 -0600

----------------------------------------------------------------------
 src/fabric_view_changes.erl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/cb9cbe0a/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index e2b9756..13e8fcc 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -14,7 +14,7 @@
 
 -module(fabric_view_changes).
 
--export([go/5, pack_seqs/1]).
+-export([go/5, pack_seqs/1, unpack_seqs/2]).
 
 -include("fabric.hrl").
 -include_lib("mem3/include/mem3.hrl").
@@ -341,7 +341,8 @@ do_unpack_seqs(Opaque, DbName) ->
         false ->
             Ranges = lists:usort([R || #shard{range=R} <- Unpacked]),
             Filter = fun(S) -> not lists:member(S#shard.range, Ranges) end,
-            Unpacked ++ lists:filter(Filter, mem3:shards(DbName))
+            Replacements = lists:filter(Filter, mem3:shards(DbName)),
+            Unpacked ++ [{R, 0} || R <- Replacements]
     end.
 
 changes_row(#change{key=Seq, id=Id, value=Value, deleted=true, doc=Doc}, true) ->


Mime
View raw message