HBASE-3207 If we get IOException when closing a region, we should still remove it from online regions and complete the close in ZK

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1033259 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Gray 2010-11-09 22:05:25 +00:00
parent 934f1e7a41
commit 2640b277cc
2 changed files with 7 additions and 16 deletions

View File

@ -662,6 +662,8 @@ Release 0.90.0 - Unreleased
that are equal to too
HBASE-3141 Master RPC server needs to be started before an RS can check in
HBASE-3112 Enable and disable of table needs a bit of loving in new master
HBASE-3207 If we get IOException when closing a region, we should still
remove it from online regions and complete the close in ZK
IMPROVEMENTS

View File

@ -116,15 +116,16 @@ public class CloseRegionHandler extends EventHandler {
// TODO: If we need to keep updating CLOSING stamp to prevent against
// a timeout if this is long-running, need to spin up a thread?
region.close(abort);
this.rsServices.removeFromOnlineRegions(regionInfo.getEncodedName());
} catch (IOException e) {
LOG.error("Closing region " + regionInfo.getRegionNameAsString(), e);
if (this.zk) deleteClosingState();
LOG.error("Unrecoverable exception while closing region " +
regionInfo.getRegionNameAsString() + ", still finishing close", e);
}
this.rsServices.removeFromOnlineRegions(regionInfo.getEncodedName());
if (this.zk) setClosedState(expectedVersion, region);
// Done! Successful region open
// Done! Region is closed on this RS
LOG.debug("Closed region " + region.getRegionNameAsString());
}
@ -154,18 +155,6 @@ public class CloseRegionHandler extends EventHandler {
}
}
/**
* @return True if succeeded, false otherwise.
*/
private void deleteClosingState() {
try {
ZKAssign.deleteClosingNode(server.getZooKeeper(),
this.regionInfo.getEncodedName());
} catch (KeeperException e1) {
LOG.error("Error deleting CLOSING node");
}
}
/**
* Create ZK node in CLOSING state.
* @return The expectedVersion. If -1, we failed setting CLOSING.