noblepaul commented on a change in pull request #644:
URL: https://github.com/apache/solr/pull/644#discussion_r808536170



##########
File path: 
solr/core/src/java/org/apache/solr/cloud/overseer/CollectionMutator.java
##########
@@ -160,6 +164,38 @@ public ZkWriteCommand modifyCollection(final ClusterState 
clusterState, ZkNodePr
     }
   }
 
+  /**
+   *  Update the state/leader of replicas in state.json from PRS data
+   */
+  public static DocCollection updateReplicasFromPrs(DocCollection coll, 
PerReplicaStates prs) {
+    //we are disabling PRS. Update the replica states
+    Map<String, Slice> modifiedSlices = new LinkedHashMap<>();
+    coll.forEachReplica((s, replica) -> {
+      PerReplicaStates.State prsState = prs.states.get(replica.getName());
+      if (prsState != null) {
+        if (prsState.state != replica.getState()) {

Review comment:
       I thought about it. I thought this would make it simpler. suggestions 
are welcome




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to