This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 399663b1115 SOLR-17893: Use caching to remove Remote Proxy bottleneck 
(#3614)
399663b1115 is described below

commit 399663b1115a13f9c026e6bcded985bd278fe4c7
Author: Houston Putman <[email protected]>
AuthorDate: Fri Sep 5 12:36:36 2025 -0700

    SOLR-17893: Use caching to remove Remote Proxy bottleneck (#3614)
    
    (cherry picked from commit fda4c40f53c8f44de9970d547fd7f6a6d6d6a924)
---
 solr/CHANGES.txt                                                      | 2 ++
 solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java          | 4 ++--
 .../src/java/org/apache/solr/common/cloud/ZkStateReader.java          | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 34fabe78c86..123bbfb63d3 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -13,6 +13,8 @@ Improvements
 ---------------------
 * SOLR-17860: DocBasedVersionConstraintsProcessorFactory now supports PULL 
replicas. (Houston Putman)
 
+* SOLR-17893: Speed up Remote Proxy for high QPS, utilizing ClusterState 
caching. (Houston Putman)
+
 Optimizations
 ---------------------
 (No changes)
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java 
b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index 1fd374536b5..8f67b6acecd 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -348,7 +348,7 @@ public class HttpSolrCall {
     }
     ZkStateReader zkStateReader = cores.getZkController().getZkStateReader();
     Supplier<DocCollection> logic =
-        () -> 
zkStateReader.getClusterState().getCollectionOrNull(collectionName);
+        () -> 
zkStateReader.getClusterState().getCollectionOrNull(collectionName, true);
 
     DocCollection docCollection = logic.get();
     if (docCollection != null) {
@@ -1124,7 +1124,7 @@ public class HttpSolrCall {
   protected String getRemoteCoreUrl(String collectionName, String origCorename)
       throws SolrException {
     ClusterState clusterState = cores.getZkController().getClusterState();
-    final DocCollection docCollection = 
clusterState.getCollectionOrNull(collectionName);
+    final DocCollection docCollection = 
clusterState.getCollectionOrNull(collectionName, true);
     Slice[] slices = (docCollection != null) ? 
docCollection.getActiveSlicesArr() : null;
     List<Slice> activeSlices;
     boolean byCoreName = false;
diff --git 
a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java 
b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index 27a39e291f9..3bff3ea21ca 100644
--- 
a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ 
b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -755,6 +755,7 @@ public class ZkStateReader implements SolrCloseable {
           Stat freshStats = null;
           try {
             freshStats = 
zkClient.exists(DocCollection.getCollectionPath(collName), null, true);
+            lastUpdateTime = System.nanoTime();
           } catch (Exception e) {
           }
           if (freshStats != null

Reply via email to