Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.2.x] raft: don't promote to voter if previous config is not committed #17797

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Apr 11, 2024

Backport of PR #17675

Fixes #17790

Otherwise we may add several new voters in quick succession, that the
old voters will not know of, resulting in a possibility of non-intersecting
quorums.

Example scenario:
1. we start with leader id 1, committed configuration: voters:1,2,3; learners:4,5
2. 1,4,5 are partitioned from 2,3
3. 1 finishes recovery of 4 and 5 and adds them as voters
4. now 1 can remain the leader getting responses from 1,4,5
   (that form a quorum in the new voter set 1,2,3,4,5)
   and 2,3 can elect a leader among themselves, say 2
   (because 2,3 is a quorum in the old voter set 1,2,3)
5. now 1 and 2 both think that they are legitimate leaders and can
   commit new entries, resulting in divergent logs.

To prevent this, in step 3 we don't add 5 as voter until the configuration with
voter 4 is committed (or vice versa).

(cherry picked from commit b1e1e02)
@ztlpn ztlpn added this to the v23.2.x-next milestone Apr 11, 2024
@ztlpn ztlpn added the kind/backport PRs targeting a stable branch label Apr 11, 2024
@ztlpn ztlpn marked this pull request as ready for review April 11, 2024 12:52
@ztlpn ztlpn modified the milestones: v23.2.x-next, v23.2.28 Apr 12, 2024
@mmaslankaprv mmaslankaprv merged commit 1226817 into redpanda-data:v23.2.x Apr 12, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants