hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1177175 - in /hbase/trunk/src: main/java/org/apache/hadoop/hbase/master/AssignmentManager.java test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
Date Thu, 29 Sep 2011 06:29:17 GMT
Author: ramkrishna
Date: Thu Sep 29 06:29:16 2011
New Revision: 1177175

URL: http://svn.apache.org/viewvc?rev=1177175&view=rev
Log:
HBASE-4492 TestRollingRestart Fails Intermittently(Ted yu and Ram)

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1177175&r1=1177174&r2=1177175&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Thu Sep
29 06:29:16 2011
@@ -1461,6 +1461,7 @@ public class AssignmentManager extends Z
             LOG.error(errorMsg, t);
             return;
           }
+        }
         LOG.warn("Failed assignment of " +
           state.getRegion().getRegionNameAsString() + " to " +
           plan.getDestination() + ", trying to assign elsewhere instead; " +
@@ -1477,7 +1478,6 @@ public class AssignmentManager extends Z
         }
       }
     }
-   }
   }
 
   private void debugLog(HRegionInfo region, String string) {

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java?rev=1177175&r1=1177174&r2=1177175&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java Thu Sep
29 06:29:16 2011
@@ -210,7 +210,11 @@ public class TestRollingRestart {
     waitForRSShutdownToStartAndFinish(activeMaster,
         metaServer.getRegionServer().getServerName());
     log("Waiting for no more RIT");
-    blockUntilNoRIT(zkw, master);
+    long start = System.currentTimeMillis();
+    do {
+      blockUntilNoRIT(zkw, master);
+    } while (getNumberOfOnlineRegions(cluster) < numRegions 
+        && System.currentTimeMillis()-start < 60000);
     log("Verifying there are " + numRegions + " assigned on cluster");
     assertRegionsAssigned(cluster, regions);
     assertEquals(expectedNumRS, cluster.getRegionServerThreads().size());
@@ -345,12 +349,17 @@ public class TestRollingRestart {
     return null;
   }
 
-  private void assertRegionsAssigned(MiniHBaseCluster cluster,
-      Set<String> expectedRegions) throws IOException {
+  private int getNumberOfOnlineRegions(MiniHBaseCluster cluster) {
     int numFound = 0;
     for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
       numFound += rst.getRegionServer().getNumberOfOnlineRegions();
     }
+    return numFound;
+  }
+  
+  private void assertRegionsAssigned(MiniHBaseCluster cluster,
+      Set<String> expectedRegions) throws IOException {
+    int numFound = getNumberOfOnlineRegions(cluster);
     if (expectedRegions.size() > numFound) {
       log("Expected to find " + expectedRegions.size() + " but only found"
           + " " + numFound);



Mime
View raw message