HBASE-4792 SplitRegionHandler doesn't care if it deletes the znode or not,

leaves the parent region stuck offline


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1202487 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2011-11-16 00:42:52 +00:00
parent 0ab2272833
commit eb5e28e4e1
2 changed files with 12 additions and 6 deletions

View File

@ -87,9 +87,15 @@ public class SplitRegionHandler extends EventHandler implements TotesHRegionInfo
this.daughters.get(0), this.daughters.get(1));
// Remove region from ZK
try {
ZKAssign.deleteNode(this.server.getZooKeeper(),
this.parent.getEncodedName(),
EventHandler.EventType.RS_ZK_REGION_SPLIT);
boolean successful = false;
while (!successful) {
// It's possible that the RS tickles in between the reading of the
// znode and the deleting, so it's safe to retry.
successful = ZKAssign.deleteNode(this.server.getZooKeeper(),
this.parent.getEncodedName(),
EventHandler.EventType.RS_ZK_REGION_SPLIT);
}
} catch (KeeperException e) {
server.abort("Error deleting SPLIT node in ZK for transition ZK node (" +
parent.getEncodedName() + ")", e);

View File

@ -499,13 +499,13 @@ public class ZKAssign {
}
if (expectedVersion != -1
&& stat.getVersion() != expectedVersion) {
LOG.warn("The node we are trying to delete is not the expected one. " +
"Got a version mismatch");
LOG.warn("The node " + regionName + " we are trying to delete is not" +
" the expected one. Got a version mismatch");
return false;
}
if(!ZKUtil.deleteNode(zkw, node, stat.getVersion())) {
LOG.warn(zkw.prefix("Attempting to delete " +
"unassigned node in " + expectedState +
"unassigned node " + regionName + " in " + expectedState +
" state but after verifying state, we got a version mismatch"));
return false;
}