HBASE-3381 Interrupt of a region open comes across as a successful open

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1051710 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-12-22 00:17:51 +00:00
parent 1cb6c18d8a
commit bc8d7005b1
4 changed files with 19 additions and 5 deletions

View File

@ -801,6 +801,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

View File

@ -137,13 +137,15 @@ public class ServerShutdownHandler extends EventHandler {
// 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 extends EventHandler {
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 extends EventHandler {
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");
}
}
}

View File

@ -164,7 +164,7 @@ public class OpenRegionHandler extends EventHandler {
}
// 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;
}
/**

View File

@ -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.");