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

[21.11.x]: backport #4157 #4216

Merged
merged 1 commit into from
Apr 6, 2022
Merged

Conversation

dotnwat
Copy link
Member

@dotnwat dotnwat commented Apr 6, 2022

Fixes: #4188

In joint consensus raft needs majority of both new and previous quorums
to make the decisions. Voting for new leader is one of the processes
that requires majority agreement from both quorums. In previous
implementation we waited for majority of the vote request responses.
This approach would make leader election much slower in situations where
quorums differ by one node.

Example:

current voters: `[1,2,4]`, previous voters: `[1,2,3]`

In this scenario to elect leader it is enough to wait from responses
from node 1 and 2 as they form majority in both quorums. In previous
implementation we wait for at least `(n/2)+1` responses. Where `n` is a
number of unique voter ids. In the example above `n = len([1,2,3,4]) =
4`. This way we had to wait for 3 replies while only 2 of the are enough
to elect new leader.

Changed implementation to check if we can make a definitive decision
about vote round result after receiving each of the replies. This way we
will always use smallest possible set of replies to make a decision.

Signed-off-by: Michal Maslanka <michal@vectorized.io>
(cherry picked from commit bca6f1d)
Copy link
Member

@BenPope BenPope left a comment

Choose a reason for hiding this comment

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

LGTM

@dotnwat dotnwat merged commit 1cda696 into redpanda-data:v21.11.x Apr 6, 2022
@andrewhsu andrewhsu added this to the v21.11.12 milestone Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants