RATIS-2008. Follower should recognize candidate if the candidate is the same peer as the current valid leader #1024
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
During pre-vote, some follower reject the PRE_VOTE request from a candidate although the candidate has the same peer ID as the current leader.
2024-01-18 13:44:50,123 [grpc-default-executor-100] INFO org.apache.ratis.server.impl.VoteContext: e46cc30b-13ca-4778-b856-e84b0677493d@group-059247EC8137-FOLLOWER: reject PRE_VOTE from c7e3fa47-df62-4883-8d6e-50c3b6a9b94c: this server is a follower and still has a valid leader c7e3fa47-df62-4883-8d6e-50c3b6a9b94c
It might be a good idea to add another check so that if the candidate has the same peer ID as the follower's current recognized leader, we approve the PRE_VOTE request.
Note: The optimization might be marginal since leader is only valid after min.rpc.timeout (150ms). Afterwards, the follower should recognize the candidate.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2008
How was this patch tested?
Existing tests.