[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14231958#comment-14231958
 ] 

Hongchao Deng commented on ZOOKEEPER-2076:
------------------------------------------

My understanding is that leader election will take a long time regardless how 
close followers are:
1. Leader will take a snapshot on lead():
https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java#L418-418
2. Learner will take a snapshot on receiving NEWLEADER:
https://github.com/fengjingchao/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/Learner.java#L486-486

While the first one is unnecessary, the second one is introducing bugs... I see 
the best solution is to fix the problem of taking snapshot. But it's out of the 
scope here.

Any idea on exposing the API of suggestedLeader?

> Improve Leader Change Mechanism
> -------------------------------
>
>                 Key: ZOOKEEPER-2076
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2076
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.5.0
>            Reporter: Alexander Shraer
>
> When a leader is removed during a reconfiguration, ZOOKEEPER-107 uses a 
> mechanism where the old leader nominates the new one. Although it reduces the 
> time for a new leader to be elected, it still takes too long. This JIRA is 
> for two things:
> 1. Improve the mechanism, e.g., avoid loading snapshots, etc. during the 
> handoff.
> 2. Make it a first-class citizen & export it as a client API. We get 
> questions about this once in a while - how do I cause a different leader to 
> be elected ? Currently the response is either kill or reconfigure the current 
> leader.
> Any one interested to work on this ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to