Index: src/main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1333319) +++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -675,6 +675,10 @@ boolean rit = this.assignmentManager. processRegionInTransitionAndBlockUntilAssigned(HRegionInfo.ROOT_REGIONINFO); ServerName currentRootServer = null; + if (rit && assignmentManager.getRegionServerOfRegion( + HRegionInfo.ROOT_REGIONINFO) != null) { + LOG.info("-ROOT- is already onlined after process RIT"); + }else{ if (!catalogTracker.verifyRootRegionLocation(timeout)) { currentRootServer = this.catalogTracker.getRootLocation(); splitLogAndExpireIfOnline(currentRootServer); @@ -689,6 +693,7 @@ this.assignmentManager.regionOnline(HRegionInfo.ROOT_REGIONINFO, this.catalogTracker.getRootLocation()); } + } // Enable the ROOT table if on process fail over the RS containing ROOT // was active. enableCatalogTables(Bytes.toString(HConstants.ROOT_TABLE_NAME)); @@ -701,6 +706,10 @@ status.setStatus("Assigning META region"); rit = this.assignmentManager. processRegionInTransitionAndBlockUntilAssigned(HRegionInfo.FIRST_META_REGIONINFO); + if (rit && assignmentManager.getRegionServerOfRegion( + HRegionInfo.FIRST_META_REGIONINFO) != null) { + LOG.info(".META. is already onlined after process RIT"); + } else { if (!this.catalogTracker.verifyMetaRegionLocation(timeout)) { ServerName currentMetaServer = this.catalogTracker.getMetaLocationOrReadLocationFromRoot(); @@ -719,6 +728,7 @@ this.assignmentManager.regionOnline(HRegionInfo.FIRST_META_REGIONINFO, this.catalogTracker.getMetaLocation()); } + } enableCatalogTables(Bytes.toString(HConstants.META_TABLE_NAME)); LOG.info(".META. assigned=" + assigned + ", rit=" + rit + ", location=" + catalogTracker.getMetaLocation()); Index: src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (revision 1335368) +++ src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (working copy) @@ -1197,13 +1197,6 @@ * @param sn */ void regionOnline(HRegionInfo regionInfo, ServerName sn) { - synchronized (this.regionsInTransition) { - RegionState rs = - this.regionsInTransition.remove(regionInfo.getEncodedName()); - if (rs != null) { - this.regionsInTransition.notifyAll(); - } - } synchronized (this.regions) { // Add check ServerName oldSn = this.regions.get(regionInfo); @@ -1219,6 +1212,13 @@ sn.getServerName() + ", region=" + regionInfo.getEncodedName()); } } + synchronized (this.regionsInTransition) { + RegionState rs = this.regionsInTransition.remove(regionInfo + .getEncodedName()); + if (rs != null) { + this.regionsInTransition.notifyAll(); + } + } // Remove plan if one. clearRegionPlan(regionInfo); // Update timers for all regions in transition going against this server.