Browse Source

Amend HDFS-2795. Fix PersistBlocks failure due to an NPE in isPopulatingReplQueues()

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

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

@@ -3681,7 +3681,8 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
 
   @Override
   public boolean isPopulatingReplQueues() {
-    if (!haContext.getState().shouldPopulateReplQueues()) {
+    if (haContext != null && // null during startup!
+        !haContext.getState().shouldPopulateReplQueues()) {
       return false;
     }
     // safeMode is volatile, and may be set to null at any time