0lai0 commented on code in PR #9135:
URL: https://github.com/apache/ozone/pull/9135#discussion_r2588116537


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ECContainerReplicaCount.java:
##########
@@ -573,6 +573,19 @@ public String toString() {
         .append(", ReplicationConfig: ").append(repConfig)
         .append(", RemainingMaintenanceRedundancy: ")
         .append(remainingMaintenanceRedundancy);
+    
+    if (!isSufficientlyReplicated()) {
+      List<Integer> missingIndexes = unavailableIndexes(true);
+      sb.append(' 
').append(ContainerHealthResult.ReplicationStatus.UNDER_REPLICATED)
+          .append(": missing indexes ").append(missingIndexes);
+    } else if (isOverReplicated()) {
+      List<Integer> excessIndexes = overReplicatedIndexes(false);
+      sb.append(' 
').append(ContainerHealthResult.ReplicationStatus.OVER_REPLICATED)
+          .append(": excess indexes ").append(excessIndexes);
+    } else {
+      sb.append(' 
').append(ContainerHealthResult.ReplicationStatus.HEALTHY_REPLICATION);
+    }
+      

Review Comment:
   Thanks for the clarification. It seems I went in the wrong function. I will 
remove under/over/healthy logic, and also remove 
RatisContainerReplicaCount.toString() relpication logic.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisContainerReplicaCount.java:
##########
@@ -257,6 +257,17 @@ public String toString() {
     if (considerUnhealthy) {
       result += " +considerUnhealthy";
     }
+
+    if (!isSufficientlyReplicated()) {
+      result += " " + ContainerHealthResult.ReplicationStatus.UNDER_REPLICATED 
+ ": need "
+          + additionalReplicaNeeded() + " more";
+    } else if (isOverReplicated()) {
+      result += " " + ContainerHealthResult.ReplicationStatus.OVER_REPLICATED 
+ ": excess "
+          + getExcessRedundancy(true) + " replica(s)";
+    } else {
+      result += " " + 
ContainerHealthResult.ReplicationStatus.HEALTHY_REPLICATION;
+    }
+    

Review Comment:
   Sure, thanks @adoroszlai for review.



-- 
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]

Reply via email to