You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Gregory Chanan (JIRA)" <ji...@apache.org> on 2014/02/02 23:36:09 UTC

[jira] [Created] (SOLR-5689) On reconnect, ZkController cancels election on first context rather than latest

Gregory Chanan created SOLR-5689:
------------------------------------

             Summary: 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org