Xushaohong commented on pull request #560:
URL: https://github.com/apache/ratis/pull/560#issuecomment-990660696
> The conf may be changed later on. Therefore, let's don't check it here and
check null in LeaderElection.getHigherPriorityPeers(..) as below.
The check here in the getHigherPriorityPeers is not enough. The possible
case I tested is that bootstrapped follower changes role from follower to
candidate and start leader election, as it has an empty conf, it will become
leader directly due to ```if (others.isEmpty()) { r = new
ResultAndTerm(Result.PASSED, electionTerm);```. Once it becomes another leader,
it won't receive any requests from the original leader as the term is
increased. Meanwhile, the original leader stuck in sending appendEntries to
'follower'.
I sightly changed the check place. PTAL
@szetszwo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]