|
@@ -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,
|