sigram commented on a change in pull request #2179:
URL: https://github.com/apache/lucene-solr/pull/2179#discussion_r552606865
##########
File path:
solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java
##########
@@ -254,8 +280,27 @@ public void call(ClusterState clusterState, ZkNodeProps
message, @SuppressWarnin
}
shardRequestTracker.processResponses(results, shardHandler, false, null,
Collections.emptySet());
+
+ if (withCollection != null) {
+ // process replica placements for the secondary collection, if any are
needed
+ for (ReplicaPosition replicaPosition : replicaPositions) {
+ if (!replicaPosition.collection.equals(withCollection)) {
+ continue;
+ }
+ ZkNodeProps props = new ZkNodeProps(
+ Overseer.QUEUE_OPERATION, ADDREPLICA.toString(),
+ ZkStateReader.COLLECTION_PROP, replicaPosition.collection,
+ ZkStateReader.SHARD_ID_PROP, replicaPosition.shard,
+ "node", replicaPosition.node,
+ CommonAdminParams.WAIT_FOR_FINAL_STATE,
Boolean.TRUE.toString()); // set to true because we want `withCollection` to be
ready after this collection is created
+ new AddReplicaCmd(ocmh).call(clusterState, props, results);
+ clusterState = zkStateReader.getClusterState(); // refresh
Review comment:
It's a copy-pasta from 8x... I wasn't sure if it's required so it's good
to know it doesn't make sense and can be removed.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]