HBASE-4492 TestRollingRestart Fails Intermittently(Ted yu and Ram)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1177175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f3cda40473
commit
aaa8c0e38e
|
@ -1461,6 +1461,7 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
LOG.error(errorMsg, t);
|
LOG.error(errorMsg, t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
LOG.warn("Failed assignment of " +
|
LOG.warn("Failed assignment of " +
|
||||||
state.getRegion().getRegionNameAsString() + " to " +
|
state.getRegion().getRegionNameAsString() + " to " +
|
||||||
plan.getDestination() + ", trying to assign elsewhere instead; " +
|
plan.getDestination() + ", trying to assign elsewhere instead; " +
|
||||||
|
@ -1477,7 +1478,6 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void debugLog(HRegionInfo region, String string) {
|
private void debugLog(HRegionInfo region, String string) {
|
||||||
|
|
|
@ -210,7 +210,11 @@ public class TestRollingRestart {
|
||||||
waitForRSShutdownToStartAndFinish(activeMaster,
|
waitForRSShutdownToStartAndFinish(activeMaster,
|
||||||
metaServer.getRegionServer().getServerName());
|
metaServer.getRegionServer().getServerName());
|
||||||
log("Waiting for no more RIT");
|
log("Waiting for no more RIT");
|
||||||
blockUntilNoRIT(zkw, master);
|
long start = System.currentTimeMillis();
|
||||||
|
do {
|
||||||
|
blockUntilNoRIT(zkw, master);
|
||||||
|
} while (getNumberOfOnlineRegions(cluster) < numRegions
|
||||||
|
&& System.currentTimeMillis()-start < 60000);
|
||||||
log("Verifying there are " + numRegions + " assigned on cluster");
|
log("Verifying there are " + numRegions + " assigned on cluster");
|
||||||
assertRegionsAssigned(cluster, regions);
|
assertRegionsAssigned(cluster, regions);
|
||||||
assertEquals(expectedNumRS, cluster.getRegionServerThreads().size());
|
assertEquals(expectedNumRS, cluster.getRegionServerThreads().size());
|
||||||
|
@ -345,12 +349,17 @@ public class TestRollingRestart {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertRegionsAssigned(MiniHBaseCluster cluster,
|
private int getNumberOfOnlineRegions(MiniHBaseCluster cluster) {
|
||||||
Set<String> expectedRegions) throws IOException {
|
|
||||||
int numFound = 0;
|
int numFound = 0;
|
||||||
for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
|
for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
|
||||||
numFound += rst.getRegionServer().getNumberOfOnlineRegions();
|
numFound += rst.getRegionServer().getNumberOfOnlineRegions();
|
||||||
}
|
}
|
||||||
|
return numFound;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertRegionsAssigned(MiniHBaseCluster cluster,
|
||||||
|
Set<String> expectedRegions) throws IOException {
|
||||||
|
int numFound = getNumberOfOnlineRegions(cluster);
|
||||||
if (expectedRegions.size() > numFound) {
|
if (expectedRegions.size() > numFound) {
|
||||||
log("Expected to find " + expectedRegions.size() + " but only found"
|
log("Expected to find " + expectedRegions.size() + " but only found"
|
||||||
+ " " + numFound);
|
+ " " + numFound);
|
||||||
|
|
Loading…
Reference in New Issue