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

Handle view changes during election #263

Merged
merged 1 commit into from Apr 12, 2024

Conversation

jabolina
Copy link
Member

More details on #259.

When the elected leader leaves before the voting thread has finished and a majority is present. This causes a liveness issue on both ELECTION and ELECTION2. We can fix this by stopping the voting thread before starting it again.

Scenarios the coordinator leaves before finishing the election process and a majority still exists. The ELECTION algorithm has a liveness issue since it does not verify changes in the view coordinator. We handle this case by calculating if the coordinator has changed between views, there is a majority, it is currently the coordinator, and there is no leader.

Created test cases for the scenarios mentioned in the GitHub issue and
the fixes.

Elected leader leaving before the voting thread has finished. This
causes a liveness issue on both ELECTION and ELECTION2. We can fix this
by stopping the voting thread before starting it again.

Scenarios the coordinator leaves before finishing the election process
and a majority still exists. ELECTION algorithm has a liveness issue in
this case, since it does not take into account changes in the view
coordinator. We handle this case by calculating if the coordinator has
changed between views, there is a majority, it is currently the
coordinator, and there is no leader elected.

Close jgroups-extras#259.
@jabolina jabolina added this to the 1.0.13 milestone Apr 10, 2024
@jabolina jabolina linked an issue Apr 10, 2024 that may be closed by this pull request
@jabolina jabolina merged commit e63f4b0 into jgroups-extras:master Apr 12, 2024
3 checks passed
@jabolina jabolina deleted the view-change-election branch April 12, 2024 22:59
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.

The election process may elect a leader who has left the group
1 participant