hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1142120 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Date Sat, 02 Jul 2011 00:03:40 GMT
Author: stack
Date: Sat Jul  2 00:03:40 2011
New Revision: 1142120

URL: http://svn.apache.org/viewvc?rev=1142120&view=rev
Log:
HBASE-4034 HRegionServer should be stopped even if no META regions are hosted by the HRegionServer

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1142120&r1=1142119&r2=1142120&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sat Jul  2 00:03:40 2011
@@ -385,6 +385,8 @@ Release 0.90.4 - Unreleased
    HBASE-3984  CT.verifyRegionLocation isn't doing a very good check,
                can delay cluster recovery
    HBASE-4045  [replication] NPE in ReplicationSource when ZK is gone
+   HBASE-4034  HRegionServer should be stopped even if no META regions
+               are hosted by the HRegionServer (Akash Ashok)
 
   IMPROVEMENT
    HBASE-3882  hbase-config.sh needs to be updated so it can auto-detects the

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1142120&r1=1142119&r2=1142120&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Sat
Jul  2 00:03:40 2011
@@ -615,7 +615,6 @@ public class HRegionServer implements HR
 
       // We registered with the Master.  Go into run mode.
       long lastMsg = 0;
-      boolean onlyMetaRegionsRemaining = false;
       long oldRequestCount = -1;
       // The main run loop.
       while (!this.stopped && isHealthy()) {
@@ -627,11 +626,11 @@ public class HRegionServer implements HR
             LOG.info("Closing user regions");
             closeUserRegions(this.abortRequested);
           } else if (this.stopping) {
-            LOG.info("Only meta regions remain open");
-            if (!onlyMetaRegionsRemaining) {
-              onlyMetaRegionsRemaining = isOnlyMetaRegionsRemaining();
-            }
-            if (onlyMetaRegionsRemaining) {
+            LOG.info("Stopping meta regions, if the HRegionServer hosts any");
+            
+            boolean allUserRegionsOffline = areAllUserRegionsOffline();
+            
+            if (allUserRegionsOffline) {
               // Set stopped if no requests since last time we went around the loop.
               // The remaining meta regions will be closed on our way out.
               if (oldRequestCount == this.requestCount.get()) {
@@ -721,17 +720,16 @@ public class HRegionServer implements HR
     LOG.info(Thread.currentThread().getName() + " exiting");
   }
 
-  private boolean isOnlyMetaRegionsRemaining() {
+  private boolean areAllUserRegionsOffline() {
     if (getNumberOfOnlineRegions() > 2) return false;
-    boolean onlyMetaRegionsRemaining = false;
+    boolean allUserRegionsOffline = true;
     for (Map.Entry<String, HRegion> e: this.onlineRegions.entrySet()) {
       if (!e.getValue().getRegionInfo().isMetaRegion()) {
-        onlyMetaRegionsRemaining = false;
+        allUserRegionsOffline = false;
         break;
       }
-      onlyMetaRegionsRemaining = true;
     }
-    return onlyMetaRegionsRemaining;
+    return allUserRegionsOffline;
   }
 
   void tryRegionServerReport()



Mime
View raw message