rabbitmq / ra

A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Other
798 stars 93 forks source link

Exclude `non_voter` server from quorum calculation #427

Closed sile closed 1 month ago

sile commented 3 months ago

Proposed Changes

In my understanding, non_voter servers (introduced in https://github.com/rabbitmq/ra/pull/375) have to be handled as same as promotable servers except for the latter could promote to voter. However, the current implementation seems to include non_voter servers in the quorum (while promotable servers are excluded from that). This PR fixes the issue by excluding non_voter server from quorum calculation. Feel free to close this PR if I misunderstand something.

Types of Changes

What types of changes does your code introduce to this project? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask on the mailing list. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.

illotum commented 2 months ago

You got it right.

For other reviewers context, non_voter are a plug for future passive witness API, but implementation was cut down to simplify the original review. There is no ra API to add non_voters atm, it is a "hidden" feature.

In this light, @sile would you be able to re-work counting functions to include all possible states? Perhaps invert it to only include voter.

-type ra_membership() :: voter | promotable | non_voter | unknown.
michaelklishin commented 2 months ago

@illotum thank you for chiming in!

sile commented 2 months ago

@illotum Sounds good! (fixed in https://github.com/rabbitmq/ra/pull/427/commits/924c024577f09963a60a1e9e75a332ee19841611)

sile commented 1 month ago

This PR has received one approval (thanks, @michaelklishin!). What is holding it back from being merged?

lukebakken commented 1 month ago

What is holding it back from being merged?

@sile, please be patient. Team RabbitMQ and @kjnilsson in particular are busy working on higher-priority work, some of which is for customers who pay for RabbitMQ.

We will merge this PR when time allows.

sile commented 1 month ago

@lukebakken I see. Thank you for sharing the reason!

michaelklishin commented 1 month ago

I don't know if the next release will be 2.11.0 or 2.10.1 but let's stick to 2.11.0 as the milestone for now.