diff --git a/src/ra_server.erl b/src/ra_server.erl index dd10ea28..8470c135 100644 --- a/src/ra_server.erl +++ b/src/ra_server.erl @@ -2827,9 +2827,7 @@ query_indexes(#{cfg := #cfg{id = Id}, query_index := QueryIndex}) -> maps:fold(fun (PeerId, _, Acc) when PeerId == Id -> Acc; - (_K, #{voter_status := #{membership := non_voter}}, Acc) -> - Acc; - (_K, #{voter_status := #{membership := promotable}}, Acc) -> + (_K, #{voter_status := #{membership := Membership}}, Acc) when Membership =/= voter -> Acc; (_K, #{query_index := Idx}, Acc) -> [Idx | Acc] @@ -2841,9 +2839,7 @@ match_indexes(#{cfg := #cfg{id = Id}, {LWIdx, _} = ra_log:last_written(Log), maps:fold(fun (PeerId, _, Acc) when PeerId == Id -> Acc; - (_K, #{voter_status := #{membership := non_voter}}, Acc) -> - Acc; - (_K, #{voter_status := #{membership := promotable}}, Acc) -> + (_K, #{voter_status := #{membership := Membership}}, Acc) when Membership =/= voter -> Acc; (_K, #{match_index := Idx}, Acc) -> [Idx | Acc] @@ -3153,9 +3149,7 @@ required_quorum(Cluster) -> count_voters(Cluster) -> maps:fold( - fun (_, #{voter_status := #{membership := non_voter}}, Count) -> - Count; - (_, #{voter_status := #{membership := promotable}}, Count) -> + fun (_, #{voter_status := #{membership := Membership}}, Count) when Membership =/= voter -> Count; (_, _, Count) -> Count + 1