Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #137 from cloudant/26125-fix-changes-replacement-l…
Browse files Browse the repository at this point in the history
…og-bug

Don't attempt to replace replacement shards
  • Loading branch information
davisp committed Dec 12, 2013
2 parents 6be0481 + 9931a70 commit 93372b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fabric_view_changes.erl
Expand Up @@ -144,10 +144,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
Expand Down

0 comments on commit 93372b8

Please sign in to comment.