Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8096

DatanodeMetrics#blocksReplicated will get incremented early and even for failed transfers

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

          case DatanodeProtocol.DNA_TRANSFER:
            // Send a copy of a block to another datanode
            dn.transferBlocks(bcmd.getBlockPoolId(), bcmd.getBlocks(),
                bcmd.getTargets(), bcmd.getTargetStorageTypes());
            dn.metrics.incrBlocksReplicated(bcmd.getBlocks().length);

      In the above code to handle replication transfers from namenode, DatanodeMetrics#blocksReplicated is getting incremented early, since the transfer will happen in background.
      And even failed transfers also getting counted.

      Correct place to increment this counter is DataTransfer#run().

        Attachments

          Activity

            People

            • Assignee:
              vinayrpet Vinayakumar B
              Reporter:
              vinayrpet Vinayakumar B
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: