You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/03/10 10:10:02 UTC

[lucene] 05/07: Fixing CollectionReloadTest by moving OCMH's use of Replica.State.getState() to SSP

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch jira/solr14003
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 99d25ef335c37d460d2f0b6f759050bde5beef53
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Wed Dec 18 03:29:56 2019 +0530

    Fixing CollectionReloadTest by moving OCMH's use of Replica.State.getState() to SSP
---
 .../solr/cloud/api/collections/OverseerCollectionMessageHandler.java    | 2 +-
 .../org/apache/solr/cloud/api/collections/CollectionReloadTest.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java
index 13bb2da..e909860 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java
@@ -969,7 +969,7 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
                   Slice slice, ShardHandler shardHandler) {
       List<Replica> notLiveReplicas = new ArrayList<>();
       for (Replica replica : slice.getReplicas()) {
-        if ((stateMatcher == null || Replica.State.getState(replica.getStr(ZkStateReader.STATE_PROP)) == stateMatcher)) {
+        if ((stateMatcher == null || zkStateReader.getShardStateProvider(replica.getCollection()).getState(replica) == stateMatcher)) {
           if (clusterState.liveNodesContain(replica.getStr(ZkStateReader.NODE_NAME_PROP))) {
             // For thread safety, only simple clone the ModifiableSolrParams
             ModifiableSolrParams cloneParams = new ModifiableSolrParams();
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java
index 02e445f..5255cd0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java
@@ -51,7 +51,7 @@ public class CollectionReloadTest extends SolrCloudTestCase {
     log.info("testReloadedLeaderStateAfterZkSessionLoss initialized OK ... running test logic");
 
     final String testCollectionName = "c8n_1x1";
-    CollectionAdminRequest.createCollection(testCollectionName, "conf", 1, 1)
+    CollectionAdminRequest.createCollection(testCollectionName, "conf", 1, 1).setExternalState(true)
         .process(cluster.getSolrClient());