HBASE-8924 Master Can fail to come up after chaos monkey if the sleep time is too short.

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1502144 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
eclark 2013-07-11 08:10:02 +00:00
parent f92be02b93
commit b33d113a64
2 changed files with 4 additions and 2 deletions

View File

@ -172,8 +172,8 @@ public class IntegrationTestMTTR {
// Set up the action that will move the regions of our table. // Set up the action that will move the regions of our table.
moveRegionAction = new ChaosMonkey.MoveRegionsOfTable(SLEEP_TIME, tableName); moveRegionAction = new ChaosMonkey.MoveRegionsOfTable(SLEEP_TIME, tableName);
// Kill the master (No sleep time because there is only one master running at this time.) // Kill the master
restartMasterAction = new ChaosMonkey.RestartActiveMaster(0l); restartMasterAction = new ChaosMonkey.RestartActiveMaster(1000);
// Give the action the access to the cluster. // Give the action the access to the cluster.
ChaosMonkey.ActionContext actionContext = new ChaosMonkey.ActionContext(util); ChaosMonkey.ActionContext actionContext = new ChaosMonkey.ActionContext(util);

View File

@ -239,12 +239,14 @@ public class ChaosMonkey extends AbstractHBaseTool implements Stoppable {
} }
void restartMaster(ServerName server, long sleepTime) throws IOException { void restartMaster(ServerName server, long sleepTime) throws IOException {
sleepTime = Math.max(sleepTime, 1000);
killMaster(server); killMaster(server);
sleep(sleepTime); sleep(sleepTime);
startMaster(server); startMaster(server);
} }
void restartRs(ServerName server, long sleepTime) throws IOException { void restartRs(ServerName server, long sleepTime) throws IOException {
sleepTime = Math.max(sleepTime, 1000);
killRs(server); killRs(server);
sleep(sleepTime); sleep(sleepTime);
startRs(server); startRs(server);