Skip to content

RATIS-2311. Control appliedIndex before starting a transfer election - #1586

Open
Elia-Renzoni wants to merge 1 commit into
apache:masterfrom
Elia-Renzoni:refactor/transfer-leadership
Open

Elia-Renzoni wants to merge 1 commit into
apache:masterfrom
Elia-Renzoni:refactor/transfer-leadership

Conversation

@Elia-Renzoni

Copy link
Copy Markdown

What changes were proposed in this pull request?

This PR makes the leadership transfer check in TransferLeadership#isFollowerUpToDate stricter by also verifying that the gap between the target follower's matchIndex (replicated log) and its appliedIndex (state machine apply progress) is within an acceptable threshold, in addition to the existing matchIndex up-to-date check

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2311?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

How was this patch tested?

Added testRiskyLeadershipTransfer to the abstract LeaderElectionTests class, alongside the existing testTransferLeader and testTransferLeaderTimeout tests

Signed-off-by: Elia Renzoni <elia.renzoni03@gmail.com>
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.

1 participant