hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1051711 - in /hbase/branches/0.90: ./ src/main/java/org/apache/hadoop/hbase/master/handler/ src/main/java/org/apache/hadoop/hbase/regionserver/handler/ src/main/java/org/apache/hadoop/hbase/util/
Date Wed, 22 Dec 2010 00:18:50 GMT
Author: stack
Date: Wed Dec 22 00:18:50 2010
New Revision: 1051711

URL: http://svn.apache.org/viewvc?rev=1051711&view=rev
Log:
HBASE-3381 Interrupt of a region open comes across as a successful open

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1051711&r1=1051710&r2=1051711&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Wed Dec 22 00:18:50 2010
@@ -764,6 +764,7 @@ Release 0.90.0 - Unreleased
    HBASE-3323  OOME in master splitting logs
    HBASE-3374  Our jruby jar has *GPL jars in it; fix
    HBASE-3343  Server not shutting down after losing log lease
+   HBASE-3381  Interrupt of a region open comes across as a successful open
 
 
   IMPROVEMENTS

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java?rev=1051711&r1=1051710&r2=1051711&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java
Wed Dec 22 00:18:50 2010
@@ -137,13 +137,15 @@ public class ServerShutdownHandler exten
     // Skip regions that were in transition unless CLOSING or PENDING_CLOSE
     for (RegionState rit : regionsInTransition) {
       if (!rit.isClosing() && !rit.isPendingClose()) {
+        LOG.debug("Removed " + rit.getRegion().getRegionNameAsString() +
+          " from list of regions to assign because in RIT");
         hris.remove(rit.getRegion());
       }
     }
 
-    LOG.info("Reassigning " + hris.size() + " region(s) that " + serverName
-        + " was carrying (skipping " + regionsInTransition.size() +
-        " regions(s) that are already in transition)");
+    LOG.info("Reassigning " + hris.size() + " region(s) that " + serverName +
+      " was carrying (skipping " + regionsInTransition.size() +
+      " regions(s) that are already in transition)");
 
     // Iterate regions that were on this server and assign them
     for (Map.Entry<HRegionInfo, Result> e: hris.entrySet()) {
@@ -175,6 +177,8 @@ public class ServerShutdownHandler exten
         hri.getTableDesc().getNameAsString());
     if (disabled) return false;
     if (hri.isOffline() && hri.isSplit()) {
+      LOG.debug("Offlined and split region " + hri.getRegionNameAsString() +
+        "; checking daughter presence");
       fixupDaughters(result, assignmentManager, catalogTracker);
       return false;
     }
@@ -208,13 +212,16 @@ public class ServerShutdownHandler exten
   throws IOException {
     byte [] bytes = result.getValue(HConstants.CATALOG_FAMILY, qualifier);
     if (bytes == null || bytes.length <= 0) return;
-    HRegionInfo hri = Writables.getHRegionInfo(bytes);
+    HRegionInfo hri = Writables.getHRegionInfoOrNull(bytes);
+    if (hri == null) return;
     Pair<HRegionInfo, HServerAddress> pair =
       MetaReader.getRegion(catalogTracker, hri.getRegionName());
     if (pair == null || pair.getFirst() == null) {
       LOG.info("Fixup; missing daughter " + hri.getEncodedName());
       MetaEditor.addDaughter(catalogTracker, hri, null);
       assignmentManager.assign(hri, true);
+    } else {
+      LOG.debug("Daughter " + hri.getRegionNameAsString() + " present");
     }
   }
 }

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java?rev=1051711&r1=1051710&r2=1051711&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
Wed Dec 22 00:18:50 2010
@@ -165,7 +165,7 @@ public class OpenRegionHandler extends E
     }
     // Was there an exception opening the region?  This should trigger on
     // InterruptedException too.  If so, we failed.
-    return t.getException() == null;
+    return !t.interrupted() && t.getException() == null;
   }
 
   /**

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java?rev=1051711&r1=1051710&r2=1051711&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Wed Dec
22 00:18:50 2010
@@ -385,6 +385,8 @@ public class HBaseFsck {
     boolean deploymentMatchesMeta =
       hasMetaAssignment && isDeployed && !isMultiplyDeployed &&
       hbi.metaEntry.regionServer.equals(hbi.deployedOn.get(0));
+    boolean splitParent =
+      (hbi.metaEntry == null)? false: hbi.metaEntry.isSplit() && hbi.metaEntry.isOffline();
     boolean shouldBeDeployed = inMeta && !isTableDisabled(hbi.metaEntry);
     boolean recentlyModified = hbi.foundRegionDir != null &&
       hbi.foundRegionDir.getModificationTime() + timelag > System.currentTimeMillis();
@@ -395,6 +397,10 @@ public class HBaseFsck {
     }
     if (inMeta && inHdfs && isDeployed && deploymentMatchesMeta &&
shouldBeDeployed) {
       return;
+    } else if (inMeta && !isDeployed && splitParent) {
+      // Offline regions shouldn't cause complaints
+      LOG.debug("Region " + descriptiveName + " offline, split, parent, ignoring.");
+      return;
     } else if (inMeta && !shouldBeDeployed && !isDeployed) {
       // offline regions shouldn't cause complaints
       LOG.debug("Region " + descriptiveName + " offline, ignoring.");



Mime
View raw message