hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject hbase git commit: HBASE-16528 Procedure-V2: ServerCrashProcedure misses owner information (Stephen Yuan Jiang)
Date Wed, 31 Aug 2016 16:26:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 45af3831f -> 605af9513


HBASE-16528 Procedure-V2: ServerCrashProcedure misses owner information (Stephen Yuan Jiang)


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

Branch: refs/heads/master
Commit: 605af95132bdafd581112775d1603d8262ede06d
Parents: 45af383
Author: Stephen Yuan Jiang <syuanjiangdev@gmail.com>
Authored: Wed Aug 31 09:25:51 2016 -0700
Committer: Stephen Yuan Jiang <syuanjiangdev@gmail.com>
Committed: Wed Aug 31 09:25:51 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/ServerManager.java   | 12 ++++++++----
 .../hbase/master/procedure/ServerCrashProcedure.java    |  9 ++++++---
 .../org/apache/hadoop/hbase/master/TestDeadServer.java  |  6 ++++--
 .../master/procedure/TestMasterProcedureEvents.java     |  2 +-
 .../master/procedure/TestServerCrashProcedure.java      |  3 ++-
 5 files changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/605af951/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
index d7ba4f3..5d8cb2a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
@@ -52,8 +52,10 @@ import org.apache.hadoop.hbase.client.RetriesExhaustedException;
 import org.apache.hadoop.hbase.ipc.PayloadCarryingRpcController;
 import org.apache.hadoop.hbase.ipc.RpcControllerFactory;
 import org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer;
+import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
 import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
+import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.RequestConverter;
 import org.apache.hadoop.hbase.protobuf.ResponseConverter;
@@ -620,8 +622,9 @@ public class ServerManager {
     }
 
     boolean carryingMeta = master.getAssignmentManager().isCarryingMeta(serverName);
-    this.master.getMasterProcedureExecutor().
-      submitProcedure(new ServerCrashProcedure(serverName, true, carryingMeta));
+    ProcedureExecutor<MasterProcedureEnv> procExec = this.master.getMasterProcedureExecutor();
+    procExec.submitProcedure(new ServerCrashProcedure(
+      procExec.getEnvironment(), serverName, true, carryingMeta));
     LOG.debug("Added=" + serverName +
       " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);
 
@@ -664,8 +667,9 @@ public class ServerManager {
     }
 
     this.deadservers.add(serverName);
-    this.master.getMasterProcedureExecutor().
-    submitProcedure(new ServerCrashProcedure(serverName, shouldSplitWal, false));
+    ProcedureExecutor<MasterProcedureEnv> procExec = this.master.getMasterProcedureExecutor();
+    procExec.submitProcedure(new ServerCrashProcedure(
+      procExec.getEnvironment(), serverName, shouldSplitWal, false));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/605af951/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 0c38be7..d913e73 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
@@ -145,12 +145,15 @@ implements ServerProcedureInterface {
    * @param shouldSplitWal True if we should split WALs as part of crashed server processing.
    * @param carryingMeta True if carrying hbase:meta table region.
    */
-  public ServerCrashProcedure(final ServerName serverName,
-      final boolean shouldSplitWal, final boolean carryingMeta) {
+  public ServerCrashProcedure(
+      final MasterProcedureEnv env,
+      final ServerName serverName,
+      final boolean shouldSplitWal,
+      final boolean carryingMeta) {
     this.serverName = serverName;
     this.shouldSplitWal = shouldSplitWal;
     this.carryingMeta = carryingMeta;
-    // Currently not used.
+    this.setOwner(env.getRequestUser().getShortName());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/605af951/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java
index 596612e..fd18b6c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java
@@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.master;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
 import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure;
 import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
 import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
@@ -99,8 +100,9 @@ public class TestDeadServer {
   @Test(timeout = 15000)
   public void testCrashProcedureReplay() {
     HMaster master = TEST_UTIL.getHBaseCluster().getMaster();
-    ProcedureExecutor pExecutor = master.getMasterProcedureExecutor();
-    ServerCrashProcedure proc = new ServerCrashProcedure(hostname123, false, false);
+    final ProcedureExecutor<MasterProcedureEnv> pExecutor = master.getMasterProcedureExecutor();
+    ServerCrashProcedure proc = new ServerCrashProcedure(
+      pExecutor.getEnvironment(), hostname123, false, false);
 
     ProcedureTestingUtility.submitAndWait(pExecutor, proc);
     

http://git-wip-us.apache.org/repos/asf/hbase/blob/605af951/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
index f684c49..d6b15d9 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java
@@ -145,7 +145,7 @@ public class TestMasterProcedureEvents {
     master.getServerManager().moveFromOnelineToDeadServers(hrs.getServerName());
 
     long procId = procExec.submitProcedure(
-      new ServerCrashProcedure(hrs.getServerName(), true, carryingMeta));
+      new ServerCrashProcedure(procExec.getEnvironment(), hrs.getServerName(), true, carryingMeta));
 
     for (int i = 0; i < 10; ++i) {
       Thread.sleep(100);

http://git-wip-us.apache.org/repos/asf/hbase/blob/605af951/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerCrashProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerCrashProcedure.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerCrashProcedure.java
index 510b017..8717c65 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerCrashProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerCrashProcedure.java
@@ -118,7 +118,8 @@ public class TestServerCrashProcedure {
       ProcedureTestingUtility.waitNoProcedureRunning(procExec);
       ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true);
       long procId =
-        procExec.submitProcedure(new ServerCrashProcedure(hrs.getServerName(), true, carryingMeta));
+        procExec.submitProcedure(new ServerCrashProcedure(
+          procExec.getEnvironment(), hrs.getServerName(), true, carryingMeta));
       // Now run through the procedure twice crashing the executor on each step...
       MasterProcedureTestingUtility.testRecoveryAndDoubleExecution(procExec, procId);
       // Assert all data came back.


Mime
View raw message