patsonluk commented on code in PR #1762:
URL: https://github.com/apache/solr/pull/1762#discussion_r1260288880


##########
solr/core/src/java/org/apache/solr/servlet/CoordinatorHttpSolrCall.java:
##########
@@ -208,9 +208,12 @@ private static void setMDCLoggingContext(String 
collectionName) {
   private static void addReplica(String syntheticCollectionName, CoreContainer 
cores) {
     SolrQueryResponse rsp = new SolrQueryResponse();
     try {
+      String coreName = syntheticCollectionName + "_" + "r1";

Review Comment:
   Ah I think we do need to add node name, as the [AddReplicaCmd 
logic](https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/cloud/api/collections/AddReplicaCmd.java#L388)
 would iterate through all slices and throw exception on any core name matches.
   
   Therefore, for the 1st coordinator node, it's fine -> the replica is created 
by the collection creation call, which follows the standard name, ie 
`.sys.COORDINATOR-COLL-conf_shard1_replica_n1`.
   
   The 2nd coordinator node is also fine -> `.sys.COORDINATOR-COLL-conf_r1`.
   
   However starting from the 3rd coordinator, it would fail with infinite loop, 
since it will skip adding replica (due to the check linked above), but 
`solrCall.getCoreByCollection(syntheticCollectionName, isPreferLeader)` would 
not be able to load such core (since it's not in 3rd node), hence causing the 
infinite loop.
   
   Such can be reproduced by modifying node count 
[here](https://github.com/apache/solr/pull/1762/files#diff-13f37ffd1807b53dacbf21317f6f6d3114448ae2e85c90835fa2f368e31b3cbaR489)
 in the test case from 2 to 3



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to