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

Mark Miller commented on SOLR-5689:
-----------------------------------

It also sets the latest context on the elector though - which we want to make 
sure is always the latest so that if for some reason we are asked to join the 
election again and are already participating, we cancel our participation first.

> On reconnect, ZkController cancels election on first context rather than 
> latest
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-5689
>                 URL: https://issues.apache.org/jira/browse/SOLR-5689
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.6.1, 5.0, 4.7
>            Reporter: Gregory Chanan
>
> I haven't tested this yet, so I could be wrong, but this is my reading of the 
> code:
> During init:
> {code}
> ElectionContext context = new OverseerElectionContext(zkClient, overseer, 
> getNodeName());
> overseerElector.setup(context);
> overseerElector.joinElection(context, false);
> {code}
> On reconnect:
> {code}
> ElectionContext context = new OverseerElectionContext(zkClient,overseer, 
> getNodeName());
>               
> ElectionContext prevContext = overseerElector.getContext();
> if (prevContext != null) {
>   prevContext.cancelElection();
> }
>               
> overseerElector.joinElection(context, true);
> {code}
> setup doesn't appear to be called on reconnect, so the new context is never 
> set and the first context gets cancelled over and over.
> A call to overseerElector.setup(context); before joinElection in the 
> reconnect case would address this.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to