Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS-17675 BlockManager add logs #7190

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2180,13 +2180,16 @@ int computeReconstructionWorkForBlocks(
for (BlockReconstructionWork rw : reconWork) {
final DatanodeStorageInfo[] targets = rw.getTargets();
if (targets == null || targets.length == 0) {
LOG.debug("Block {} cannot find available target host", rw.getBlock());
rw.resetTargets();
continue;
}

synchronized (neededReconstruction) {
if (validateReconstructionWork(rw)) {
scheduledWork++;
} else {
LOG.debug("Block {} validation for reconstruction work failed", rw.getBlock());
}
}
}
Expand Down Expand Up @@ -2595,13 +2598,15 @@ DatanodeDescriptor[] chooseSourceDatanodes(BlockInfo block,
// do not select the replica if it is corrupt or excess
if (state == StoredReplicaState.CORRUPT ||
state == StoredReplicaState.EXCESS) {
LOG.debug("Block {} on storage {} cannot be chosen, state: {}", block, storage, state);
continue;
}

// Never use maintenance node not suitable for read
// or unknown state replicas.
if (state == null
|| state == StoredReplicaState.MAINTENANCE_NOT_FOR_READ) {
LOG.debug("Block {} on storage {} cannot be chosen, state: {}", block, storage, state);
continue;
}

Expand All @@ -2613,6 +2618,7 @@ DatanodeDescriptor[] chooseSourceDatanodes(BlockInfo block,
ThreadLocalRandom.current().nextBoolean()) {
decommissionedSrc = node;
}
LOG.debug("Block {} on storage {} cannot be chosen, state: {}, decommissionedSrc: {}", block, storage, state, decommissionedSrc);
continue;
}

Expand All @@ -2637,6 +2643,9 @@ DatanodeDescriptor[] chooseSourceDatanodes(BlockInfo block,
//HDFS-16566 ExcludeReconstructed won't be reconstructed.
excludeReconstructed.add(blockIndex);
}
if (node.getNumberOfBlocksToBeReplicated() >= maxReplicationStreams) {
LOG.warn("already reached replication limit, current: {}, maxReplicationStreams: {}", node.getNumberOfBlocksToBeReplicated(), maxReplicationStreams);
}
continue; // already reached replication limit
}

Expand All @@ -2648,6 +2657,7 @@ DatanodeDescriptor[] chooseSourceDatanodes(BlockInfo block,
//HDFS-16566 ExcludeReconstructed won't be reconstructed.
excludeReconstructed.add(blockIndex);
}
LOG.warn("already reached replication hard limit, current: {}, replicationStreamsHardLimit: {}", node.getNumberOfBlocksToBeReplicated(), replicationStreamsHardLimit);
continue;
}

Expand Down