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

Race condition in ClusterStatus.getClusterStatus

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 5.3.1
    • 5.5.1, 6.0, 6.1, 7.0
    • SolrCloud
    • None

    Description

      Reading cluster state information using /collections?action=CLUSTERSTATUS can fail if there's a concurrent /collections?action=DELETE operation.

      The code in ClusterStatus.getClusterStatus

      1. gets collection names
      2. for every collection reads its cluster state info using ClusterState.getCollection

      The problem is that if there's a DELETE operation in between then ClusterState.getCollection can fail thus causing the whole operation to fail. It seems that it would be better to call ClusterState.getCollectionOrNull and skip/ignore that collection if the result is null.

      19:49:32.479 [qtp1531448569-881] ERROR org.apache.solr.core.SolrCore - org.apache.solr.common.SolrException: Could not find collection : collection
          at org.apache.solr.common.cloud.ClusterState.getCollection(ClusterState.java:165)
          at org.apache.solr.handler.admin.ClusterStatus.getClusterStatus(ClusterStatus.java:110)
          at org.apache.solr.handler.admin.CollectionsHandler$CollectionOperation$19.call(CollectionsHandler.java:614)
          at org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:166)
      

      Attachments

        1. SOLR-8804.patch
          2 kB
          Varun Thacker
        2. SOLR-8804.patch
          3 kB
          Varun Thacker

        Issue Links

          Activity

            People

              varun Varun Thacker
              alexey.serba Alexey Serba
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: