ra icon indicating copy to clipboard operation
ra copied to clipboard

Exclude `non_voter` server from quorum calculation

Open sile opened this issue 5 months ago • 6 comments

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

  • [x] Bug fix (non-breaking change which fixes issue #NNNN)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation (correction or otherwise)
  • [ ] Cosmetics (whitespace, appearance)

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.

  • [x] I have read the CONTRIBUTING.md document
  • [x] I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • [x] All tests pass locally with my changes
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added necessary documentation (if appropriate)
  • [ ] Any dependent changes have been merged and published in related repositories

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.

sile avatar Mar 29 '24 07:03 sile

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.

illotum avatar Apr 25 '24 23:04 illotum

@illotum thank you for chiming in!

michaelklishin avatar Apr 26 '24 02:04 michaelklishin

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

sile avatar Apr 26 '24 06:04 sile

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

sile avatar May 16 '24 06:05 sile

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.

lukebakken avatar May 16 '24 14:05 lukebakken

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

sile avatar May 17 '24 00:05 sile