HBASE-927 We don't recover if HRS hosting -ROOT-/.META. goes down - (fix bug in createTable which caused tests to fail)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@723000 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Kellerman 2008-12-03 18:25:48 +00:00
parent c209dabaf5
commit 838b238999
2 changed files with 22 additions and 7 deletions

View File

@ -92,6 +92,8 @@ Release 0.19.0 - Unreleased
HBASE-927 We don't recover if HRS hosting -ROOT-/.META. goes down
HBASE-1043 Removing @Override attributes where they are no longer needed.
(Ryan Smith via Jim Kellerman)
HBASE-927 We don't recover if HRS hosting -ROOT-/.META. goes down -
(fix bug in createTable which caused tests to fail)
IMPROVEMENTS

View File

@ -590,14 +590,27 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
if (!isMasterRunning()) {
throw new MasterNotRunningException();
}
// We can not create a table unless meta regions have already been
// assigned and scanned.
if (!regionManager.areAllMetaRegionsOnline()) {
throw new NotAllMetaRegionsOnlineException();
}
HRegionInfo newRegion = new HRegionInfo(desc, null, null);
createTable(newRegion);
LOG.info("created table " + desc.getNameAsString());
for (int tries = 0; tries < numRetries; tries++) {
try {
// We can not create a table unless meta regions have already been
// assigned and scanned.
if (!regionManager.areAllMetaRegionsOnline()) {
throw new NotAllMetaRegionsOnlineException();
}
createTable(newRegion);
LOG.info("created table " + desc.getNameAsString());
break;
} catch (TableExistsException e) {
throw e;
} catch (IOException e) {
if (tries == numRetries - 1) {
throw RemoteExceptionHandler.checkIOException(e);
}
sleeper.sleep();
}
}
}
private synchronized void createTable(final HRegionInfo newRegion)