summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-07-15 14:00:27 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-07-15 14:00:27 -0400
commit36bd40e5e1227817ea9a6f386b44758bc8a46359 (patch)
tree50f6c6b8d9a8860c65e87e09ba7fe549ce5b1c90
parent6b798eb8b2f4edd3c6d1a02de6890f6ef1510785 (diff)
don't badmatch if first shard in keyrange is missing
-rw-r--r--src/fabric_view.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fabric_view.erl b/src/fabric_view.erl
index 4f29abf7..d35283d7 100644
--- a/src/fabric_view.erl
+++ b/src/fabric_view.erl
@@ -15,7 +15,7 @@ is_progress_possible([]) ->
is_progress_possible(Counters) ->
Ranges = fabric_dict:fold(fun(#shard{range=[X,Y]}, _, A) -> [{X,Y}|A] end,
[], Counters),
- [{0, Tail0} | Rest] = lists:ukeysort(1, Ranges),
+ [{Start, Tail0} | Rest] = lists:ukeysort(1, Ranges),
Result = lists:foldl(fun
(_, fail) ->
% we've already declared failure
@@ -35,7 +35,7 @@ is_progress_possible(Counters) ->
Else
end
end, Tail0, Rest),
- Result =:= complete.
+ (Start =:= 0) andalso (Result =:= complete).
-spec remove_overlapping_shards(#shard{}, [{#shard{}, any()}]) ->
[{#shard{}, any()}].