Index: main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1129140) +++ main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -433,6 +433,14 @@ this.catalogTracker.waitForRoot(); assigned++; } + else{ + HServerInfo hsi = this.serverManager.getHServerInfo( this.catalogTracker.getRootLocation()); + if(null == hsi){ + this.assignmentManager.assignRoot(); + this.catalogTracker.waitForRoot(); + assigned++; + } + } LOG.info("-ROOT- assigned=" + assigned + ", rit=" + rit + ", location=" + catalogTracker.getRootLocation()); @@ -447,6 +455,18 @@ this.assignmentManager.waitForAssignment(HRegionInfo.FIRST_META_REGIONINFO); assigned++; } + else{ + HServerInfo hsi = this.serverManager.getHServerInfo(this.catalogTracker.getMetaLocation()); + if(null == hsi){ + this.assignmentManager.assignMeta(); + this.catalogTracker.waitForMeta(); + // Above check waits for general meta availability but this does not + // guarantee that the transition has completed + this.assignmentManager.waitForAssignment(HRegionInfo.FIRST_META_REGIONINFO); + assigned++; + } + } + LOG.info(".META. assigned=" + assigned + ", rit=" + rit + ", location=" + catalogTracker.getMetaLocation()); return assigned; Index: main/java/org/apache/hadoop/hbase/master/ServerManager.java =================================================================== --- main/java/org/apache/hadoop/hbase/master/ServerManager.java (revision 1129140) +++ main/java/org/apache/hadoop/hbase/master/ServerManager.java (working copy) @@ -90,6 +90,8 @@ private final DeadServer deadservers; private final long maxSkew; + + private volatile boolean stopReportJoinServer = false; /** * Constructor. @@ -269,7 +271,12 @@ // The only thing we are skipping is passing back to the regionserver // the HServerInfo to use. Here we presume a master has already done // that so we'll press on with whatever it gave us for HSI. - recordNewServer(info, true, null); + if(!stopReportJoinServer){ + recordNewServer(info, true, null); + } + else{ + return HMsg.STOP_REGIONSERVER_ARRAY; + } // If msgs, put off their processing but this is not enough because // its possible that the next time the server reports in, we'll still // not be up and serving. For example, if a split, we'll need the @@ -631,7 +638,7 @@ long interval = this.master.getConfiguration(). getLong("hbase.master.wait.on.regionservers.interval", 1500); long timeout = this.master.getConfiguration(). - getLong("hbase.master.wait.on.regionservers.timeout", 4500); + getLong("hbase.master.wait.on.regionservers.timeout", 9000); int minToStart = this.master.getConfiguration(). getInt("hbase.master.wait.on.regionservers.mintostart", 1); int maxToStart = this.master.getConfiguration(). @@ -661,6 +668,10 @@ } oldcount = count; } + + //stop region server join by api regionServerReport + stopReportJoinServer = true; + // Count how many regions deployed out on cluster. If fresh start, it'll // be none but if not a fresh start, we'll have registered servers when // they came in on the {@link #regionServerReport(HServerInfo)} as opposed to