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

dsmiley 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 4cfcb329726 Logging: ZkStateReader.getLeaderRetry to TRACE (#4696)
4cfcb329726 is described below

commit 4cfcb329726493a28b90c12bcefad5ec515bfa2e
Author: David Smiley <[email protected]>
AuthorDate: Sun Aug 23 12:12:25 2026 -0400

    Logging: ZkStateReader.getLeaderRetry to TRACE (#4696)
    
    But add new DEBUG logs to waitForState code-paths that must actually wait.
---
 .../src/java/org/apache/solr/common/cloud/ZkStateReader.java     | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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 0f9095a3737..81ddf93b26c 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
@@ -849,6 +849,7 @@ public class ZkStateReader implements SolrCloseable {
   }
 
   public void registerClusterPropertiesListener(ClusterPropertiesListener 
listener) {
+    log.debug("registerClusterPropertiesListener");
     // fire it once with current properties
     if (listener.onChange(getClusterProperties())) {
       removeClusterPropertiesListener(listener);
@@ -862,6 +863,7 @@ public class ZkStateReader implements SolrCloseable {
   }
 
   public void registerLiveNodesListener(LiveNodesListener listener) {
+    log.debug("registerLiveNodesListener");
     // fire it once with current live nodes
     if (listener.onChange(
         new TreeSet<>(getClusterState().getLiveNodes()),
@@ -1003,7 +1005,7 @@ public class ZkStateReader implements SolrCloseable {
             if (c == null) return false;
             Replica l = getLeader(n, c, shard);
             if (l != null) {
-              log.debug("leader found for {}/{} to be {}", collection, shard, 
l);
+              log.trace("leader found for {}/{} to be {}", collection, shard, 
l);
               leader.set(l);
               return true;
             }
@@ -1598,6 +1600,7 @@ public class ZkStateReader implements SolrCloseable {
    */
   public void registerDocCollectionWatcher(
       String collection, DocCollectionWatcher docCollectionWatcher) {
+    log.debug("registerDocCollectionWatcher collection={}", collection);
     AtomicReference<StateWatcher> newWatcherRef = new AtomicReference<>();
     collectionWatches.compute(
         collection,
@@ -1654,7 +1657,7 @@ public class ZkStateReader implements SolrCloseable {
       DocCollection docCollection = 
clusterState.getCollectionOrNull(collection);
       if (liveNodes != null && docCollection != null) {
         if (predicate.matches(liveNodes, docCollection)) {
-          log.debug("Found {} directly in clusterState", predicate);
+          log.trace("waitForState collection={}: cache hit in clusterState", 
collection);
           return;
         }
       }
@@ -1736,7 +1739,7 @@ public class ZkStateReader implements SolrCloseable {
       DocCollection docCollection = 
clusterState.getCollectionOrNull(collection);
       if (docCollection != null) {
         if (predicate.test(docCollection)) {
-          log.debug("Found {} directly in clusterState", predicate);
+          log.trace("waitForState collection={}: cache hit in clusterState", 
collection);
           return docCollection;
         }
       }

Reply via email to