Index: hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java (revision 1519018) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java (working copy) @@ -55,7 +55,7 @@ c.setInt("ipc.client.connect.max.retries", 1); c.setInt("dfs.client.block.recovery.retries", 1); c.setInt(HConstants.ZK_SESSION_TIMEOUT, 1000); - TEST_UTIL.startMiniCluster(2); + TEST_UTIL.startMiniCluster(3); } /** Index: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java (revision 1519018) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java (working copy) @@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.regionserver.RegionServerServices; import org.apache.hadoop.hbase.util.CancelableProgressable; import org.apache.hadoop.hbase.zookeeper.ZKAssign; +import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.zookeeper.KeeperException; /** @@ -401,9 +402,19 @@ EventType.RS_ZK_REGION_OPENING, EventType.RS_ZK_REGION_FAILED_OPEN, this.version) == -1) { - LOG.warn("Unable to mark region " + hri + " as FAILED_OPEN. " + + String warnMsg = "Unable to mark region " + hri + " as FAILED_OPEN. " + "It's likely that the master already timed out this open " + - "attempt, and thus another RS already has the region."); + "attempt, and thus another RS already has the region."; + try { + String node = ZKAssign.getNodeName(this.server.getZooKeeper(), hri.getEncodedName()); + if (ZKUtil.checkExists(this.server.getZooKeeper(), node) < 0) { + rsServices.abort(warnMsg, null); + } else { + LOG.warn(warnMsg); + } + } catch (KeeperException ke) { + rsServices.abort(warnMsg, ke); + } } else { result = true; } @@ -438,9 +449,19 @@ EventType.M_ZK_REGION_OFFLINE, EventType.RS_ZK_REGION_FAILED_OPEN, versionOfOfflineNode) == -1) { - LOG.warn("Unable to mark region " + hri + " as FAILED_OPEN. " + + String warnMsg = "Unable to mark region " + hri + " as FAILED_OPEN. " + "It's likely that the master already timed out this open " + - "attempt, and thus another RS already has the region."); + "attempt, and thus another RS already has the region."; + try { + String node = ZKAssign.getNodeName(rsServices.getZooKeeper(), hri.getEncodedName()); + if (ZKUtil.checkExists(rsServices.getZooKeeper(), node) < 0) { + rsServices.abort(warnMsg, null); + } else { + LOG.warn(warnMsg); + } + } catch (KeeperException ke) { + rsServices.abort(warnMsg, ke); + } } else { result = true; }