Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-7285 Erasure Coding Support inside HDFS
  3. HDFS-8418

Fix the isNeededReplication calculation for Striped block in NN

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • HDFS-7285
    • None
    • None
    • Reviewed

    Description

      Currently when calculating isNeededReplication for striped block, we use BlockCollection#getPreferredBlockReplication to get expected replica number for striped block. See an example:

      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);
            }
          }
        }
      

      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.

      Attachments

        Activity

          People

            hitliuyi Yi Liu
            hitliuyi Yi Liu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: