[
https://issues.apache.org/jira/browse/HDFS-8982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14724059#comment-14724059
]
Colin Patrick McCabe commented on HDFS-8982:
--------------------------------------------
[~wheat9]: it seems to me that it should be
{{INodeFile#getPreferredBlockReplication}} instead of
{{INodeFile#getFileReplication}} here:
{code}
} else {
// OP_CLOSE should add finalized blocks. This code path
// is only executed when loading edits written by prior
// versions of Hadoop. Current versions always log
// OP_ADD operations as each block is allocated.
newBI = new BlockInfoContiguous(newBlock,
file.getFileReplication());
}
{code}
The reason is because the file may exist in prior snapshots with a different
replication factor, which will not be accounted for by {{getFileReplication}},
but which would be covered by {{getPreferredBlockReplication}}. Probably this
bug hasn't been noticed since this code path only gets followed when loading
old edits files.
bq. Currently INodeFile provides both getFileReplication and
getPreferredBlockReplication interfaces. At the very least they should be
renamed (e.g. getCurrentFileReplication and getMaxConfiguredFileReplication),
with clearer Javadoc.
I am not sure that they need to be renamed as long as the documentation is
clear.
In general, we should keep JIRAs open until there is a consensus that they
should be closed.
> Consolidate getFileReplication and getPreferredBlockReplication in INodeFile
> ----------------------------------------------------------------------------
>
> Key: HDFS-8982
> URL: https://issues.apache.org/jira/browse/HDFS-8982
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Affects Versions: 2.7.1
> Reporter: Zhe Zhang
>
> Currently {{INodeFile}} provides both {{getFileReplication}} and
> {{getPreferredBlockReplication}} interfaces. At the very least they should be
> renamed (e.g. {{getCurrentFileReplication}} and
> {{getMaxConfiguredFileReplication}}), with clearer Javadoc.
> I also suspect we are not using them correctly in all places right now.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)