Index: src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 1331653) +++ src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -511,6 +511,7 @@ public void deleteTable(final byte [] tableName) throws IOException { HTableDescriptor.isLegalTableName(tableName); HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName); + boolean tableExists = true; execute(new MasterCallable() { @Override @@ -542,7 +543,7 @@ // let us wait until .META. table is updated and // HMaster removes the table from its HTableDescriptors if (values == null || values.length == 0) { - boolean tableExists = false; + tableExists = false; HTableDescriptor[] htds; MasterKeepAliveConnection master = connection.getKeepAliveMaster(); try { @@ -577,6 +578,11 @@ // continue } } + + if (tableExists) { + throw new RegionException("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));