Skip to content

feat: FlexiRaft for even-sized data commit quorums#643

Open
lshir wants to merge 39 commits into
rabbitmq:mainfrom
lshir:sl/flexiquorum-500-2
Open

feat: FlexiRaft for even-sized data commit quorums#643
lshir wants to merge 39 commits into
rabbitmq:mainfrom
lshir:sl/flexiquorum-500-2

Conversation

@lshir

@lshir lshir commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

Replaces #638 and #642 - implementing only the data commit quorum optimization for even clusters described in #500

For even-sized clusters, we can commit an entry with N div 2 rather than N div 2 + 1 acks. This change is only applied to clusters that are not changing in size, and we do not touch the query quorum path. We also only apply for clusters with N>=4 so that a single node does not constitute a quorum.

Types of Changes

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

  • 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.

  • Mandatory: I (or my employer/client) have have signed the CA (see https://github.com/rabbitmq/cla)
  • I have read the CONTRIBUTING.md document
  • All tests pass locally with my changes
  • 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.

@lshir lshir changed the title Sl/flexiquorum 500 2 feat: FlexiRaft for even-sized data commit quorums Jul 6, 2026
@kjnilsson
kjnilsson requested a review from Copilot July 8, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the FlexiRaft optimization for data commit quorums in even-sized clusters by allowing commits with N div 2 (instead of classic majority N div 2 + 1) when cluster membership is stable, while keeping election and query quorums unchanged.

Changes:

  • Adjusts leader commit-index advancement to use a reduced data commit quorum for even voter counts when cluster_change_permitted = true.
  • Adds/updates unit and integration tests covering the even-quorum commit behavior and related quorum helpers.
  • Documents the flexible quorum behavior in internal docs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
test/ra_SUITE.erl Fixes a minor comment typo in an existing test.
test/ra_server_SUITE.erl Adds an even-quorum commit test and updates existing expectations/ordering in leader handling tests.
src/ra_server.erl Introduces data_commit_quorum_size/2 and agreed_commit/2 to support reduced data commit quorums for even voter counts.
docs/internals/INTERNALS.md Adds internal documentation describing the flexible quorum optimization and when it is applied.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/internals/INTERNALS.md Outdated
Comment thread test/ra_server_SUITE.erl Outdated
Comment thread test/ra_server_SUITE.erl Outdated
Comment thread src/ra_server.erl Outdated
lshir and others added 4 commits July 8, 2026 22:01
@lshir
lshir marked this pull request as ready for review July 13, 2026 01:32
@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants