[
https://issues.apache.org/jira/browse/HDFS-9662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lin Yiqun updated HDFS-9662:
----------------------------
Resolution: Invalid
Status: Resolved (was: Patch Available)
Thanks for comments. I mark this issue as invalid. But I have one suggestion
that maybe we should add more concrete explanation in checkFileProgress
annotation when checking penultimate block.Like this:
{code}
/**
* Check that the indicated file's blocks are present and
* replicated. If not, return false. If checkall is true, then check
* all blocks, otherwise check only penultimate block. If the penultimate
block
* not existed, it indicated the file has no blocks or just one block, also
* return true.
*/
boolean checkFileProgress(String src, INodeFile v, boolean checkall) {
assert hasReadLock();
if (checkall) {
return blockManager.checkBlocksProperlyReplicated(src, v
.getBlocks());
} else {
// check the penultimate block of this file
BlockInfo b = v.getPenultimateBlock();
return b == null ||
blockManager.checkBlocksProperlyReplicated(
src, new BlockInfo[] { b });
}
}
{code}
> Wrong checking penultimate block replicated in FSNamesystem
> -----------------------------------------------------------
>
> Key: HDFS-9662
> URL: https://issues.apache.org/jira/browse/HDFS-9662
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 2.7.1
> Reporter: Lin Yiqun
> Assignee: Lin Yiqun
> Attachments: HDFS-9662.001.patch, HDFS-9662.002.patch
>
>
> There is a bug in checking penultimate block replicated in FSNamesystem.
> {code}
> /**
> * Check that the indicated file's blocks are present and
> * replicated. If not, return false. If checkall is true, then check
> * all blocks, otherwise check only penultimate block.
> */
> boolean checkFileProgress(String src, INodeFile v, boolean checkall) {
> assert hasReadLock();
> if (checkall) {
> return blockManager.checkBlocksProperlyReplicated(src, v
> .getBlocks());
> } else {
> // check the penultimate block of this file
> BlockInfo b = v.getPenultimateBlock();
> return b == null ||
> blockManager.checkBlocksProperlyReplicated(
> src, new BlockInfo[] { b });
> }
> }
> {code}
> When the param checkall is true, the checking operations is true.But if
> checkall is false, it will check the penultimate block of this file. And if
> the BlockInfo b is null, it will return true by this code, but actually it
> should be return false because the penultimate block is not replicated and
> has no blockInfo.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)