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

ZkController#publishAndWaitForDownStates logic is inefficient

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.2, 7.0
    • None
    • None

    Description

      The following logic introduced as part of SOLR-8720 is inefficient.

      https://github.com/apache/lucene-solr/blob/6c0331b8309603eaaf14b6677afba5ffe99f16a3/solr/core/src/java/org/apache/solr/cloud/ZkController.java#L687-L712

      Specifically,

      • foundStates flag is set to TRUE before the for loop.
      • In the for loop we check if any replica on this node is not in the DOWN state. If yes, then foundStates = FALSE
      • If foundStates == TRUE then we break out of the loop and return.

      The problem here is that once foundStates is set to FALSE, it is never reset to TRUE. Hence we end up spending the whole 60 secs iterating over the collections even though all the replicas are marked as DOWN in later iterations.

      Attachments

        1. SOLR-9199.patch
          1 kB
          Hrishikesh Gadre

        Activity

          People

            hgadre Hrishikesh Gadre
            hgadre Hrishikesh Gadre
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: