KevinWikant commented on code in PR #7179:
URL: https://github.com/apache/hadoop/pull/7179#discussion_r1893088532
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminDefaultMonitor.java:
##########
@@ -290,22 +298,33 @@ private void check() {
// If the full scan is clean AND the node liveness is okay,
// we can finally mark as DECOMMISSIONED or IN_MAINTENANCE.
if (blocks.size() == 0 && isHealthy) {
- if (dn.isDecommissionInProgress()) {
- dnAdmin.setDecommissioned(dn);
- toRemove.add(dn);
- } else if (dn.isEnteringMaintenance()) {
- // IN_MAINTENANCE node remains in the outOfServiceNodeBlocks to
- // to track maintenance expiration.
- dnAdmin.setInMaintenance(dn);
+ // Perform a final check to see if the datanode has any blocks in
+ // Under Construction state (blocks which are open for write)
+ if (ucBlocksByDatanode.containsKey(dn)) {
+ final List<Block> ucBlocks =
+ ucBlocksByDatanode.getOrDefault(dn, Collections.emptyList());
+ final String ucBlocksString =
+
ucBlocks.stream().map(Object::toString).collect(Collectors.joining(","));
+ LOG.info("Cannot decommission datanode {} with {} UC blocks:
[{}]",
Review Comment:
This log will be printed at most once per datanode per
DatanodeAdminDefaultMonitor cycle. This means in a 1k datanode HDFS cluster,
there could be up to 1k log lines printed every 30 seconds (if all the 1k
datanodes have under construction blocks).
This behaviour matches existing behaviour where if a decommissioning
datanode has under replicated blocks, then 1 log line will be printed every
single DatanodeAdminDefaultMonitor cycle (for each datanode):
-
https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminDefaultMonitor.java#L498
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]