feat: FlexiRaft for even-sized data commit quorums#643
Open
lshir wants to merge 39 commits into
Open
Conversation
…voter even quorum colision
There was a problem hiding this comment.
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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
lshir
marked this pull request as ready for review
July 13, 2026 01:32
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe 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.
CONTRIBUTING.mddocumentFurther 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.