[
https://issues.apache.org/jira/browse/HDFS-8418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14549640#comment-14549640
]
Yi Liu commented on HDFS-8418:
------------------------------
Thanks Jing for the review!
{quote}
The only minor question is whether we also want to update
INodeFile#getPreferredBlockReplication since it already takes into account the
striped blocks
{quote}
Thanks, I ever considered this too, {{INodeFile#getPreferredBlockReplication}}
is method of {{INodeFile}}, not method of {{BlockInfo}}. So in the patch, I
calculate the expected replica number for block, and keep unchanged for
{{INodeFile#getPreferredBlockReplication}}. Not sure I get your meaning, Jing,
or you have some suggest to change {{INodeFile#getPreferredBlockReplication}}?
BTW, I check the Findbugs and test failure, they are unrelated to this patch or
can't be reproduced in latest branch.
> Fix the isNeededReplication calculation for Striped block in NN
> ---------------------------------------------------------------
>
> Key: HDFS-8418
> URL: https://issues.apache.org/jira/browse/HDFS-8418
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Yi Liu
> Assignee: Yi Liu
> Priority: Critical
> Attachments: HDFS-8418-HDFS-7285.001.patch
>
>
> Currently when calculating {{isNeededReplication}} for striped block, we use
> BlockCollection#getPreferredBlockReplication to get expected replica number
> for striped block. See an example:
> {code}
> public void checkReplication(BlockCollection bc) {
> final short expected = bc.getPreferredBlockReplication();
> for (BlockInfo block : bc.getBlocks()) {
> final NumberReplicas n = countNodes(block);
> if (isNeededReplication(block, expected, n.liveReplicas())) {
> neededReplications.add(block, n.liveReplicas(),
> n.decommissionedAndDecommissioning(), expected);
> } else if (n.liveReplicas() > expected) {
> processOverReplicatedBlock(block, expected, null, null);
> }
> }
> }
> {code}
> But actually it's not correct, for example, if the length of striped file is
> less than a cell, then the expected replica of the block should be {{1 +
> parityBlkNum}} instead of {{dataBlkNum + parityBlkNum}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)