[ https://issues.apache.org/jira/browse/SOLR-16701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patson Luk updated SOLR-16701: ------------------------------ 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)}} was: 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)}}}} {{{{at app//org.apache.solr.common.cloud.ZkStateReader.getCollectionLive(ZkStateReader.java:1672)}}}} > Fetching PRS enabled collection might throw SolrException: Error fetching > per-replica-states if the collection is deleted during the fetch > ------------------------------------------------------------------------------------------------------------------------------------------ > > Key: SOLR-16701 > URL: https://issues.apache.org/jira/browse/SOLR-16701 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Components: SolrCloud > Affects Versions: main (10.0) > Reporter: Patson Luk > Priority: Major > > 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)}} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org