hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r951652 - in /hbase/trunk: ./ src/main/java/org/apache/hadoop/hbase/master/ src/main/java/org/apache/hadoop/hbase/regionserver/ src/main/java/org/apache/hadoop/hbase/util/ src/test/java/org/apache/hadoop/hbase/master/
Date Sat, 05 Jun 2010 05:22:34 GMT
Author: stack
Date: Sat Jun  5 05:22:33 2010
New Revision: 951652

URL: http://svn.apache.org/viewvc?rev=951652&view=rev
Log:
HBASE-2614 killing server in TestMasterTransitions causes NPEs and test deadlock

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=951652&r1=951651&r2=951652&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sat Jun  5 05:22:33 2010
@@ -373,6 +373,7 @@ Release 0.21.0 - Unreleased
    HBASE-2657  TestTableResource is broken in trunk
    HBASE-2662  TestScannerResource.testScannerResource broke in trunk
    HBASE-2667  TestHLog.testSplit failing in trunk
+   HBASE-2614  killing server in TestMasterTransitions causes NPEs and test deadlock
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java?rev=951652&r1=951651&r2=951652&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java Sat Jun  5 05:22:33
2010
@@ -589,6 +589,7 @@ abstract class BaseScanner extends Chore
     synchronized(scannerLock){
       if (isAlive()) {
         super.interrupt();
+        LOG.info("Interrupted");
       }
     }
   }

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=951652&r1=951651&r2=951652&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Sat Jun  5 05:22:33
2010
@@ -447,6 +447,9 @@ public class HMaster extends Thread impl
           if (this.serverManager.numServers() == 0) {
             startShutdown();
             break;
+          } else {
+            LOG.debug("Waiting on " +
+              this.serverManager.getServersToServerInfo().keySet().toString());
           }
         }
         final HServerAddress root = this.regionManager.getRootRegionLocation();

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=951652&r1=951651&r2=951652&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java Sat Jun  5
05:22:33 2010
@@ -592,17 +592,8 @@ public class RegionManager implements HC
    * regions can shut down.
    */
   public void stopScanners() {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("telling root scanner to stop");
-    }
-    rootScannerThread.interruptAndStop();
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("telling meta scanner to stop");
-    }
-    metaScannerThread.interruptAndStop();
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("meta and root scanners notified");
-    }
+    this.rootScannerThread.interruptAndStop();
+    this.metaScannerThread.interruptAndStop();
   }
 
   /** Stop the region assigner */
@@ -1152,7 +1143,8 @@ public class RegionManager implements HC
    */
   public void waitForRootRegionLocation() {
     synchronized (rootRegionLocation) {
-      while (!master.isClosed() && rootRegionLocation.get() == null) {
+      while (!master.getShutdownRequested().get() &&
+          !master.isClosed() && rootRegionLocation.get() == null) {
         // rootRegionLocation will be filled in when we get an 'open region'
         // regionServerReport message from the HRegionServer that has been
         // allocated the ROOT region below.

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=951652&r1=951651&r2=951652&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
Jun  5 05:22:33 2010
@@ -1121,7 +1121,9 @@ public class HRegionServer implements HC
   public void abort() {
     this.abortRequested = true;
     this.reservedSpace.clear();
-    LOG.info("Dump of metrics: " + this.metrics.toString());
+    if (this.metrics != null) {
+      LOG.info("Dump of metrics: " + this.metrics.toString());
+    }
     stop();
   }
 

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java?rev=951652&r1=951651&r2=951652&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java Sat Jun  5
05:22:33 2010
@@ -55,7 +55,12 @@ public class JVMClusterUtil {
      * to be used.
      */
     public void waitForServerOnline() {
-      while (!regionServer.isOnline()) {
+      // The server is marked online after the init method completes inside of
+      // the HRS#run method.  HRS#init can fail for whatever region.  In those
+      // cases, we'll jump out of the run without setting online flag.  Check
+      // stopRequested so we don't wait here a flag that will never be flipped.
+      while (!this.regionServer.isOnline() &&
+          !this.regionServer.isStopRequested()) {
         try {
           Thread.sleep(1000);
         } catch (InterruptedException e) {

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java?rev=951652&r1=951651&r2=951652&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java Sat
Jun  5 05:22:33 2010
@@ -74,6 +74,10 @@ public class TestMasterTransitions {
    */
   @BeforeClass public static void beforeAllTests() throws Exception {
     TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
+    // Parcel out the regions, don't give them out in big lumps.  We've only
+    // a few in this test.  Let a couple of cycles pass is more realistic and
+    // gives stuff a chance to work.
+    TEST_UTIL.getConfiguration().setInt("hbase.regions.percheckin", 2);
     // Start a cluster of two regionservers.
     TEST_UTIL.startMiniCluster(2);
     // Create a table of three families.  This will assign a region.



Mime
View raw message