alievmirza commented on a change in pull request #481:
URL: https://github.com/apache/ignite-3/pull/481#discussion_r769677687



##########
File path: 
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java
##########
@@ -1171,6 +1218,9 @@ private void electSelf() {
             }
             resetLeaderId(PeerId.emptyPeer(), new 
Status(RaftError.ERAFTTIMEDOUT,
                 "A follower's leader_id is reset to NULL as it begins to 
request_vote."));
+            if (!options.getRaftOptions().isStepDownWhenVoteTimedout()) {

Review comment:
       This code is redundant and I'll delete that, it remained from the 
previous attempt when adjusting happened after vote timed out. Now we adjust 
election after election time out, and in `handleVoteTimeout` in case pre-vote 
is granted. This is needed because there is a case when pre-vote is granted, 
but a leader is not elected for some reason. In that case, the election timer 
won't time out, but the vote timer will time out, but the leader won't be 
elected. See test `testElectionTimeoutAutoAdjustWhenBlockedRequestVoteMessages` 
where this scenario is reproduced. 




-- 
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]


Reply via email to