You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by je...@apache.org on 2013/07/18 01:32:45 UTC
svn commit: r1504322 -
/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
Author: jeffreyz
Date: Wed Jul 17 23:32:45 2013
New Revision: 1504322
URL: http://svn.apache.org/r1504322
Log:
HBASE-8960: TestDistributedLogSplitting.testLogReplayForDisablingTable fails sometimes
Modified:
hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java?rev=1504322&r1=1504321&r2=1504322&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java (original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java Wed Jul 17 23:32:45 2013
@@ -700,18 +700,23 @@ public class TestDistributedLogSplitting
startCluster(NUM_RS, curConf);
final int NUM_REGIONS_TO_CREATE = 40;
final int NUM_LOG_LINES = 1000;
- // turn off load balancing to prevent regions from moving around otherwise
- // they will consume recovered.edits
- master.balanceSwitch(false);
List<RegionServerThread> rsts = cluster.getLiveRegionServerThreads();
final ZooKeeperWatcher zkw = new ZooKeeperWatcher(conf, "table-creation", null);
HTable disablingHT = installTable(zkw, "disableTable", "family", NUM_REGIONS_TO_CREATE);
HTable ht = installTable(zkw, "table", "family", NUM_REGIONS_TO_CREATE, NUM_REGIONS_TO_CREATE);
+ // turn off load balancing to prevent regions from moving around otherwise
+ // they will consume recovered.edits
+ master.balanceSwitch(false);
+
List<HRegionInfo> regions = null;
HRegionServer hrs = null;
+ boolean hasRegionsForBothTables = false;
+ String tableName = null;
for (int i = 0; i < NUM_RS; i++) {
+ tableName = null;
+ hasRegionsForBothTables = false;
boolean isCarryingMeta = false;
hrs = rsts.get(i).getRegionServer();
regions = ProtobufUtil.getOnlineRegions(hrs);
@@ -720,13 +725,25 @@ public class TestDistributedLogSplitting
isCarryingMeta = true;
break;
}
+ if (tableName != null && !tableName.equalsIgnoreCase(region.getTableNameAsString())) {
+ // make sure that we find a RS has online regions for both "table" and "disableTable"
+ hasRegionsForBothTables = true;
+ break;
+ } else if (tableName == null) {
+ tableName = region.getTableNameAsString();
+ }
}
if (isCarryingMeta) {
continue;
}
- break;
+ if (hasRegionsForBothTables) {
+ break;
+ }
}
+ // make sure we found a good RS
+ Assert.assertTrue(hasRegionsForBothTables);
+
LOG.info("#regions = " + regions.size());
Iterator<HRegionInfo> it = regions.iterator();
while (it.hasNext()) {