Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5689

On reconnect, ZkController cancels election on first context rather than latest

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.6.1, 4.7, 6.0
    • Fix Version/s: 4.7, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      I haven't tested this yet, so I could be wrong, but this is my reading of the code:
      During init:

      ElectionContext context = new OverseerElectionContext(zkClient, overseer, getNodeName());
      overseerElector.setup(context);
      overseerElector.joinElection(context, false);
      

      On reconnect:

      ElectionContext context = new OverseerElectionContext(zkClient,overseer, getNodeName());
                    
      ElectionContext prevContext = overseerElector.getContext();
      if (prevContext != null) {
        prevContext.cancelElection();
      }
                    
      overseerElector.joinElection(context, true);
      

      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.

        Attachments

        1. SOLR-5689.patch
          0.6 kB
          Shalin Shekhar Mangar

          Activity

            People

            • Assignee:
              shalinmangar Shalin Shekhar Mangar
              Reporter:
              gchanan Gregory Chanan
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: