sodonnel commented on a change in pull request #2598:
URL: https://github.com/apache/ozone/pull/2598#discussion_r699173614
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeAdminMonitorImpl.java
##########
@@ -284,9 +287,11 @@ private boolean
checkContainersReplicatedOnNode(DatanodeDetails dn)
if (replicaSet.isSufficientlyReplicated()) {
sufficientlyReplicated++;
} else {
+ underReplicatedIDs.add(cid);
Review comment:
I think we should wrap this line in `if (LOG.isDebugEnabled()) {` too -
as if debug is not enabled, we never use the lists, so there is no point in
adding to them.
Also, I wonder if we should set an upper bound on the list? Eg if there are
200,000 under replicated containers, is it really useful to log them all? Maybe
logging just the first 10 or 100 would be enough?
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeAdminMonitorImpl.java
##########
@@ -297,6 +302,14 @@ private boolean
checkContainersReplicatedOnNode(DatanodeDetails dn)
LOG.info("{} has {} sufficientlyReplicated, {} underReplicated and {} " +
"unhealthy containers",
dn, sufficientlyReplicated, underReplicated, unhealthy);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("{} has {} underReplicated [{}] and {} unhealthy [{}] " +
+ "containers", dn, underReplicated,
+ underReplicatedIDs.stream().map(
Review comment:
You can do the join more simply with:
```
String.join(",", list);
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeAdminMonitorImpl.java
##########
@@ -297,6 +302,14 @@ private boolean
checkContainersReplicatedOnNode(DatanodeDetails dn)
LOG.info("{} has {} sufficientlyReplicated, {} underReplicated and {} " +
"unhealthy containers",
dn, sufficientlyReplicated, underReplicated, unhealthy);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("{} has {} underReplicated [{}] and {} unhealthy [{}] " +
+ "containers", dn, underReplicated,
+ underReplicatedIDs.stream().map(
Review comment:
Actually, this might only work if the list is of type String. I am not
100% sure.
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeAdminMonitorImpl.java
##########
@@ -284,9 +287,11 @@ private boolean
checkContainersReplicatedOnNode(DatanodeDetails dn)
if (replicaSet.isSufficientlyReplicated()) {
sufficientlyReplicated++;
} else {
+ underReplicatedIDs.add(cid);
underReplicated++;
}
if (!replicaSet.isHealthy()) {
+ unhealthyIDs.add(cid);
Review comment:
Same as above for this line.
--
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]