You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Yi Liu (JIRA)" <ji...@apache.org> on 2015/05/18 07:23:00 UTC

[jira] [Created] (HDFS-8418) Fix the isNeededReplication calculation for Striped block in NN

Yi Liu created HDFS-8418:
----------------------------

             Summary: 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


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}}. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)