HBASE-3295 Dropping a 1k+ regions table likely ends in a client socket timeout and it's very confusing

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1041522 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-12-02 18:47:20 +00:00
parent fc59f7d77c
commit 2122dafaa4
3 changed files with 13 additions and 6 deletions

View File

@ -734,6 +734,8 @@ Release 0.90.0 - Unreleased
(double-remove?) org.apache.hadoop.hbase.regionserver.StoreScanner@76607d3d
HBASE-3299 If failed open, we don't output the IOE
HBASE-3291 If split happens while regionserver is going down, we can stick open.
HBASE-3295 Dropping a 1k+ regions table likely ends in a client socket timeout
and it's very confusing
IMPROVEMENTS

View File

@ -68,6 +68,10 @@ public class HBaseAdmin implements Abortable {
private volatile Configuration conf;
private final long pause;
private final int numRetries;
// Some operations can take a long time such as disable of big table.
// numRetries is for 'normal' stuff... Mutliply by this factor when
// want to wait a long time.
private final int retryLongerMultiplier;
/**
* Constructor
@ -82,6 +86,7 @@ public class HBaseAdmin implements Abortable {
this.conf = conf;
this.pause = conf.getLong("hbase.client.pause", 1000);
this.numRetries = conf.getInt("hbase.client.retries.number", 10);
this.retryLongerMultiplier = conf.getInt("hbase.client.retries.longer.multiplier", 10);
this.connection.getMaster();
}
@ -367,11 +372,11 @@ public class HBaseAdmin implements Abortable {
throw RemoteExceptionHandler.decodeRemoteException(e);
}
final int batchCount = this.conf.getInt("hbase.admin.scanner.caching", 10);
// Wait until first region is deleted
// Wait until all regions deleted
HRegionInterface server =
connection.getHRegionConnection(firstMetaServer.getServerAddress());
HRegionInfo info = new HRegionInfo();
for (int tries = 0; tries < numRetries; tries++) {
for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) {
long scannerId = -1L;
try {
Scan scan = new Scan().addColumn(HConstants.CATALOG_FAMILY,
@ -449,7 +454,7 @@ public class HBaseAdmin implements Abortable {
// Wait until all regions are enabled
boolean enabled = false;
for (int tries = 0; tries < this.numRetries; tries++) {
for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) {
enabled = isTableEnabled(tableName);
if (enabled) {
break;
@ -534,7 +539,7 @@ public class HBaseAdmin implements Abortable {
}
/**
* Disable table and wait on completion. May timeout. Use
* Disable table and wait on completion. May timeout eventually. Use
* {@link #disableTableAsync(byte[])} and {@link #isTableDisabled(String)}
* instead.
* @param tableName
@ -545,7 +550,7 @@ public class HBaseAdmin implements Abortable {
disableTableAsync(tableName);
// Wait until table is disabled
boolean disabled = false;
for (int tries = 0; tries < this.numRetries; tries++) {
for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) {
disabled = isTableDisabled(tableName);
if (disabled) {
break;

View File

@ -804,7 +804,7 @@ implements HMasterInterface, HMasterRegionInterface, MasterServices, Server {
}
public void deleteTable(final byte [] tableName) throws IOException {
new DeleteTableHandler(tableName, this, this).process();
this.executorService.submit(new DeleteTableHandler(tableName, this, this));
}
public void addColumn(byte [] tableName, HColumnDescriptor column)