Index: src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 1332896) +++ src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -423,6 +423,7 @@ isMasterRunning(); HTableDescriptor.isLegalTableName(tableName); HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName); + Result values = null; try { getMaster().deleteTable(tableName); } catch (RemoteException e) { @@ -441,7 +442,7 @@ scannerId = server.openScanner( firstMetaServer.getRegionInfo().getRegionName(), scan); // Get a batch at a time. - Result values = server.next(scannerId); + values = server.next(scannerId); if (values == null) { break; } @@ -467,6 +468,11 @@ // continue } } + + if (values != null) { + throw new IOException("Retries exhausted, it took too long to wait"+ + " for the table " + Bytes.toString(tableName) + " to be deleted."); + } // Delete cached information to prevent clients from using old locations this.connection.clearRegionCache(tableName); LOG.info("Deleted " + Bytes.toString(tableName));