ソースを参照

HDFS-1910. NameNode should not save fsimage twice. Contributed by Konstantin Shvachko.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1229448 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 13 年 前
コミット
128a2fc4eb

+ 2 - 0
CHANGES.txt

@@ -81,6 +81,8 @@ Release 1.1.0 - unreleased
 
     HDFS-2728. Remove dfsadmin -printTopology from branch-1 docs since it does not exist. (harsh)
 
+    HDFS-1910. NameNode should not save fsimage twice. (shv)
+
   IMPROVEMENTS
 
     MAPREDUCE-2517. Add system tests to Gridmix. (Vinay Thota via amarrk)

+ 2 - 0
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java

@@ -1113,6 +1113,8 @@ public class FSImage extends Storage {
                                                               it.hasNext();) {
       StorageDirectory sd = it.next();
       try {
+        if (sd.getStorageDirType().isOfType(NameNodeDirType.IMAGE_AND_EDITS))
+          continue; // this has already been saved as IMAGE directory
         saveCurrent(sd);
       } catch(IOException ie) {
         LOG.error("Unable to save edits for " + sd.getRoot(), ie);