hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhao (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-8418) Fix the isNeededReplication calculation for Striped block in NN
Date Tue, 19 May 2015 02:09:00 GMT

     [ https://issues.apache.org/jira/browse/HDFS-8418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jing Zhao updated HDFS-8418:
----------------------------
       Resolution: Fixed
    Fix Version/s: HDFS-7285
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

I've committed this. Thanks Yi for the contribution!

> 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
>             Fix For: HDFS-7285
>
>         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)

Mime
View raw message