Closed andrewjstone closed 10 years ago
quorum_min/3 works fine for odd numbers of servers, but the calculation is wrong for even numbers.
For even numbers of servers, the code should look like the following:
case lists:member(Me, Servers) of true -> lists:nth(length(Indexes) div 2 + 1, Indexes); false -> lists:nth(length(Indexes) div 2, Indexes) end.
A different approach via refactoring achieved the same ends.
quorum_min/3 works fine for odd numbers of servers, but the calculation is wrong for even numbers.
For even numbers of servers, the code should look like the following: