lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject lucene-solr:branch_6x: SOLR-9340: Change ZooKeeper disconnect and session expiry related logging from INFO to WARN to make debugging easier
Date Tue, 26 Jul 2016 18:37:56 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 7b6a16c30 -> 91ed36ddb


SOLR-9340: Change ZooKeeper disconnect and session expiry related logging from INFO to WARN
to make debugging easier


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/91ed36dd
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/91ed36dd
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/91ed36dd

Branch: refs/heads/branch_6x
Commit: 91ed36ddb477101fcb75b3aac7b48a0d35cd26aa
Parents: 7b6a16c
Author: Varun Thacker <varun@apache.org>
Authored: Tue Jul 26 23:41:39 2016 +0530
Committer: Varun Thacker <varun@apache.org>
Committed: Wed Jul 27 00:06:11 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                     |  3 +++
 .../apache/solr/common/cloud/ConnectionManager.java  | 15 +++++++++++----
 .../solr/common/cloud/DefaultConnectionStrategy.java |  4 ++--
 3 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/91ed36dd/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2200d06..9666795 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -169,6 +169,9 @@ Other Changes
 * SOLR-9163: Sync up basic_configs and data_driven_schema_configs, removing almost all differences
   except what is required for schemaless. (yonik)
 
+* SOLR-9340: Change ZooKeeper disconnect and session expiry related logging from INFO to
WARN to
+  make debugging easier (Varun Thacker)
+
 ==================  6.1.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/91ed36dd/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
index 1754a2d..c944dec 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
@@ -28,6 +28,10 @@ import org.apache.zookeeper.Watcher.Event.KeeperState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.zookeeper.Watcher.Event.KeeperState.AuthFailed;
+import static org.apache.zookeeper.Watcher.Event.KeeperState.Disconnected;
+import static org.apache.zookeeper.Watcher.Event.KeeperState.Expired;
+
 public class ConnectionManager implements Watcher {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
@@ -100,7 +104,10 @@ public class ConnectionManager implements Watcher {
 
   @Override
   public void process(WatchedEvent event) {
-    if (log.isInfoEnabled()) {
+    if (event.getState() == AuthFailed || event.getState() == Disconnected || event.getState()
== Expired) {
+      log.warn("Watcher " + this + " name:" + name + " got event " + event
+          + " path:" + event.getPath() + " type:" + event.getType());
+    } else if (log.isInfoEnabled()) {
       log.info("Watcher " + this + " name:" + name + " got event " + event
           + " path:" + event.getPath() + " type:" + event.getType());
     }
@@ -115,12 +122,12 @@ public class ConnectionManager implements Watcher {
     if (state == KeeperState.SyncConnected) {
       connected();
       connectionStrategy.connected();
-    } else if (state == KeeperState.Expired) {
+    } else if (state == Expired) {
       // we don't call disconnected here, because we know we are expired
       connected = false;
       likelyExpiredState = LikelyExpiredState.EXPIRED;
       
-      log.info("Our previous ZooKeeper session was expired. Attempting to reconnect to recover
relationship with ZooKeeper...");
+      log.warn("Our previous ZooKeeper session was expired. Attempting to reconnect to recover
relationship with ZooKeeper...");
       
       if (beforeReconnect != null) {
         try {
@@ -176,7 +183,7 @@ public class ConnectionManager implements Watcher {
       } while (!isClosed);
       log.info("Connected:" + connected);
     } else if (state == KeeperState.Disconnected) {
-      log.info("zkClient has disconnected");
+      log.warn("zkClient has disconnected");
       disconnected();
       connectionStrategy.disconnected();
     } else if (state == KeeperState.AuthFailed) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/91ed36dd/solr/solrj/src/java/org/apache/solr/common/cloud/DefaultConnectionStrategy.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DefaultConnectionStrategy.java
b/solr/solrj/src/java/org/apache/solr/common/cloud/DefaultConnectionStrategy.java
index cbec324..e16ca68 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/DefaultConnectionStrategy.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DefaultConnectionStrategy.java
@@ -49,7 +49,7 @@ public class DefaultConnectionStrategy extends ZkClientConnectionStrategy
{
   @Override
   public void reconnect(final String serverAddress, final int zkClientTimeout,
       final Watcher watcher, final ZkUpdate updater) throws IOException {
-    log.info("Connection expired - starting a new one...");
+    log.warn("Connection expired - starting a new one...");
     SolrZooKeeper zk = createSolrZooKeeper(serverAddress, zkClientTimeout, watcher);
     boolean success = false;
     try {
@@ -59,7 +59,7 @@ public class DefaultConnectionStrategy extends ZkClientConnectionStrategy
{
       log.info("Reconnected to ZooKeeper");
     } catch (Exception e) {
       SolrException.log(log, "Reconnect to ZooKeeper failed", e);
-      log.info("Reconnect to ZooKeeper failed");
+      log.warn("Reconnect to ZooKeeper failed");
     } finally {
       if (!success) {
         try {


Mime
View raw message