Repository: hadoop Updated Branches: refs/heads/branch-2.7 2b6ce20e1 -> f2fd011cc
HDFS-9290. DFSClient#callAppend() is not backward compatible for slightly older NameNodes. Contributed by Tony Wu. (cherry picked from commit b9e0417bdf2b9655dc4256bdb43683eca1ab46be) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f2fd011c Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f2fd011c Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f2fd011c Branch: refs/heads/branch-2.7 Commit: f2fd011cc1f5a9296c02a46d060acc94fa11600b Parents: 2b6ce20 Author: Kihwal Lee <kih...@apache.org> Authored: Fri Oct 23 16:46:14 2015 -0500 Committer: Kihwal Lee <kih...@apache.org> Committed: Fri Oct 23 16:46:14 2015 -0500 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/hdfs/DFSClient.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/f2fd011c/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index d7884e8..0ff7733 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -72,6 +72,9 @@ Release 2.7.2 - UNRELEASED HDFS-9220. Reading small file (< 512 bytes) that is open for append fails due to incorrect checksum (Jing Zhao via kihwal) + HDFS-9290. DFSClient#callAppend() is not backward compatible for slightly + older NameNodes. (Tony Wu via kihwal) + Release 2.7.1 - 2015-07-06 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/f2fd011c/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java index e663873..58d93cd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java @@ -1807,9 +1807,15 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory, try { LastBlockWithStatus blkWithStatus = namenode.append(src, clientName, new EnumSetWritable<>(flag, CreateFlag.class)); + HdfsFileStatus status = blkWithStatus.getFileStatus(); + if (status == null) { + DFSClient.LOG.debug("NameNode is on an older version, request file " + + "info with additional RPC call for file: " + src); + status = getFileInfo(src); + } return DFSOutputStream.newStreamForAppend(this, src, flag, buffersize, progress, blkWithStatus.getLastBlock(), - blkWithStatus.getFileStatus(), dfsClientConf.createChecksum(), + status, dfsClientConf.createChecksum(), favoredNodes); } catch(RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class,