Yi Liu created HDFS-7638:
----------------------------
Summary: Small fix and few refinements for FSN#truncate
Key: HDFS-7638
URL: https://issues.apache.org/jira/browse/HDFS-7638
Project: Hadoop HDFS
Issue Type: Sub-task
Reporter: Yi Liu
Assignee: Yi Liu
Fix For: 2.7.0
*1.*
{code}
removeBlocks(collectedBlocks);
{code}
should be after {{logSync}}, as we do in other FSN places (rename, delete,
write with overwrite), the reason is discussed in HDFS-2815 and
https://issues.apache.org/jira/browse/HDFS-6871?focusedCommentId=14110068&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14110068
*2.*
{code}
stat = FSDirStatAndListingOp.getFileInfo(dir, src, false,
FSDirectory.isReservedRawName(src), true);
{code}
We'd better to use {{dir.getAuditFileInfo}}, since it's only for audit log. If
audit log is not on, we don't need to get the file info.
*3.*
In {{truncateInternal}},
{code}
INodeFile file = iip.getLastINode().asFile();
{code}
is not necessary.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)