GeezerVison is showing github.com — feat: FlexiRaft static quorums by lshir · Pull Request #638 · rabbitmq/ra
Conversation
lshir
commented
Jun 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Proposed Changes
Adds support for the simplest optimization from FlexiRaft #500 : static quorums not confined to the classic majority.
Operators can configure a static data-commit quorum size. In particular, this is useful if it is set below the classic majority - allowing data to be committed with fewer acks. To guarantee safety, the leader election quorum is increased, forcing the property that the data commit quorum and the leader election quorum intersect (|Qd| + |Qe| > N)
Out of scope:
- dynamic quorums and quorums-of-sets as defined in FlexiRaft, or other optimizations pertaining to cluster resize
- consistent-read query path (bound to classic majority)
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lin72h reacted with thumbs up emoji
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds FlexiRaft “static quorum” support to Ra, allowing operators to configure a fixed data-commit quorum size (potentially below classic majority) while increasing the election quorum to preserve quorum intersection safety.
Changes:
- Introduces
#flexiraft_cfg{} and stores it in the server #cfg{} record to control quorum behavior.
- Updates leader commit-index advancement and election/pre-vote quorum calculations to support static data-commit quorums.
- Adds new unit/integration tests covering commit and election behavior under static quorum settings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File |
Description |
| test/ra_server_SUITE.erl |
Adds suite tests validating commit and election behavior under static quorum configuration. |
| src/ra_server.hrl |
Introduces FlexiRaft config record/type and embeds it into the server config record. |
| src/ra_server.erl |
Implements static data-commit quorum calculation, adjusts election quorum logic, validates FlexiRaft config at init, and expands internal unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+373
to
+374
|
|
Flexi = maps:get(flexiraft_config, Config, #flexiraft_cfg{}),
|
|
|
ok = validate_flexiraft_config(Flexi, length(InitialNodes)),
|
Comment on lines
+4277
to
+4278
|
|
% 2 servers - all servers have seen new commit
|
|
|
4 = agreed_commit([4, 4, 4], 2),
|
|
thank you, I never envisaged having specific configuration for this feature but rather just implement the optimisation for even sized clusters in #500 and just have that the default (and perhaps only) behaviour. One of the main performance considerations for Ra is how the replication is done and how it gets linearly slower with the number of cluster members. Flexible quorums don't address that aspect, in fact I am not sure they are as useful as they might initially seem to be. Unless member latency is rather variable you aren't really going to commit that much faster by reducing the required set a little once you take the network write + fsync write into account. It is useful for availability in even sized clusters though.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
thank you, I never envisaged having specific configuration for this feature but rather just implement the optimisation for even sized clusters in #500 and just have that the default (and perhaps only) behaviour. One of the main performance considerations for Ra is how the replication is done and how it gets linearly slower with the number of cluster members. Flexible quorums don't address that aspect, in fact I am not sure they are as useful as they might initially seem to be. Unless member latency is rather variable you aren't really going to commit that much faster by reducing the required set a little once you take the network write + fsync write into account. It is useful for availability in even sized clusters though.
Ok, thanks for the response! I will close this PR and rework it to address even-only.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 3, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|