diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index f18a587..85c7398 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -617,7 +617,6 @@ public class HBaseAdmin implements Abortable, Closeable { * @throws IOException if a remote or network exception occurs */ public void deleteTable(final TableName tableName) throws IOException { - HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName); boolean tableExists = true; executeCallable(new MasterCallable(getConnection()) { @@ -629,10 +628,11 @@ public class HBaseAdmin implements Abortable, Closeable { } }); + int failures = 0; // Wait until all regions deleted for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) { try { - + HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName); Scan scan = MetaReader.getScanForTableName(tableName); scan.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); ScanRequest request = RequestConverter.buildScanRequest( @@ -671,7 +671,8 @@ public class HBaseAdmin implements Abortable, Closeable { } } } catch (IOException ex) { - if(tries == numRetries - 1) { // no more tries left + failures++; + if(failures == numRetries - 1) { // no more tries left if (ex instanceof RemoteException) { throw ((RemoteException) ex).unwrapRemoteException(); } else { diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 53b4e23..88ae114 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -2668,9 +2668,11 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa String regionNameStr = regionName == null? encodedRegionName: Bytes.toStringBinary(regionName); if (isOpening != null && isOpening.booleanValue()) { - throw new RegionOpeningException("Region " + regionNameStr + " is opening"); + throw new RegionOpeningException("Region " + regionNameStr + + " is opening on " + this.serverNameFromMasterPOV); } - throw new NotServingRegionException("Region " + regionNameStr + " is not online"); + throw new NotServingRegionException("Region " + regionNameStr + + " is not online on " + this.serverNameFromMasterPOV); } return region; } diff --git hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java index e5a4ef7..28db1aa 100644 --- hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java +++ hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java @@ -114,7 +114,7 @@ public class TestRowProcessorEndpoint { Configuration conf = util.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, RowProcessorEndpoint.class.getName()); - conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); + conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); conf.setLong("hbase.hregion.row.processor.timeout", 1000L); util.startMiniCluster(); }