hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1502397 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Date Thu, 11 Jul 2013 23:42:48 GMT
Author: stack
Date: Thu Jul 11 23:42:48 2013
New Revision: 1502397

URL: http://svn.apache.org/r1502397
Log:
HBASE-8933 TestSplitTransactionOnCluster fails because "Region not moved off .META. server"

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1502397&r1=1502396&r2=1502397&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Thu Jul 11 23:42:48 2013
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
@@ -134,7 +133,28 @@ public class TestSplitTransactionOnClust
 
   private HRegionInfo getAndCheckSingleTableRegion(final List<HRegion> regions) {
     assertEquals(1, regions.size());
-    return regions.get(0).getRegionInfo();
+    HRegionInfo hri = regions.get(0).getRegionInfo();
+    return waitOnRIT(hri);
+  }
+
+  /**
+   * Often region has not yet fully opened.  If we try to use it -- do a move for instance
-- it
+   * will fail silently if the region is not yet opened.
+   * @param hri Region to check if in Regions In Transition... wait until out of transition
before
+   * returning
+   * @return Passed in <code>hri</code>
+   */
+  private HRegionInfo waitOnRIT(final HRegionInfo hri) {
+    // Close worked but we are going to open the region elsewhere.  Before going on, make
sure
+    // this completes.
+    while (TESTING_UTIL.getHBaseCluster().getMaster().getAssignmentManager().
+        getRegionStates().isRegionInTransition(hri)) {
+      LOG.info("Waiting on region in transition: " +
+        TESTING_UTIL.getHBaseCluster().getMaster().getAssignmentManager().getRegionStates().
+          getRegionTransitionState(hri));
+      Threads.sleep(10);
+    }
+    return hri;
   }
 
   @Test(timeout = 60000)
@@ -231,7 +251,7 @@ public class TestSplitTransactionOnClust
   throws IOException, InterruptedException, NodeExistsException, KeeperException,
       DeserializationException, ServiceException {
     final byte [] tableName =
-      Bytes.toBytes("ephemeral");
+      Bytes.toBytes("testRSSplitEphemeralsDisappearButDaughtersAreOnlinedAfterShutdownHandling");
 
     // Create table then get the single region for our new table.
     HTable t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);



Mime
View raw message