hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1203815 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
Date Fri, 18 Nov 2011 20:02:29 GMT
Author: stack
Date: Fri Nov 18 20:02:28 2011
New Revision: 1203815

URL: http://svn.apache.org/viewvc?rev=1203815&view=rev
Log:
HBASE-4816 Regionserver wouldn't go down because split happened exactly at same time we issued
bulk user region close call on our way out

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1203815&r1=1203814&r2=1203815&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Fri Nov 18 20:02:28 2011
@@ -445,6 +445,8 @@ Release 0.92.0 - Unreleased
    HBASE-4518  TestServerCustomProtocol fails intermittently
    HBASE-4778  Don't ignore corrupt StoreFiles when opening a region
    HBASE-4790  Occasional TestDistributedLogSplitting failure (Jinchao)
+   HBASE-4816  Regionserver wouldn't go down because split happened exactly at same time
+               we issued bulk user region close call on our way out
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1203815&r1=1203814&r2=1203815&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Fri Nov 18 20:02:28 2011
@@ -650,7 +650,6 @@ public class HRegionServer implements HR
             LOG.info("Closing user regions");
             closeUserRegions(this.abortRequested);
           } else if (this.stopping) {
-            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.
@@ -660,6 +659,11 @@ public class HRegionServer implements HR
                 break;
               }
               oldRequestCount = this.requestCount.get();
+            } else {
+              // Make sure all regions have been closed -- some regions may
+              // have not got it because we were splitting at the time of
+              // the call to closeUserRegions.
+              closeUserRegions(this.abortRequested);
             }
             LOG.debug("Waiting on " + getOnlineRegionsAsPrintableString());
           }
@@ -1701,6 +1705,8 @@ public class HRegionServer implements HR
 
   /**
    * Schedule closes on all user regions.
+   * Should be safe calling multiple times because it wont' close regions
+   * that are already closed or that are closing.
    * @param abort Whether we're running an abort.
    */
   void closeUserRegions(final boolean abort) {
@@ -1709,6 +1715,7 @@ public class HRegionServer implements HR
       for (Map.Entry<String, HRegion> e: this.onlineRegions.entrySet()) {
         HRegion r = e.getValue();
         if (!r.getRegionInfo().isMetaRegion()) {
+          if (r.isClosed() || r.isClosing()) continue;
           // Don't update zk with this close transition; pass false.
           closeRegion(r.getRegionInfo(), abort, false);
         }

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java?rev=1203815&r1=1203814&r2=1203815&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
Fri Nov 18 20:02:28 2011
@@ -52,6 +52,11 @@ class SplitRequest implements Runnable {
 
   @Override
   public void run() {
+    if (this.server.isStopping() || this.server.isStopped()) {
+      LOG.debug("Skipping split because server is stopping=" +
+        this.server.isStopping() + " or stopped=" + this.server.isStopped());
+      return;
+    }
     try {
       final long startTime = System.currentTimeMillis();
       SplitTransaction st = new SplitTransaction(parent, midKey);
@@ -90,5 +95,4 @@ class SplitRequest implements Runnable {
       server.checkFileSystem();
     }
   }
-
-}
+}
\ No newline at end of file



Mime
View raw message