|
@@ -949,7 +949,7 @@ public class BlockManager implements BlockStatsMXBean {
|
|
// source node returned is not used
|
|
// source node returned is not used
|
|
chooseSourceDatanodes(blockInfo, containingNodes,
|
|
chooseSourceDatanodes(blockInfo, containingNodes,
|
|
containingLiveReplicasNodes, numReplicas, new ArrayList<Byte>(),
|
|
containingLiveReplicasNodes, numReplicas, new ArrayList<Byte>(),
|
|
- new ArrayList<Byte>(), LowRedundancyBlocks.LEVEL);
|
|
|
|
|
|
+ new ArrayList<Byte>(), new ArrayList<Byte>(), LowRedundancyBlocks.LEVEL);
|
|
|
|
|
|
// containingLiveReplicasNodes can include READ_ONLY_SHARED replicas which are
|
|
// containingLiveReplicasNodes can include READ_ONLY_SHARED replicas which are
|
|
// not included in the numReplicas.liveReplicas() count
|
|
// not included in the numReplicas.liveReplicas() count
|
|
@@ -2195,9 +2195,10 @@ public class BlockManager implements BlockStatsMXBean {
|
|
NumberReplicas numReplicas = new NumberReplicas();
|
|
NumberReplicas numReplicas = new NumberReplicas();
|
|
List<Byte> liveBlockIndices = new ArrayList<>();
|
|
List<Byte> liveBlockIndices = new ArrayList<>();
|
|
List<Byte> liveBusyBlockIndices = new ArrayList<>();
|
|
List<Byte> liveBusyBlockIndices = new ArrayList<>();
|
|
|
|
+ List<Byte> excludeReconstructed = new ArrayList<>();
|
|
final DatanodeDescriptor[] srcNodes = chooseSourceDatanodes(block,
|
|
final DatanodeDescriptor[] srcNodes = chooseSourceDatanodes(block,
|
|
containingNodes, liveReplicaNodes, numReplicas,
|
|
containingNodes, liveReplicaNodes, numReplicas,
|
|
- liveBlockIndices, liveBusyBlockIndices, priority);
|
|
|
|
|
|
+ liveBlockIndices, liveBusyBlockIndices, excludeReconstructed, priority);
|
|
short requiredRedundancy = getExpectedLiveRedundancyNum(block,
|
|
short requiredRedundancy = getExpectedLiveRedundancyNum(block,
|
|
numReplicas);
|
|
numReplicas);
|
|
if(srcNodes == null || srcNodes.length == 0) {
|
|
if(srcNodes == null || srcNodes.length == 0) {
|
|
@@ -2267,9 +2268,13 @@ public class BlockManager implements BlockStatsMXBean {
|
|
for (int i = 0; i < liveBusyBlockIndices.size(); i++) {
|
|
for (int i = 0; i < liveBusyBlockIndices.size(); i++) {
|
|
busyIndices[i] = liveBusyBlockIndices.get(i);
|
|
busyIndices[i] = liveBusyBlockIndices.get(i);
|
|
}
|
|
}
|
|
|
|
+ byte[] excludeReconstructedIndices = new byte[excludeReconstructed.size()];
|
|
|
|
+ for (int i = 0; i < excludeReconstructed.size(); i++) {
|
|
|
|
+ excludeReconstructedIndices[i] = excludeReconstructed.get(i);
|
|
|
|
+ }
|
|
return new ErasureCodingWork(getBlockPoolId(), block, bc, newSrcNodes,
|
|
return new ErasureCodingWork(getBlockPoolId(), block, bc, newSrcNodes,
|
|
containingNodes, liveReplicaNodes, additionalReplRequired,
|
|
containingNodes, liveReplicaNodes, additionalReplRequired,
|
|
- priority, newIndices, busyIndices);
|
|
|
|
|
|
+ priority, newIndices, busyIndices, excludeReconstructedIndices);
|
|
} else {
|
|
} else {
|
|
return new ReplicationWork(block, bc, srcNodes,
|
|
return new ReplicationWork(block, bc, srcNodes,
|
|
containingNodes, liveReplicaNodes, additionalReplRequired,
|
|
containingNodes, liveReplicaNodes, additionalReplRequired,
|
|
@@ -2517,7 +2522,7 @@ public class BlockManager implements BlockStatsMXBean {
|
|
List<DatanodeDescriptor> containingNodes,
|
|
List<DatanodeDescriptor> containingNodes,
|
|
List<DatanodeStorageInfo> nodesContainingLiveReplicas,
|
|
List<DatanodeStorageInfo> nodesContainingLiveReplicas,
|
|
NumberReplicas numReplicas, List<Byte> liveBlockIndices,
|
|
NumberReplicas numReplicas, List<Byte> liveBlockIndices,
|
|
- List<Byte> liveBusyBlockIndices, int priority) {
|
|
|
|
|
|
+ List<Byte> liveBusyBlockIndices, List<Byte> excludeReconstructed, int priority) {
|
|
containingNodes.clear();
|
|
containingNodes.clear();
|
|
nodesContainingLiveReplicas.clear();
|
|
nodesContainingLiveReplicas.clear();
|
|
List<DatanodeDescriptor> srcNodes = new ArrayList<>();
|
|
List<DatanodeDescriptor> srcNodes = new ArrayList<>();
|
|
@@ -2587,6 +2592,8 @@ public class BlockManager implements BlockStatsMXBean {
|
|
if (isStriped && (state == StoredReplicaState.LIVE
|
|
if (isStriped && (state == StoredReplicaState.LIVE
|
|
|| state == StoredReplicaState.DECOMMISSIONING)) {
|
|
|| state == StoredReplicaState.DECOMMISSIONING)) {
|
|
liveBusyBlockIndices.add(blockIndex);
|
|
liveBusyBlockIndices.add(blockIndex);
|
|
|
|
+ //HDFS-16566 ExcludeReconstructed won't be reconstructed.
|
|
|
|
+ excludeReconstructed.add(blockIndex);
|
|
}
|
|
}
|
|
continue; // already reached replication limit
|
|
continue; // already reached replication limit
|
|
}
|
|
}
|
|
@@ -2595,6 +2602,8 @@ public class BlockManager implements BlockStatsMXBean {
|
|
if (isStriped && (state == StoredReplicaState.LIVE
|
|
if (isStriped && (state == StoredReplicaState.LIVE
|
|
|| state == StoredReplicaState.DECOMMISSIONING)) {
|
|
|| state == StoredReplicaState.DECOMMISSIONING)) {
|
|
liveBusyBlockIndices.add(blockIndex);
|
|
liveBusyBlockIndices.add(blockIndex);
|
|
|
|
+ //HDFS-16566 ExcludeReconstructed won't be reconstructed.
|
|
|
|
+ excludeReconstructed.add(blockIndex);
|
|
}
|
|
}
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|