diff --git a/CHANGES.txt b/CHANGES.txt index 76675e002aa..2ad3d56b9e2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/src/java/org/apache/hadoop/hbase/master/HMaster.java b/src/java/org/apache/hadoop/hbase/master/HMaster.java index 4e140811a53..f855b2f2348 100644 --- a/src/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/src/java/org/apache/hadoop/hbase/master/HMaster.java @@ -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)