HDFS-9290. DFSClient#callAppend() is not backward compatible for slightly older NameNodes. Contributed by Tony Wu.

This commit is contained in:
Kihwal Lee 2015-10-23 16:37:45 -05:00
parent ab3c4cff4a
commit b9e0417bdf
2 changed files with 10 additions and 1 deletions

View File

@ -1296,8 +1296,14 @@ 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, progress,
blkWithStatus.getLastBlock(), blkWithStatus.getFileStatus(),
blkWithStatus.getLastBlock(), status,
dfsClientConf.createChecksum(null), favoredNodes);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,

View File

@ -2189,6 +2189,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