You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/07/12 01:50:55 UTC
svn commit: r1502398 -
/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Author: stack
Date: Thu Jul 11 23:50:54 2013
New Revision: 1502398
URL: http://svn.apache.org/r1502398
Log:
HBASE-8933 TestSplitTransactionOnCluster fails because "Region not moved off .META. server"
Modified:
hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1502398&r1=1502397&r2=1502398&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java Thu Jul 11 23:50:54 2013
@@ -129,7 +129,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)
@@ -226,7 +247,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);