hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerry...@apache.org
Subject hbase git commit: HBASE-15591 ServerCrashProcedure not yielding
Date Mon, 11 Apr 2016 00:14:17 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 db3b46eb7 -> 19d110051


HBASE-15591 ServerCrashProcedure not yielding


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

Branch: refs/heads/branch-1.2
Commit: 19d110051692c7e3cb187d08afdffc12ed621bd0
Parents: db3b46e
Author: Jerry He <jerryjch@apache.org>
Authored: Sun Apr 10 17:02:39 2016 -0700
Committer: Jerry He <jerryjch@apache.org>
Committed: Sun Apr 10 17:10:40 2016 -0700

----------------------------------------------------------------------
 .../master/procedure/ServerCrashProcedure.java     | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/19d11005/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
index 0e35ddb..90addb2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
@@ -173,7 +173,7 @@ implements ServerProcedureInterface {
 
   @Override
   protected Flow executeFromState(MasterProcedureEnv env, ServerCrashState state)
-  throws ProcedureYieldException {
+      throws ProcedureYieldException {
     if (LOG.isTraceEnabled()) {
       LOG.trace(state);
     }
@@ -209,10 +209,17 @@ implements ServerProcedureInterface {
       case SERVER_CRASH_GET_REGIONS:
         // If hbase:meta is not assigned, yield.
         if (!isMetaAssignedQuickTest(env)) {
+          // isMetaAssignedQuickTest does not really wait. Let's delay a little before
+          // another round of execution.
+          long wait =
+              env.getMasterConfiguration().getLong(KEY_SHORT_WAIT_ON_META,
+                DEFAULT_SHORT_WAIT_ON_META);
+          wait = wait / 10;
+          Thread.sleep(wait);
           throwProcedureYieldException("Waiting on hbase:meta assignment");
         }
         this.regionsOnCrashedServer =
-          services.getAssignmentManager().getRegionStates().getServerRegions(this.serverName);
+            services.getAssignmentManager().getRegionStates().getServerRegions(this.serverName);
         // Where to go next? Depends on whether we should split logs at all or if we should
do
         // distributed log splitting (DLS) vs distributed log replay (DLR).
         if (!this.shouldSplitWal) {
@@ -292,8 +299,12 @@ implements ServerProcedureInterface {
         return Flow.NO_MORE_STATE;
 
       default:
-          throw new UnsupportedOperationException("unhandled state=" + state);
+        throw new UnsupportedOperationException("unhandled state=" + state);
       }
+    } catch (ProcedureYieldException e) {
+      LOG.warn("Failed serverName=" + this.serverName + ", state=" + state + "; retry "
+          + e.getMessage());
+      throw e;
     } catch (IOException e) {
       LOG.warn("Failed serverName=" + this.serverName + ", state=" + state + "; retry", e);
     } catch (InterruptedException e) {


Mime
View raw message