Index: src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 1332901) +++ src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -515,6 +515,7 @@ isMasterRunning(); HTableDescriptor.isLegalTableName(tableName); HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName); + boolean tableExists = true; try { getMaster().deleteTable(tableName); } catch (RemoteException e) { @@ -538,7 +539,7 @@ // let us wait until .META. table is updated and // HMaster removes the table from its HTableDescriptors if (values == null) { - boolean tableExists = false; + tableExists = false; HTableDescriptor[] htds = getMaster().getHTableDescriptors(); if (htds != null && htds.length > 0) { for (HTableDescriptor htd: htds) { @@ -574,6 +575,11 @@ // continue } } + + if (tableExists) { + 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));