|
@@ -976,8 +976,7 @@ public class FastLeaderElection implements Election {
|
|
/*
|
|
/*
|
|
* Exponential backoff
|
|
* Exponential backoff
|
|
*/
|
|
*/
|
|
- int tmpTimeOut = notTimeout * 2;
|
|
|
|
- notTimeout = Math.min(tmpTimeOut, maxNotificationInterval);
|
|
|
|
|
|
+ notTimeout = Math.min(notTimeout << 1, maxNotificationInterval);
|
|
|
|
|
|
/*
|
|
/*
|
|
* When a leader failure happens on a master, the backup will be supposed to receive the honour from
|
|
* When a leader failure happens on a master, the backup will be supposed to receive the honour from
|
|
@@ -986,8 +985,8 @@ public class FastLeaderElection implements Election {
|
|
* The leader election algorithm does not provide the ability of electing a leader from a single instance
|
|
* The leader election algorithm does not provide the ability of electing a leader from a single instance
|
|
* which is in a configuration of 2 instances.
|
|
* which is in a configuration of 2 instances.
|
|
* */
|
|
* */
|
|
- self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval);
|
|
|
|
- if (self.getQuorumVerifier() instanceof QuorumOracleMaj && voteSet != null && voteSet.hasAllQuorums() && notTimeout != minNotificationInterval) {
|
|
|
|
|
|
+ if (self.getQuorumVerifier() instanceof QuorumOracleMaj
|
|
|
|
+ && self.getQuorumVerifier().revalidateVoteset(voteSet, notTimeout != minNotificationInterval)) {
|
|
setPeerState(proposedLeader, voteSet);
|
|
setPeerState(proposedLeader, voteSet);
|
|
Vote endVote = new Vote(proposedLeader, proposedZxid, logicalclock.get(), proposedEpoch);
|
|
Vote endVote = new Vote(proposedLeader, proposedZxid, logicalclock.get(), proposedEpoch);
|
|
leaveInstance(endVote);
|
|
leaveInstance(endVote);
|