You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2010/12/02 19:48:21 UTC

svn commit: r1041523 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Author: stack
Date: Thu Dec  2 18:48:20 2010
New Revision: 1041523

URL: http://svn.apache.org/viewvc?rev=1041523&view=rev
Log:
HBASE-3295 Dropping a 1k+ regions table likely ends in a client socket timeout and it's very confusing

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1041523&r1=1041522&r2=1041523&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Thu Dec  2 18:48:20 2010
@@ -716,7 +716,9 @@ Release 0.90.0 - Unreleased
    HBASE-3294  WARN org.apache.hadoop.hbase.regionserver.Store: Not in set
                (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-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

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1041523&r1=1041522&r2=1041523&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Dec  2 18:48:20 2010
@@ -68,6 +68,10 @@ public class HBaseAdmin implements Abort
   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 Abort
     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 Abort
       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 Abort
  
     // 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 Abort
   }
 
   /**
-   * 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 Abort
     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;

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1041523&r1=1041522&r2=1041523&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Thu Dec  2 18:48:20 2010
@@ -803,7 +803,7 @@ implements HMasterInterface, HMasterRegi
   }
 
   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)