couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [34/49] fabric commit: updated refs/heads/windsor-merge to b1c0030
Date Fri, 01 Aug 2014 14:34:55 GMT
Adjust replacement rewind exclusion

We're wanting to avoid attempting to use existing replacement
information for down shards. The is_integer guard didn't work because
the sequences are {UUID, Seq} tuples so we pattern match on that tuple
shape instead.

BugzId: 22698


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

Branch: refs/heads/windsor-merge
Commit: 16e020f647a457e86723d744a1295d82136550f1
Parents: cb16735
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Dec 6 14:44:44 2013 -0600
Committer: Robert Newson <rnewson@apache.org>
Committed: Fri Aug 1 15:33:42 2014 +0100

----------------------------------------------------------------------
 src/fabric_view_changes.erl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/16e020f6/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index 6d5dd24..ed6dfb2 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -136,7 +136,10 @@ send_changes(DbName, ChangesArgs, Callback, PackedSeqs, AccIn, Timeout)
->
     StartFun = fun(#shard{name=Name, node=N, range=R0}=Shard) ->
         %% Find the original shard copy in the Seqs array
         case lists:dropwhile(fun({S, _}) -> S#shard.range =/= R0 end, Seqs) of
-            [{#shard{node = OldNode}, OldSeq} | _] when is_integer(OldSeq) ->
+            % The {_, _}=OldSeq pattern match is so that we don't
+            % accidentally try and replace based on the generated
+            % {replace, _, _, _} tuples.
+            [{#shard{node = OldNode}, {_, _}=OldSeq} | _] ->
                 SeqArg = make_replacement_arg(OldNode, OldSeq);
             _ ->
                 % TODO this clause is probably unreachable in the N>2


Mime
View raw message