[ https://issues.apache.org/jira/browse/HDFS-7638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yi Liu updated HDFS-7638: ------------------------- Attachment: HDFS-7638.001.patch > 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 > Components: datanode, namenode > Reporter: Yi Liu > Assignee: Yi Liu > Fix For: 2.7.0 > > Attachments: HDFS-7638.001.patch > > > *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)