You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2021/03/11 17:01:43 UTC

[lucene-solr] branch reference_impl updated: @1452 Return null in getCollectionLive on zk error.

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

markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl by this push:
     new 6a76a0a  @1452 Return null in getCollectionLive on zk error.
6a76a0a is described below

commit 6a76a0a8c835d2af551e2316499dfead3d06bda5
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Mar 11 11:01:19 2021 -0600

    @1452 Return null in getCollectionLive on zk error.
    
    Took 10 minutes
---
 .../src/java/org/apache/solr/pkg/PackageAPI.java     |  2 +-
 .../org/apache/solr/common/cloud/ZkStateReader.java  | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/pkg/PackageAPI.java b/solr/core/src/java/org/apache/solr/pkg/PackageAPI.java
index fbc2588..617dffb 100644
--- a/solr/core/src/java/org/apache/solr/pkg/PackageAPI.java
+++ b/solr/core/src/java/org/apache/solr/pkg/PackageAPI.java
@@ -119,7 +119,7 @@ public class PackageAPI {
             } catch (KeeperException.ConnectionLossException | KeeperException.SessionExpiredException e) {
               log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK: [{}]", e.getMessage());
             } catch (KeeperException e) {
-              log.error("A ZK error has occurred", e);
+              log.error("A ZK error has occurred in registerListener for PackageAPI", e);
             } catch (InterruptedException e) {
               log.info("interrupted");
             }
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index 6284890..65448e4 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -611,7 +611,7 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
               }
 
             } catch (KeeperException e) {
-              log.error("A ZK error has occurred", e);
+              log.error("A ZK error has adding the security node watcher", e);
               return;
             } catch (InterruptedException e) {
               log.warn("", e);
@@ -1439,8 +1439,8 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
         }
         constructState(newState, "state.json watcher");
       } catch (Exception e) {
-        log.error("Unwatched collection: [{}]", coll, e);
-        throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
+        log.error("A ZK error has occurred refreshing CollectionStateWatcher for collection={}", coll, e);
+        throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "A ZK error has occurred refreshing CollectionStateWatcher", e);
       } finally {
         collectionStateLock.unlock();
       }
@@ -1652,7 +1652,7 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
         log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK: [{}]", e.getMessage());
       } catch (KeeperException e) {
         log.error("Lost collection property watcher for {} due to ZK error", coll, e);
-        throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
+        throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "A ZK error has occurred refreshing property watcher", e);
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
         log.error("Lost collection property watcher for {} due to the thread being interrupted", coll, e);
@@ -1695,8 +1695,8 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
       } catch (AlreadyClosedException e) {
 
       } catch (KeeperException e) {
-        log.error("A ZK error has occurred", e);
-        throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
+        log.error("A ZK error has occurred refreshing CollectionsChildWatcher", e);
+        throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "A ZK error has occurred refreshing CollectionsChildWatcher", e);
       } catch (InterruptedException e) {
         // Restore the interrupted status
         Thread.currentThread().interrupt();
@@ -1758,7 +1758,7 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
       } catch (KeeperException.SessionExpiredException e) {
         // okay
       } catch (Exception e) {
-        log.error("A ZK error has occurred", e);
+        log.error("A ZK error has occurred refreshing CollectionsChildWatcher", e);
       }
     }
 
@@ -1798,8 +1798,8 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
     try {
       newState = fetchCollectionState(coll);
     } catch (KeeperException e) {
-      log.error("Unwatched collection: [{}]", coll, e);
-      throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
+      log.warn("Zookeeper error getting latest collection state for collection={}", coll, e);
+      return null;
     } catch (InterruptedException e) {
       log.error("Unwatched collection: [{}]", coll, e);
       throw new SolrException(ErrorCode.SERVER_ERROR, "interrupted", e);
@@ -2705,7 +2705,7 @@ public class ZkStateReader implements SolrCloseable, Replica.NodeNameToBaseUrl {
         // note: aliases.json is required to be present
         log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK: [{}]", e.getMessage());
       } catch (KeeperException e) {
-        log.error("A ZK error has occurred", e);
+        log.error("A ZK error has occurred on Alias update", e);
         throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
       } catch (InterruptedException e) {
         // Restore the interrupted status