You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2010/05/05 01:38:40 UTC

svn commit: r941099 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/master/HMaster.java src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java

Author: stack
Date: Tue May  4 23:38:39 2010
New Revision: 941099

URL: http://svn.apache.org/viewvc?rev=941099&view=rev
Log:
HBASE-2513 hbase-2414 added bug where we'd tight-loop if no root available

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=941099&r1=941098&r2=941099&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Tue May  4 23:38:39 2010
@@ -118,6 +118,8 @@ Release 0.20.4 - Unreleased
                crashes (Todd Lipcon via Stack)
    HBASE-2509  NPEs in various places, HRegion.get, HRS.close
                (Ryan Rawson via Stack)
+   HBASE-2513  hbase-2414 added bug where we'd tight-loop if no root
+               available
 
   IMPROVEMENTS
    HBASE-2180  Bad read performance from synchronizing hfile.fddatainputstream

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java?rev=941099&r1=941098&r2=941099&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java Tue May  4 23:38:39 2010
@@ -428,15 +428,15 @@ public class HMaster extends Thread impl
             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) {

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java?rev=941099&r1=941098&r2=941099&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionServerOperationQueue.java Tue May  4 23:38:39 2010
@@ -90,11 +90,16 @@ public class RegionServerOperationQueue 
 
   /**
    * 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) {