|
@@ -48,7 +48,7 @@ class ErasureCodingWork extends BlockReconstructionWork {
|
|
|
this.blockPoolId = blockPoolId;
|
|
|
this.liveBlockIndices = liveBlockIndices;
|
|
|
this.liveBusyBlockIndices = liveBusyBlockIndices;
|
|
|
- this.excludeReconstructedIndices=excludeReconstrutedIndices;
|
|
|
+ this.excludeReconstructedIndices = excludeReconstrutedIndices;
|
|
|
LOG.debug("Creating an ErasureCodingWork to {} reconstruct ",
|
|
|
block);
|
|
|
}
|
|
@@ -62,10 +62,18 @@ class ErasureCodingWork extends BlockReconstructionWork {
|
|
|
BlockStoragePolicySuite storagePolicySuite,
|
|
|
Set<Node> excludedNodes) {
|
|
|
// TODO: new placement policy for EC considering multiple writers
|
|
|
- DatanodeStorageInfo[] chosenTargets = blockplacement.chooseTarget(
|
|
|
- getSrcPath(), getAdditionalReplRequired(), getSrcNodes()[0],
|
|
|
- getLiveReplicaStorages(), false, excludedNodes, getBlockSize(),
|
|
|
- storagePolicySuite.getPolicy(getStoragePolicyID()), null);
|
|
|
+ DatanodeStorageInfo[] chosenTargets = null;
|
|
|
+ // HDFS-14720. If the block is deleted, the block size will become
|
|
|
+ // BlockCommand.NO_ACK (LONG.MAX_VALUE) . This kind of block we don't need
|
|
|
+ // to send for replication or reconstruction
|
|
|
+ if (!getBlock().isDeleted()) {
|
|
|
+ chosenTargets = blockplacement.chooseTarget(
|
|
|
+ getSrcPath(), getAdditionalReplRequired(), getSrcNodes()[0],
|
|
|
+ getLiveReplicaStorages(), false, excludedNodes, getBlockSize(),
|
|
|
+ storagePolicySuite.getPolicy(getStoragePolicyID()), null);
|
|
|
+ } else {
|
|
|
+ LOG.warn("ErasureCodingWork could not need choose targets for {}", getBlock());
|
|
|
+ }
|
|
|
setTargets(chosenTargets);
|
|
|
}
|
|
|
|