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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment