Index: src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java =================================================================== --- src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java (revision 941061) +++ src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java (working copy) @@ -90,11 +90,16 @@ /** * Try to get an operation off of the queue and process it. + * @param skipDelayedToDos If true, do not do delayed todos first but instead + * move straight to the current todos list. This is set when we want to be + * sure that recently queued events are processed first such as the onlining + * of root region (Root region needs to be online before we can do meta + * onlining; meta onlining needs to be done before we can do... and so on). * @return {@link ProcessingResultCode#PROCESSED}, * {@link ProcessingResultCode#REQUEUED}, * {@link ProcessingResultCode#REQUEUED_BUT_PROBLEM} */ - public synchronized ProcessingResultCode process() { + public synchronized ProcessingResultCode process(final boolean skipDelayedToDos) { RegionServerOperation op = delayedToDoQueue.poll(); // if there aren't any todo items in the queue, sleep for a bit. if (op == null) { Index: src/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/java/org/apache/hadoop/hbase/master/HMaster.java (revision 941061) +++ src/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -428,15 +428,15 @@ break; } } - if (this.regionManager.getRootRegionLocation() != null) { - switch(this.regionServerOperationQueue.process()) { - case FAILED: + boolean doDelayQueue = this.regionManager.getRootRegionLocation() != null; + switch (this.regionServerOperationQueue.process(doDelayQueue)) { + case FAILED: + break FINISHED; + case REQUEUED_BUT_PROBLEM: + if (!checkFileSystem()) break FINISHED; - case REQUEUED_BUT_PROBLEM: - if (!checkFileSystem()) break FINISHED; - default: // PROCESSED, NOOP, REQUEUED: - break; - } + default: // PROCESSED, NOOP, REQUEUED: + break; } } } catch (Throwable t) {