Browse Source

HADOOP-2912. MiniDFSCluster restart should wait for namenode to exit
safemode. This was causing TestFsck to fail. (Mahadev Konar via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@632954 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 17 years ago
parent
commit
e4d49bbde1

+ 3 - 0
CHANGES.txt

@@ -110,6 +110,9 @@ Trunk (unreleased changes)
     HADOOP-2845.  Fix dfsadmin disk utilization report on Solaris.
     (Martin Traverso via tomwhite)
 
+    HADOOP-2912. MiniDFSCluster restart should wait for namenode to exit
+    safemode. This was causing TestFsck to fail.  (Mahadev Konar via dhruba)
+
 Release 0.16.1 - Unreleased
 
   IMPROVEMENTS

+ 9 - 2
src/test/org/apache/hadoop/dfs/MiniDFSCluster.java

@@ -265,7 +265,14 @@ public class MiniDFSCluster {
     
     // Start the DataNodes
     startDataNodes(conf, numDataNodes, manageDfsDirs, operation, racks, hosts, simulatedCapacities);
-    
+    waitClusterUp();
+  }
+
+  /**
+   * wait for the cluster to get out of 
+   * safemode.
+   */
+  public void waitClusterUp() {
     if (numDataNodes > 0) {
       while (!isClusterUp()) {
         try {
@@ -276,7 +283,7 @@ public class MiniDFSCluster {
       }
     }
   }
-  
+
   /**
    * Modify the config and start up additional DataNodes.  The info port for
    * DataNodes is guaranteed to use a free port.

+ 1 - 0
src/test/org/apache/hadoop/dfs/TestFsck.java

@@ -71,6 +71,7 @@ public class TestFsck extends TestCase {
       // bring up data nodes & cleanup cluster
       cluster.startDataNodes(conf, 4, true, null, null);
       cluster.waitActive();
+      cluster.waitClusterUp();
       fs = cluster.getFileSystem();
       util.cleanup(fs, "/srcdat");
     } finally {