Skip to content

Commit

Permalink
Correct unavailable spaces
Browse files Browse the repository at this point in the history
don't create a [0, -1] case
  • Loading branch information
martinsumner committed Oct 27, 2021
1 parent 91fb709 commit 12cccff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/riak_core_coverage_plan.erl
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,13 @@ multi_failure_tester(PartitionCount, CoverageFun) when PartitionCount >= 32 ->
% Fail two vnodes together - now can only get partial coverage from a r=2
% plan
RVN = rand:uniform(PartitionCount),
UnavailableKeySpaces1 = [RVN - 1, (RVN - 2) rem PartitionCount],
UnavailableKeySpaces1 =
case RVN of
1 ->
[0, PartitionCount - 1];
_ ->
[RVN - 1, RVN - 2]
end,
{insufficient_vnodes_available, _, VnodeCovers1} =
CoverageFun(ReqId, NVal, PartitionCount,
UnavailableKeySpaces1, PVC),
Expand Down

0 comments on commit 12cccff

Please sign in to comment.