From 9931a70d5970e2f644aac92b67b7c21659c5be60 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Thu, 12 Dec 2013 12:58:35 -0600 Subject: [PATCH] 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 --- src/fabric_view_changes.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl index cff241d..d8c6beb 100644 --- a/src/fabric_view_changes.erl +++ b/src/fabric_view_changes.erl @@ -138,10 +138,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