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

This commit is contained in:
litao 2022-01-27 12:42:44 +08:00 committed by GitHub
parent c2ff39006f
commit 6136d630a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -4060,6 +4060,14 @@ public class BlockManager implements BlockStatsMXBean {
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);