hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r978802 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Sat, 24 Jul 2010 05:18:38 GMT
Author: stack
Date: Sat Jul 24 05:18:38 2010
New Revision: 978802

URL: http://svn.apache.org/viewvc?rev=978802&view=rev
Log:
HBASE-2849 HBase clients cannot recover when their ZooKeeper session becomes invalid

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=978802&r1=978801&r2=978802&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sat Jul 24 05:18:38 2010
@@ -450,6 +450,8 @@ Release 0.21.0 - Unreleased
    HBASE-2858  TestReplication.queueFailover fails half the time
    HBASE-2863  HBASE-2553 removed an important edge case
    HBASE-2866  Region permanently offlined
+   HBASE-2849  HBase clients cannot recover when their ZooKeeper session
+               becomes invalid (Benôit Sigoure via Stack)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=978802&r1=978801&r2=978802&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Sat Jul
24 05:18:38 2010
@@ -211,13 +211,10 @@ public class HConnectionManager {
      *
      * @param event WatchedEvent witnessed by ZooKeeper.
      */
-    public void process(WatchedEvent event) {
-      KeeperState state = event.getState();
-      if(!state.equals(KeeperState.SyncConnected)) {
-        LOG.debug("Got ZooKeeper event, state: " + state + ", type: "
-            + event.getType() + ", path: " + event.getPath());
-      }
-      if (state == KeeperState.Expired) {
+    public void process(final WatchedEvent event) {
+      final KeeperState state = event.getState();
+      if (!state.equals(KeeperState.SyncConnected)) {
+        LOG.warn("No longer connected to ZooKeeper, current state: " + state);
         resetZooKeeper();
       }
     }
@@ -228,7 +225,7 @@ public class HConnectionManager {
      * @throws java.io.IOException if a remote or network exception occurs
      */
     public synchronized ZooKeeperWrapper getZooKeeperWrapper() throws IOException {
-      if(zooKeeperWrapper == null) {
+      if (zooKeeperWrapper == null) {
         zooKeeperWrapper =
             ZooKeeperWrapper.createInstance(conf, HConnectionManager.class.getName());
         zooKeeperWrapper.registerListener(this);



Mime
View raw message