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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.6.1, 4.7, 6.0
    • 4.7, 6.0
    • None
    • 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

            shalin Shalin Shekhar Mangar
            gchanan Gregory Chanan
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: