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

Fetching PRS enabled collection might throw SolrException: Error fetching per-replica-states if the collection is deleted during the fetch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • main (10.0)
    • None
    • SolrCloud
    • None

    Description

      It's found that a race condition could arise and trigger SolrException, if:
      1. `fetchCollectionState` is called, and the state.json is fetched
      2. But before the `fetchCollectionState` fetches the PRS entries, the collection state.json/PRS are deleted by someone else
      3. `fetchCollectionState` would throw below exception when it reaches the PRS fetching logic

      org.apache.solr.common.SolrException: Error fetching per-replica states
          at __randomizedtesting.SeedInfo.seed([C2BFFBF8FE49C1E1:F1C8D9E308D2745]:0)
          at app//org.apache.solr.common.cloud.PerReplicaStatesFetcher.fetch(PerReplicaStatesFetcher.java:49)
          at app//org.apache.solr.common.cloud.PerReplicaStatesFetcher$LazyPrsSupplier.lambda$new$0(PerReplicaStatesFetcher.java:62)
          at app//org.apache.solr.common.cloud.DocCollection$PrsSupplier.get(DocCollection.java:515)
          at app//org.apache.solr.common.cloud.Replica.isLeader(Replica.java:314)
          at app//org.apache.solr.common.cloud.Slice.findLeader(Slice.java:242)
          at app//org.apache.solr.common.cloud.Slice.setPrsSupplier(Slice.java:56)
          at app//org.apache.solr.common.cloud.DocCollection.<init>(DocCollection.java:123)
          at app//org.apache.solr.common.cloud.ClusterState.collectionFromObjects(ClusterState.java:305)
          at app//org.apache.solr.common.cloud.ClusterState.createFromCollectionMap(ClusterState.java:254)
          at app//org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.createFromJsonSupportingLegacyConfigName(ZkClientClusterStateProvider.java:117)
          at app//org.apache.solr.common.cloud.ZkStateReader.fetchCollectionState(ZkStateReader.java:1695)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              patson Patson Luk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h