Browse Source

HDFS-2714. Fix test cases which use standalone FSNamesystems. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1225708 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon 13 years ago
parent
commit
15ebdd5664

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

@@ -75,3 +75,5 @@ HDFS-2682. When a FailoverProxyProvider is used, Client should not retry for 45
 HDFS-2693. Fix synchronization issues around state transition (todd)
 
 HDFS-1972. Fencing mechanism for block invalidations and replications (todd)
+
+HDFS-2714. Fix test cases which use standalone FSNamesystems (todd)

+ 4 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -579,7 +579,10 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
   
   
   void checkOperation(OperationCategory op) throws StandbyException {
-    haContext.checkOperation(op);
+    if (haContext != null) {
+      // null in some unit tests
+      haContext.checkOperation(op);
+    }
   }
   
   public static Collection<URI> getNamespaceDirs(Configuration conf) {

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLogRace.java

@@ -375,6 +375,7 @@ public class TestEditLogRace {
                 true);
             LOG.info("mkdirs complete");
           } catch (Throwable ioe) {
+            LOG.fatal("Got exception", ioe);
             deferredException.set(ioe);
             waitToEnterFlush.countDown();
           }
@@ -469,6 +470,7 @@ public class TestEditLogRace {
                 true);
             LOG.info("mkdirs complete");
           } catch (Throwable ioe) {
+            LOG.fatal("Got exception", ioe);
             deferredException.set(ioe);
             waitToEnterSync.countDown();
           }