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

REBALANCELEADERS needs to change the leader election queue.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.1, 6.0
    • None
    • None

    Description

      The original code (SOLR-6517) assumed that changes in the clusterstate after issuing a command to the overseer to change the leader indicated that the leader was successfully changed. Fortunately, Noble clued me in that this isn't the case and that the potential leader needs to insert itself in the leader election queue before trigging the change leader command.

      Inserting themselves in the front of the queue should probably happen in BALANCESHARDUNIQUE when the preferredLeader property is assigned as well.

      noble.paul Do evil things happen if a node joins at the head but it's already in the queue? These ephemeral nodes in the queue are watching each other. So if node1 is the leader you have
      node1 <- node2 <- node3 <- node4
      where <- means "watches".

      Now, if node3 puts itself at the head of the list, you have

      node1 <- node2
            <- node3 <- node4
      

      I think when I was looking at this it all "just worked".
      1> node 1 goes down. Nodes 2 and 3 duke it out but there's code to insure that node3 becomes the leader and node2 inserts itself at then end so it's watching node 4.

      2> node 2 goes down, nobody gets notified and it doesn't matter.

      3> node 3 goes down, node 4 gets notified and starts watching node 2 by inserting itself at the end of the list.

      4> node 4 goes down, nobody gets notified and it doesn't matter.

      Attachments

        1. BalanceLeaderTester.java
          16 kB
          Erick Erickson
        2. SOLR-6691.patch
          48 kB
          Erick Erickson
        3. SOLR-6691.patch
          53 kB
          Erick Erickson
        4. SOLR-6691-5x.patch
          38 kB
          Erick Erickson

        Issue Links

          Activity

            People

              erickerickson Erick Erickson
              erickerickson Erick Erickson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: