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:21:06 UTC
[31/50] fabric commit: updated refs/heads/master to a71701c
Don't attempt to replace replacement shards
The old test was looking for {_, _} tuple but that doesn't account for
old since sequences. This just switches to using a negative selection.
The only bad behavior was that we were making lots of log messages about
rewinding from 0 in known conditions.
BugzId: 26125
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/1fced48b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/1fced48b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/1fced48b
Branch: refs/heads/master
Commit: 1fced48beeeb7a4ed7b29bb318d747798b2ffe47
Parents: 2e98455
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Dec 12 12:58:35 2013 -0600
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Aug 1 15:33:43 2014 +0100
----------------------------------------------------------------------
src/fabric_view_changes.erl | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/1fced48b/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index 480f6bb..8de01f1 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -142,10 +142,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
- % The {_, _}=OldSeq pattern match is so that we don't
- % accidentally try and replace based on the generated
- % {replace, _, _, _} tuples.
- [{#shard{node = OldNode}, {_, _}=OldSeq} | _] ->
+ [{#shard{}, {replace, _, _, _}} | _] ->
+ % Don't attempt to replace a replacement
+ SeqArg = 0;
+ [{#shard{node = OldNode}, OldSeq} | _] ->
SeqArg = make_replacement_arg(OldNode, OldSeq);
_ ->
% TODO this clause is probably unreachable in the N>2