Skip to content

RATIS-2830. Skip unreachable followers when yielding leadership - #1713

Merged
szetszwo merged 1 commit into
apache:masterfrom
JoeCqupt:feat/ratis-2830-yield-reachable-follower
Nov 28, 2026
Merged

szetszwo merged 1 commit into
apache:masterfrom
JoeCqupt:feat/ratis-2830-yield-reachable-follower

Conversation

@JoeCqupt

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

A higher-priority follower can still appear caught up after it goes offline if no new entries are appended. The leader can repeatedly attempt to transfer leadership to that follower and reject client writes while each transfer is pending.

Skip followers whose last RPC response is older than the leader's maximum RPC timeout before ranking candidates by priority. This reuses the same check as the leader's quorum check.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2830

How was this patch tested?

Added testSkipUnreachableHigherPriorityFollower. The test stops a caught-up follower after it receives a transfer request and before it can start an election. It verifies that transfer attempts stop after the follower's last RPC response expires, that the original leader accepts a write in the same term, and that the follower can become leader after restarting.

@szetszwo szetszwo left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@JoeCqupt , thanks for working on this!

+1 the change looks good. Will wait for the CI.

Could you post a comment on RATIS-2830? We need you JIRA account and assign it to you.

@JoeCqupt

Copy link
Copy Markdown
Contributor Author

@JoeCqupt , thanks for working on this!

+1 the change looks good. Will wait for the CI.

Could you post a comment on RATIS-2830? We need you JIRA account and assign it to you.

done

@szetszwo
szetszwo merged commit fe7a871 into apache:master Nov 28, 2026
17 checks passed
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.

2 participants