HoustonPutman commented on a change in pull request #1071: SOLR-14003: Refactor 
code to avoid reading state from Replica/Slic
URL: https://github.com/apache/lucene-solr/pull/1071#discussion_r357706730
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java
 ##########
 @@ -217,11 +218,13 @@ private void waitTillAllNodesActive() throws Exception {
       ZkStateReader zkStateReader = cloudClient.getZkStateReader();
       ClusterState clusterState = zkStateReader.getClusterState();
       DocCollection collection1 = clusterState.getCollection("collection1");
+      ShardStateProvider ssp = 
zkStateReader.getShardStateProvider(collection1.getName());
+
       Slice slice = collection1.getSlice("shard1");
       Collection<Replica> replicas = slice.getReplicas();
       boolean allActive = true;
       for (Replica replica : replicas) {
-        if (!clusterState.liveNodesContain(replica.getNodeName()) || 
replica.getState() != Replica.State.ACTIVE) {
+        if (!clusterState.liveNodesContain(replica.getNodeName()) || 
ssp.getState(replica)!= Replica.State.ACTIVE) {
 
 Review comment:
   Why not use a `!ssp.isActive(replica)`?
   
   I see inconsistent usage of this logic throughout.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to