You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by so...@apache.org on 2023/08/14 14:36:13 UTC
[ozone] branch master updated: HDDS-9167. Improve debug logging in SCMCommonPlacementPolicy when validating nodes (#5184)
This is an automated email from the ASF dual-hosted git repository.
sodonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new c32ccabd47 HDDS-9167. Improve debug logging in SCMCommonPlacementPolicy when validating nodes (#5184)
c32ccabd47 is described below
commit c32ccabd472ff0c02fd9cea11e44975fccd6658f
Author: Stephen O'Donnell <st...@gmail.com>
AuthorDate: Mon Aug 14 15:36:05 2023 +0100
HDDS-9167. Improve debug logging in SCMCommonPlacementPolicy when validating nodes (#5184)
---
.../hadoop/hdds/scm/SCMCommonPlacementPolicy.java | 31 ++++++++++++++--------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java
index 151e72227a..c575f740e7 100644
--- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java
+++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java
@@ -318,6 +318,8 @@ public abstract class SCMCommonPlacementPolicy implements
}
if (!enoughForData) {
+ LOG.debug("Datanode {} has no volumes with enough space to allocate {} " +
+ "bytes for data.", datanodeDetails, dataSizeRequired);
return false;
}
@@ -332,8 +334,11 @@ public abstract class SCMCommonPlacementPolicy implements
} else {
enoughForMeta = true;
}
-
- return enoughForData && enoughForMeta;
+ if (!enoughForMeta) {
+ LOG.debug("Datanode {} has no volumes with enough space to allocate {} " +
+ "bytes for metadata.", datanodeDetails, metadataSizeRequired);
+ }
+ return enoughForMeta;
}
/**
@@ -481,16 +486,20 @@ public abstract class SCMCommonPlacementPolicy implements
if (datanodeInfo == null) {
LOG.error("Failed to find the DatanodeInfo for datanode {}",
datanodeDetails);
- } else {
- if (datanodeInfo.getNodeStatus().isNodeWritable() &&
- (hasEnoughSpace(datanodeInfo, metadataSizeRequired,
- dataSizeRequired))) {
- LOG.debug("Datanode {} is chosen. Required metadata size is {} and " +
- "required data size is {}",
- datanodeDetails, metadataSizeRequired, dataSizeRequired);
- return true;
- }
+ return false;
+ }
+ NodeStatus nodeStatus = datanodeInfo.getNodeStatus();
+ if (nodeStatus.isNodeWritable() &&
+ (hasEnoughSpace(datanodeInfo, metadataSizeRequired,
+ dataSizeRequired))) {
+ LOG.debug("Datanode {} is chosen. Required metadata size is {} and " +
+ "required data size is {} and NodeStatus is {}",
+ datanodeDetails, metadataSizeRequired, dataSizeRequired, nodeStatus);
+ return true;
}
+ LOG.debug("Datanode {} is not chosen. Required metadata size is {} and " +
+ "required data size is {} and NodeStatus is {}",
+ datanodeDetails, metadataSizeRequired, dataSizeRequired, nodeStatus);
return false;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org