hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1326282 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
Date Sun, 15 Apr 2012 08:59:16 GMT
Author: jmhsieh
Date: Sun Apr 15 08:59:15 2012
New Revision: 1326282

URL: http://svn.apache.org/viewvc?rev=1326282&view=rev
Log:
HBASE-5781 Zookeeper session got closed while trying to assign the region to RS using hbck
-fix

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1326282&r1=1326281&r2=1326282&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Sun Apr 15 08:59:15 2012
@@ -38,6 +38,7 @@ Release 0.92.2 - Unreleased
    HBASE-5773  HtablePool constructor not reading config files in certain cases
                (Ioan Eugen Stan)
    HBASE-5488  OfflineMetaRepair doesn't support hadoop 0.20's fs.default.name property (gaojinchao)
+   HBASE-5781  Zookeeper session got closed while trying to assign the region to RS using
hbck -fix
 
   IMPROVEMENTS
    HBASE-5592  Make it easier to get a table from shell (Ben West)

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java?rev=1326282&r1=1326281&r2=1326282&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java Sun
Apr 15 08:59:15 2012
@@ -117,38 +117,28 @@ public class HBaseFsckRepair {
    */
   public static void waitUntilAssigned(HBaseAdmin admin,
       HRegionInfo region) throws IOException, InterruptedException {
-    HConnection connection = admin.getConnection();
-
-    try {
-      long timeout = admin.getConfiguration().getLong("hbase.hbck.assign.timeout", 120000);
-      long expiration = timeout + System.currentTimeMillis();
-      while (System.currentTimeMillis() < expiration) {
-        try {
-          Map<String, RegionState> rits=
+    long timeout = admin.getConfiguration().getLong("hbase.hbck.assign.timeout", 120000);
+    long expiration = timeout + System.currentTimeMillis();
+    while (System.currentTimeMillis() < expiration) {
+      try {
+        Map<String, RegionState> rits=
             admin.getClusterStatus().getRegionsInTransition();
 
-          if (rits.keySet() != null && !rits.keySet().contains(region.getEncodedName()))
{
-            // yay! no longer RIT
-            return;
-          }
-          // still in rit
-          LOG.info("Region still in transition, waiting for "
-              + "it to become assigned: " + region);
-        } catch (IOException e) {
-          LOG.warn("Exception when waiting for region to become assigned,"
-              + " retrying", e);
+        if (rits.keySet() != null && !rits.keySet().contains(region.getEncodedName()))
{
+          // yay! no longer RIT
+          return;
         }
-        Thread.sleep(1000);
-      }
-      throw new IOException("Region " + region + " failed to move out of " +
-          "transition within timeout " + timeout + "ms");
-    } finally {
-      try {
-        connection.close();
-      } catch (IOException ioe) {
-        throw ioe;
+        // still in rit
+        LOG.info("Region still in transition, waiting for "
+            + "it to become assigned: " + region);
+      } catch (IOException e) {
+        LOG.warn("Exception when waiting for region to become assigned,"
+            + " retrying", e);
       }
+      Thread.sleep(1000);
     }
+    throw new IOException("Region " + region + " failed to move out of " +
+        "transition within timeout " + timeout + "ms");
   }
 
   /**



Mime
View raw message