瀏覽代碼

HDFS-2764. Merge r1241780 from trunk to 0.23

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1298229 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 13 年之前
父節點
當前提交
9aa829fe67

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -173,6 +173,8 @@ Release 0.23.3 - UNRELEASED
     HDFS-2285. BackupNode should reject requests to modify namespace.
     (shv and Uma Maheswara Rao)
 
+    HDFS-2764. TestBackupNode is racy. (atm)
+
 Release 0.23.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 1 - 3
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBackupNode.java

@@ -25,8 +25,6 @@ import java.net.InetSocketAddress;
 import java.util.Collections;
 import java.util.List;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.impl.Log4JLogger;
@@ -102,10 +100,10 @@ public class TestBackupNode {
             "checkpoint txid should increase above " + txid);
         Thread.sleep(1000);
       } catch (Exception e) {}
+      // The checkpoint is not done until the nn has received it from the bn
       thisCheckpointTxId = cluster.getNameNode().getFSImage().getStorage()
         .getMostRecentCheckpointTxId();
     } while (thisCheckpointTxId < txid);
-    
     // Check that the checkpoint got uploaded to NN successfully
     FSImageTestUtil.assertNNHasCheckpoints(cluster,
         Collections.singletonList((int)thisCheckpointTxId));