hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject git commit: HBASE-11687 No need to abort on postOpenDeployTasks exception if region opening is cancelled
Date Thu, 14 Aug 2014 16:21:44 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 4bd2da478 -> ce6c20407


HBASE-11687 No need to abort on postOpenDeployTasks exception if region opening is cancelled


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

Branch: refs/heads/branch-1
Commit: ce6c2040786580f448f730313119b8feaffbd8bc
Parents: 4bd2da4
Author: Jimmy Xiang <jxiang@cloudera.com>
Authored: Tue Aug 12 15:49:03 2014 -0700
Committer: Jimmy Xiang <jxiang@cloudera.com>
Committed: Thu Aug 14 09:20:46 2014 -0700

----------------------------------------------------------------------
 .../regionserver/handler/OpenRegionHandler.java | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ce6c2040/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
index ef30f08..bb33645 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
@@ -319,13 +319,16 @@ public class OpenRegionHandler extends EventHandler {
     public void run() {
       try {
         this.services.postOpenDeployTasks(this.region);
-      } catch (IOException e) {
-        server.abort("Exception running postOpenDeployTasks; region=" +
-            this.region.getRegionInfo().getEncodedName(), e);
       } catch (Throwable e) {
-        LOG.warn("Exception running postOpenDeployTasks; region=" +
-          this.region.getRegionInfo().getEncodedName(), e);
+        String msg = "Exception running postOpenDeployTasks; region=" +
+          this.region.getRegionInfo().getEncodedName();
         this.exception = e;
+        if (e instanceof IOException
+            && isRegionStillOpening(region.getRegionInfo(), services)) {
+          server.abort(msg, e);
+        } else {
+          LOG.warn(msg, e);
+        }
       }
       // We're done.  Set flag then wake up anyone waiting on thread to complete.
       this.signaller.set(true);
@@ -394,9 +397,14 @@ public class OpenRegionHandler extends EventHandler {
     }
   }
 
-  private boolean isRegionStillOpening() {
+  private static boolean isRegionStillOpening(
+      HRegionInfo regionInfo, RegionServerServices rsServices) {
     byte[] encodedName = regionInfo.getEncodedNameAsBytes();
     Boolean action = rsServices.getRegionsInTransitionInRS().get(encodedName);
     return Boolean.TRUE.equals(action); // true means opening for RIT
   }
+
+  private boolean isRegionStillOpening() {
+    return isRegionStillOpening(regionInfo, rsServices);
+  }
 }


Mime
View raw message