Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
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().