You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2016/06/24 18:52:09 UTC

hbase git commit: HBASE-16103 Procedure v2 - TestCloneSnapshotProcedure relies on execution order

Repository: hbase
Updated Branches:
  refs/heads/master 96c4054e3 -> e8599a292


HBASE-16103 Procedure v2 - TestCloneSnapshotProcedure relies on execution order


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

Branch: refs/heads/master
Commit: e8599a29213652cf5a3b88b72a506755de82b6f4
Parents: 96c4054
Author: Matteo Bertozzi <ma...@cloudera.com>
Authored: Fri Jun 24 09:09:59 2016 -0700
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Fri Jun 24 09:09:59 2016 -0700

----------------------------------------------------------------------
 .../procedure/TestCloneSnapshotProcedure.java   | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e8599a29/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java
index 96f78f7..090a00b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java
@@ -142,8 +142,11 @@ public class TestCloneSnapshotProcedure {
     final TableName clonedTableName = TableName.valueOf("testCloneSnapshot2");
     final HTableDescriptor htd = createHTableDescriptor(clonedTableName, CF);
 
+    // take the snapshot
+    HBaseProtos.SnapshotDescription snapshotDesc = getSnapshot();
+
     long procId = ProcedureTestingUtility.submitAndWait(
-      procExec, new CloneSnapshotProcedure(procExec.getEnvironment(), htd, getSnapshot()));
+      procExec, new CloneSnapshotProcedure(procExec.getEnvironment(), htd, snapshotDesc));
     ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId));
     MasterProcedureTestingUtility.validateTableIsEnabled(
       UTIL.getHBaseCluster().getMaster(),
@@ -156,10 +159,13 @@ public class TestCloneSnapshotProcedure {
     final TableName clonedTableName = TableName.valueOf("testCloneSnapshotTwiceWithSameNonce");
     final HTableDescriptor htd = createHTableDescriptor(clonedTableName, CF);
 
+    // take the snapshot
+    HBaseProtos.SnapshotDescription snapshotDesc = getSnapshot();
+
     long procId1 = procExec.submitProcedure(
-      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, getSnapshot()), nonceGroup, nonce);
+      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, snapshotDesc), nonceGroup, nonce);
     long procId2 = procExec.submitProcedure(
-      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, getSnapshot()), nonceGroup, nonce);
+      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, snapshotDesc), nonceGroup, nonce);
 
     // Wait the completion
     ProcedureTestingUtility.waitProcedure(procExec, procId1);
@@ -172,12 +178,15 @@ public class TestCloneSnapshotProcedure {
 
   @Test(timeout=60000)
   public void testCloneSnapshotToSameTable() throws Exception {
+    // take the snapshot
+    HBaseProtos.SnapshotDescription snapshotDesc = getSnapshot();
+
     final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor();
-    final TableName clonedTableName = TableName.valueOf(getSnapshot().getTable());
+    final TableName clonedTableName = TableName.valueOf(snapshotDesc.getTable());
     final HTableDescriptor htd = createHTableDescriptor(clonedTableName, CF);
 
     long procId = ProcedureTestingUtility.submitAndWait(
-      procExec, new CloneSnapshotProcedure(procExec.getEnvironment(), htd, getSnapshot()));
+      procExec, new CloneSnapshotProcedure(procExec.getEnvironment(), htd, snapshotDesc));
     ProcedureInfo result = procExec.getResult(procId);
     assertTrue(result.isFailed());
     LOG.debug("Clone snapshot failed with exception: " + result.getExceptionFullMessage());
@@ -191,11 +200,14 @@ public class TestCloneSnapshotProcedure {
     final TableName clonedTableName = TableName.valueOf("testRecoveryAndDoubleExecution");
     final HTableDescriptor htd = createHTableDescriptor(clonedTableName, CF);
 
+    // take the snapshot
+    HBaseProtos.SnapshotDescription snapshotDesc = getSnapshot();
+
     ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true);
 
     // Start the Clone snapshot procedure && kill the executor
     long procId = procExec.submitProcedure(
-      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, getSnapshot()), nonceGroup, nonce);
+      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, snapshotDesc), nonceGroup, nonce);
 
     // Restart the executor and execute the step twice
     int numberOfSteps = CloneSnapshotState.values().length;
@@ -216,12 +228,15 @@ public class TestCloneSnapshotProcedure {
     final TableName clonedTableName = TableName.valueOf("testRollbackAndDoubleExecution");
     final HTableDescriptor htd = createHTableDescriptor(clonedTableName, CF);
 
+    // take the snapshot
+    HBaseProtos.SnapshotDescription snapshotDesc = getSnapshot();
+
     ProcedureTestingUtility.waitNoProcedureRunning(procExec);
     ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true);
 
     // Start the Clone snapshot procedure && kill the executor
     long procId = procExec.submitProcedure(
-      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, getSnapshot()), nonceGroup, nonce);
+      new CloneSnapshotProcedure(procExec.getEnvironment(), htd, snapshotDesc), nonceGroup, nonce);
 
     int numberOfSteps = CloneSnapshotState.values().length - 2; // failing in the middle of proc
     MasterProcedureTestingUtility.testRollbackAndDoubleExecution(