HDFS-16427. Add debug log for BlockManager#chooseExcessRedundancyStriped (#3888)

(cherry picked from commit 6136d630a3)
This commit is contained in:
litao 2022-01-27 12:42:44 +08:00 committed by Takanobu Asanuma
parent d613776b64
commit b5d2e00f81

View File

@ -4020,6 +4020,14 @@ private void chooseExcessRedundancyStriped(BlockCollection bc,
List<DatanodeStorageInfo> replicasToDelete = placementPolicy
.chooseReplicasToDelete(nonExcess, candidates, (short) 1,
excessTypes, null, null);
if (LOG.isDebugEnabled()) {
LOG.debug("Choose redundant EC replicas to delete from blk_{} which is located in {}",
sblk.getBlockId(), storage2index);
LOG.debug("Storages with candidate blocks to be deleted: {}", candidates);
LOG.debug("Storages with blocks to be deleted: {}", replicasToDelete);
}
Preconditions.checkArgument(candidates.containsAll(replicasToDelete),
"The EC replicas to be deleted are not in the candidate list");
for (DatanodeStorageInfo chosen : replicasToDelete) {
processChosenExcessRedundancy(nonExcess, chosen, storedBlock);
candidates.remove(chosen);