hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [8/9] git commit: HBASE-11594 Unhandled NoNodeException in distributed log replay mode (Jeffrey Zhong)
Date Fri, 01 Aug 2014 16:39:53 GMT
HBASE-11594 Unhandled NoNodeException in distributed log replay mode (Jeffrey Zhong)

Amending-Author: Andrew Purtell <apurtell@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8255a9d8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8255a9d8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8255a9d8

Branch: refs/heads/0.98
Commit: 8255a9d87023f33728ad3bc473a38ac81eb5103a
Parents: 1d56636
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Aug 1 09:37:59 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Aug 1 09:37:59 2014 -0700

----------------------------------------------------------------------
 .../hbase/regionserver/HRegionServer.java       | 47 +++++++++++---------
 1 file changed, 27 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8255a9d8/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index e574200..f681a72 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -235,6 +235,7 @@ import org.apache.hadoop.net.DNS;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.apache.zookeeper.data.Stat;
 import org.cliffc.high_scale_lib.Counter;
 
@@ -4592,26 +4593,32 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
         minSeqIdForLogReplay = storeSeqIdForReplay;
       }
     }
-    long lastRecordedFlushedSequenceId = -1;
-    String nodePath = ZKUtil.joinZNode(this.zooKeeper.recoveringRegionsZNode,
-      region.getEncodedName());
-    // recovering-region level
-    byte[] data = ZKUtil.getData(zkw, nodePath);
-    if (data != null) {
-      lastRecordedFlushedSequenceId = SplitLogManager.parseLastFlushedSequenceIdFrom(data);
-    }
-    if (data == null || lastRecordedFlushedSequenceId < minSeqIdForLogReplay) {
-      ZKUtil.setData(zkw, nodePath, ZKUtil.positionToByteArray(minSeqIdForLogReplay));
-    }
-    if (previousRSName != null) {
-      // one level deeper for the failed RS
-      nodePath = ZKUtil.joinZNode(nodePath, previousRSName);
-      ZKUtil.setData(zkw, nodePath,
-        ZKUtil.regionSequenceIdsToByteArray(minSeqIdForLogReplay, maxSeqIdInStores));
-      LOG.debug("Update last flushed sequence id of region " + region.getEncodedName() +
" for "
-          + previousRSName);
-    } else {
-      LOG.warn("Can't find failed region server for recovering region " + region.getEncodedName());
+    
+    try {
+      long lastRecordedFlushedSequenceId = -1;
+      String nodePath = ZKUtil.joinZNode(this.zooKeeper.recoveringRegionsZNode,
+        region.getEncodedName());
+      // recovering-region level
+      byte[] data = ZKUtil.getData(zkw, nodePath);
+      if (data != null) {
+        lastRecordedFlushedSequenceId = SplitLogManager.parseLastFlushedSequenceIdFrom(data);
+      }
+      if (data == null || lastRecordedFlushedSequenceId < minSeqIdForLogReplay) {
+        ZKUtil.setData(zkw, nodePath, ZKUtil.positionToByteArray(minSeqIdForLogReplay));
+      }
+      if (previousRSName != null) {
+        // one level deeper for the failed RS
+        nodePath = ZKUtil.joinZNode(nodePath, previousRSName);
+        ZKUtil.setData(zkw, nodePath,
+          ZKUtil.regionSequenceIdsToByteArray(minSeqIdForLogReplay, maxSeqIdInStores));
+        LOG.debug("Update last flushed sequence id of region " + region.getEncodedName()
+ " for "
+            + previousRSName);
+      } else {
+        LOG.warn("Can't find failed region server for recovering region " + region.getEncodedName());
+      }
+    } catch (NoNodeException ignore) {
+      LOG.debug("Region " + region.getEncodedName() + 
+        " must have completed recovery because its recovery znode has been removed", ignore);
     }
   }
 


Mime
View raw message