From 1dabd429995ead0a6e82d2c5510dac65b89b1ca6 Mon Sep 17 00:00:00 2001 From: Uma Maheswara Rao G Date: Mon, 16 Dec 2013 09:53:57 +0000 Subject: [PATCH] HDFS-5592. statechangeLog of completeFile should be logged only in case of success. Contributed by Vinay. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1551145 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 4608f2d80c..cfbc616fdc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -817,6 +817,9 @@ Release 2.3.0 - UNRELEASED HDFS-4983. Numeric usernames do not work with WebHDFS FS. (Yongjun Zhang via jing9) + HDFS-5592. statechangeLog of completeFile should be logged only in case of success. + (Vinayakumar via umamahesh) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 015b9687ca..63756348e9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -2877,8 +2877,10 @@ boolean completeFile(String src, String holder, writeUnlock(); } getEditLog().logSync(); - NameNode.stateChangeLog.info("DIR* completeFile: " + src + " is closed by " - + holder); + if (success) { + NameNode.stateChangeLog.info("DIR* completeFile: " + src + + " is closed by " + holder); + } return success; }