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

Fix race with candidateFromLeadershipTransfer #570

Merged
merged 1 commit into from Sep 28, 2023

Conversation

dhiaayachi
Copy link
Contributor

Fix #517

candidateFromLeadershipTransfer is used to notify that a leadership transfer is ongoing and transition nodes to candidate state directly without going through follower state. As a leader is already in place transitioning to follower state will avoid leadership transfer happening.

This PR fix a race condition as this bool ,candidateFromLeadershipTransfer, is read in the appendEntries processing while written in the state processing routine (in both runCandidate and possibly runFollower).

See #517 for a stack trace of the Data Race

@dhiaayachi dhiaayachi requested a review from a team as a code owner September 8, 2023 14:19
@dhiaayachi dhiaayachi requested review from JadhavPoonam and removed request for a team September 8, 2023 14:20
@dhiaayachi dhiaayachi merged commit 49bd61b into main Sep 28, 2023
6 checks passed
@dhiaayachi dhiaayachi deleted the fix-race-with-leader-transfer branch September 28, 2023 06:00
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.

DATA RACE between runCandidate() and appendEntries()
3 participants