hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1242522 - in /hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs: CHANGES.HDFS-1623.txt src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureOfSharedDir.java
Date Thu, 09 Feb 2012 21:08:17 GMT
Author: jitendra
Date: Thu Feb  9 21:08:17 2012
New Revision: 1242522

URL: http://svn.apache.org/viewvc?rev=1242522&view=rev
Log:
HDFS-2915. HA: TestFailureOfSharedDir.testFailureOfSharedDir() has race condition. Contributed
by Bikas Saha.

Modified:
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureOfSharedDir.java

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt?rev=1242522&r1=1242521&r2=1242522&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
Thu Feb  9 21:08:17 2012
@@ -188,3 +188,6 @@ HDFS-2579. Starting delegation token man
 HDFS-2510. Add HA-related metrics. (atm)
 
 HDFS-2924. Standby checkpointing fails to authenticate in secure cluster. (todd)
+
+HDFS-2915. HA: TestFailureOfSharedDir.testFailureOfSharedDir() has race condition. (Bikas
Saha via jitendra)
+

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureOfSharedDir.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureOfSharedDir.java?rev=1242522&r1=1242521&r2=1242522&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureOfSharedDir.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureOfSharedDir.java
Thu Feb  9 21:08:17 2012
@@ -129,6 +129,8 @@ public class TestFailureOfSharedDir {
     
     // The shared edits dir will automatically be marked required.
     MiniDFSCluster cluster = null;
+    int chmodSucceeded = -1;
+    File sharedEditsDir = null;
     try {
       cluster = new MiniDFSCluster.Builder(conf)
         .nnTopology(MiniDFSNNTopology.simpleHATopology())
@@ -143,9 +145,15 @@ public class TestFailureOfSharedDir {
       assertTrue(fs.mkdirs(new Path("/test1")));
       
       // Blow away the shared edits dir.
-      URI sharedEditsUri = cluster.getSharedEditsDir(0, 1);      
-      FileUtil.fullyDelete(new File(sharedEditsUri));
-      
+      URI sharedEditsUri = cluster.getSharedEditsDir(0, 1);
+      sharedEditsDir = new File(sharedEditsUri);
+      chmodSucceeded = FileUtil.chmod(sharedEditsDir.getAbsolutePath(), "-w",
+          true);
+      if (chmodSucceeded != 0) {
+        LOG.error("Failed to remove write permissions on shared edits dir:"
+            + sharedEditsDir.getAbsolutePath());
+      }
+
       NameNode nn0 = cluster.getNameNode(0);
       try {
         // Make sure that subsequent operations on the NN fail.
@@ -171,6 +179,10 @@ public class TestFailureOfSharedDir {
             NNStorage.getInProgressEditsFileName(1));
       }
     } finally {
+      if (chmodSucceeded == 0) {
+        // without this test cleanup will fail
+        FileUtil.chmod(sharedEditsDir.getAbsolutePath(), "+w", true);
+      }
       if (cluster != null) {
         cluster.shutdown();
       }



Mime
View raw message