dsmiley commented on code in PR #5388:
URL: https://github.com/apache/solr/pull/5388#discussion_r4750164193


##########
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/update/processor/MirroringUpdateRequestProcessorFactory.java:
##########
@@ -299,6 +272,39 @@ public UpdateRequestProcessor getInstance(
         producerMetrics);
   }
 
+  /**
+   * Builds the parameters of mirrored requests from the incoming request: 
names the collection
+   * explicitly, strips internal distributed-update parameters and disables 
mirroring on the target.
+   */
+  static ModifiableSolrParams createMirroredParams(SolrQueryRequest req) {
+    // Get the collection name for the core so we can be explicit in the 
mirrored request
+    CoreDescriptor coreDesc = req.getCore().getCoreDescriptor();
+    String collection = coreDesc.getCollectionName();
+    if (collection == null) {
+      throw new SolrException(
+          SolrException.ErrorCode.SERVER_ERROR,
+          "Could not determine collection name for "
+              + MirroringUpdateProcessor.class.getSimpleName()
+              + ". Solr may not be running in cloud mode.");
+    }
+
+    ModifiableSolrParams mirroredParams = new 
ModifiableSolrParams(req.getParams());
+    mirroredParams.set("collection", collection);

Review Comment:
   There has been discussion of removing this parameter.  I don't think 
introducing a new usage of it here is wise.  Any way, we'll have to revisit 
this when we actually want to do that.



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