Parcourir la source

HDFS-11709. StandbyCheckpointer should handle an non-existing legacyOivImageDir gracefully. Contributed by Erik Krogen.

(cherry picked from commit d8a33098309f17dfb0e3a000934f68394de44bf7)
(cherry picked from commit fc46f398d9192e83c7197115589eca7805c49943)
(cherry picked from commit 70f18911c71c61f9b3918e195bfb9a99d22d230c)
Zhe Zhang il y a 8 ans
Parent
commit
bec23593b5

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

@@ -244,6 +244,9 @@ Release 2.7.4 - UNRELEASED
     HDFS-10455. Logging the username when deny the setOwner operation.
     (Tianyi Xu and Rakesh R via Brahma Reddy Battula)
 
+    HDFS-11709. StandbyCheckpointer should handle an non-existing legacyOivImageDir
+    gracefully. (Erik Krogen via zhz)
+
 Release 2.7.3 - 2016-08-25
 
   INCOMPATIBLE CHANGES

+ 6 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/StandbyCheckpointer.java

@@ -190,7 +190,12 @@ public class StandbyCheckpointer {
       // Save the legacy OIV image, if the output dir is defined.
       String outputDir = checkpointConf.getLegacyOivImageDir();
       if (outputDir != null && !outputDir.isEmpty()) {
-        img.saveLegacyOIVImage(namesystem, outputDir, canceler);
+        try {
+          img.saveLegacyOIVImage(namesystem, outputDir, canceler);
+        } catch (IOException ioe) {
+          LOG.error("Exception encountered while saving legacy OIV image; "
+                  + "continuing with other checkpointing steps", ioe);
+        }
       }
     } finally {
       namesystem.cpUnlock();