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

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


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

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

    SOLR-17893: Use caching to remove Remote Proxy bottleneck (#3614)
---
 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 27dbf74f6ce..0f5c32f3ffb 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -237,6 +237,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 b9f3842b820..c0b78fc1a9f 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -327,7 +327,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) {
@@ -930,7 +930,7 @@ public class HttpSolrCall {
 
   protected String getRemoteCoreUrl(String collectionName) throws 
SolrException {
     ClusterState clusterState = cores.getZkController().getClusterState();
-    final DocCollection docCollection = 
clusterState.getCollectionOrNull(collectionName);
+    final DocCollection docCollection = 
clusterState.getCollectionOrNull(collectionName, true);
     if (docCollection == null) {
       return null;
     }
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 41fa9139a8f..36fd30e9b6e 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
@@ -764,6 +764,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