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:20:56 UTC

[21/50] fabric commit: updated refs/heads/master to a71701c

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/master
Commit: 16e020f647a457e86723d744a1295d82136550f1
Parents: cb16735
Author: Paul J. Davis <pa...@gmail.com>
Authored: Fri Dec 6 14:44:44 2013 -0600
Committer: Robert Newson <rn...@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