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


##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientRoutingTest.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.client.solrj.impl;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.ShardParams;
+import org.apache.solr.common.params.UpdateParams;
+import org.apache.solr.common.util.NamedList;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public final class CloudSolrClientRoutingTest extends SolrCloudTestCase {

Review Comment:
   Thank you for writing a test.
   
   Debatably, the little change you did in TestDistributedTracing was 
sufficient -- at least for my tastes.
   
   I personally think distributed tracing via MockTracer (as you found in 
TestDistributedTracing) should be how tests might test internal routing 
decisions, as it's a generic/uniform approach.



##########
solr/CHANGES.txt:
##########
@@ -171,6 +171,8 @@ Bug Fixes
 
 * SOLR-16760: bin/solr package tool supports -h and -help command like other 
tools.  (Eric Pugh)
 
+* SOLR-14630: When querying a single collection, SolrJ targets directly a 
replica of the collection (and not the collection it self) to avoid useless 
forwarding. (Pierre Salagnac)

Review Comment:
   This is an optimization but a bug, I'd say.  This is how the user will 
experience it.  I would also reference "_route_" and/or "shards.preference" 
being pertinent.
   Also "it self" -> "itself".
   
   Suggestion:
   SolrJ CloudSolrClient: when searching one collection with "_route_" or 
"shards.preference", form the HTTP request directly to the intended core 
instead of the collection.  Saves a needless HTTP hop sometimes.



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