You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ed...@apache.org on 2019/04/18 18:27:47 UTC

[accumulo] branch 1.9 updated: Improve logging for session expired events. (#1108)

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

edcoleman pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.9 by this push:
     new 9a5f33f  Improve logging for session expired events. (#1108)
9a5f33f is described below

commit 9a5f33faf4c3cf586d0b8e58aaa5c9fe28b225be
Author: EdColeman <de...@etcoleman.com>
AuthorDate: Thu Apr 18 14:27:42 2019 -0400

    Improve logging for session expired events. (#1108)
    
    When a tserver looses lock, the Session expired message is log for every watcher.
      - reduce current message to trace.
      - add summary logging messages that give number of sessions expired
---
 .../java/org/apache/accumulo/core/conf/ObservableConfiguration.java | 6 ++++++
 .../java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java  | 1 +
 .../main/java/org/apache/accumulo/server/conf/TableConfWatcher.java | 1 +
 .../src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java    | 3 ++-
 .../java/org/apache/accumulo/test/functional/FateConcurrencyIT.java | 4 ++--
 5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/conf/ObservableConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/ObservableConfiguration.java
index 7911513..f93d498 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ObservableConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ObservableConfiguration.java
@@ -22,11 +22,16 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Set;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * A configuration that can be observed. Handling of observers is thread-safe.
  */
 public abstract class ObservableConfiguration extends AccumuloConfiguration {
 
+  private static final Logger log = LoggerFactory.getLogger(ObservableConfiguration.class);
+
   private Set<ConfigurationObserver> observers;
 
   /**
@@ -83,6 +88,7 @@ public abstract class ObservableConfiguration extends AccumuloConfiguration {
    */
   public void expireAllObservers() {
     Collection<ConfigurationObserver> copy = snapshot(observers);
+    log.info("Expiring {} observers", copy.size());
     for (ConfigurationObserver co : copy)
       co.sessionExpired();
   }
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java
index 5e8e880..e4bfdde 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java
@@ -94,6 +94,7 @@ class NamespaceConfWatcher implements Watcher {
       case None:
         switch (event.getState()) {
           case Expired:
+            log.info("Zookeeper node event type None, state=expired. Expire all table observers");
             ServerConfigurationFactory.expireAllTableObservers();
             break;
           case SyncConnected:
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
index fbfea3f..6094aa1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
@@ -94,6 +94,7 @@ class TableConfWatcher implements Watcher {
       case None:
         switch (event.getState()) {
           case Expired:
+            log.info("Zookeeper node event type None, state=expired. Expire all table observers");
             ServerConfigurationFactory.expireAllTableObservers();
             break;
           case SyncConnected:
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 6cf56f8..55892fb 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -166,6 +166,7 @@ import com.google.common.collect.ImmutableSet.Builder;
  *
  */
 public class Tablet implements TabletCommitter {
+
   static private final Logger log = Logger.getLogger(Tablet.class);
 
   private final TabletServer tabletServer;
@@ -406,7 +407,7 @@ public class Tablet implements TabletCommitter {
 
       @Override
       public void sessionExpired() {
-        log.debug("Session expired, no longer updating per table props...");
+        log.trace("Session expired, no longer updating per table props...");
       }
 
     });
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java b/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java
index 2b5ae8c..02a83a5 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java
@@ -314,8 +314,8 @@ public class FateConcurrencyIT extends AccumuloClusterHarness {
   /**
    * This method was helpful for debugging a condition that was causing transient test failures.
    * This forces a condition that the test should be able to handle. This method is not needed
-   * during normal testing, it was kept to aid future test development / troubleshooting if
-   * other transient failures occur.
+   * during normal testing, it was kept to aid future test development / troubleshooting if other
+   * transient failures occur.
    */
   private void runMultipleCompactions() {