HDFS-9290. DFSClient#callAppend() is not backward compatible for slightly older NameNodes. Contributed by Tony Wu.
(cherry picked from commit b9e0417bdf
)
Conflicts:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
This commit is contained in:
parent
2b6ce20e1c
commit
f2fd011cc1
|
@ -72,6 +72,9 @@ Release 2.7.2 - UNRELEASED
|
||||||
HDFS-9220. Reading small file (< 512 bytes) that is open for append fails
|
HDFS-9220. Reading small file (< 512 bytes) that is open for append fails
|
||||||
due to incorrect checksum (Jing Zhao via kihwal)
|
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
|
Release 2.7.1 - 2015-07-06
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -1807,9 +1807,15 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
||||||
try {
|
try {
|
||||||
LastBlockWithStatus blkWithStatus = namenode.append(src, clientName,
|
LastBlockWithStatus blkWithStatus = namenode.append(src, clientName,
|
||||||
new EnumSetWritable<>(flag, CreateFlag.class));
|
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,
|
return DFSOutputStream.newStreamForAppend(this, src, flag, buffersize,
|
||||||
progress, blkWithStatus.getLastBlock(),
|
progress, blkWithStatus.getLastBlock(),
|
||||||
blkWithStatus.getFileStatus(), dfsClientConf.createChecksum(),
|
status, dfsClientConf.createChecksum(),
|
||||||
favoredNodes);
|
favoredNodes);
|
||||||
} catch(RemoteException re) {
|
} catch(RemoteException re) {
|
||||||
throw re.unwrapRemoteException(AccessControlException.class,
|
throw re.unwrapRemoteException(AccessControlException.class,
|
||||||
|
|
Loading…
Reference in New Issue