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

ExclusiveMarking enum and checkExclusiveMarking method is very confusing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • 6.1
    • SolrCloud
    • None

    Description

      ExclusiveMarking enum and checkExclusiveMarking method is very confusing. It appears to do the opposite of its name e.g.

      @Override
        public ExclusiveMarking checkExclusiveMarking(String collectionName, ZkNodeProps message) {
          // CLUSTERSTATUS is always mutually exclusive
          //TODO deprecated remove this check .
          if(CLUSTERSTATUS.isEqual(message.getStr(Overseer.QUEUE_OPERATION)))
            return ExclusiveMarking.EXCLUSIVE;
      
          synchronized (collectionWip) {
            if(collectionWip.contains(collectionName))
              return ExclusiveMarking.NONEXCLUSIVE;
          }
      
          return ExclusiveMarking.NOTDETERMINED;
        }
      

      I guess it returns exclusive if the current task is the only one to run. We should document it or rename it to make its function more comprehensible.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shalin Shalin Shekhar Mangar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: