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

(cherry picked from commit d8a3309830)
This commit is contained in:
Zhe Zhang 2017-04-27 09:50:30 -07:00
parent b500714e98
commit fc46f398d9
1 changed files with 6 additions and 1 deletions

View File

@ -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();