Skip to content

Commit

Permalink
Fix from comment. We need to throw an exception if the voting pool is…
Browse files Browse the repository at this point in the history
… not odd
  • Loading branch information
rsrinivasanNetflix committed Jul 19, 2019
1 parent 328c119 commit 597038d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public CircularList<Host> getVotingHosts() {
numHosts.put(rack, v);
calculatedVotingSize.addAndGet(v);
}
if(numHostsRequired.get() != 0) {
if(calculatedVotingSize.get() % 2 == 0) {
throw new IllegalStateException("Could not construct voting pool. Min number of hosts not met!");
}
Map<String, List<HostToken>> rackToHostToken = allHostTokens.stream()
Expand Down

0 comments on commit 597038d

Please sign in to comment.