xBis7 commented on code in PR #5726:
URL: https://github.com/apache/ozone/pull/5726#discussion_r1431339230


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java:
##########
@@ -445,6 +445,7 @@ public ContainerPlacementStatus validateContainerPlacement(
       }
     }
     List<Integer> currentRackCount = new ArrayList<>(dns.stream()
+        .filter(d -> !(d.isDecommissioned()))

Review Comment:
   @sodonnel Thanks for the explanation. I agree. I'll add all that as a 
comment because other people might have the same questions and confusion.
   
   Since over-replication shouldn't be considered as mis-replication, we should 
adjust the max replicas per node every time there are excessive replicas, 
right? We don't need to check for decommission or maintenance to perform the 
operation.
   
   I'm referring to something like this
   ```java
       int maxReplicasPerRack = getMaxReplicasPerRack(replicas,
               Math.min(requiredRacks, numRacks));
   
       boolean offlineNodeReplicas = dns.stream()
           .anyMatch(d -> d.isMaintenance() || d.isDecommissioned());
   
       if (offlineNodeReplicas) {
         // Adjust max replicas per rack for excessive replicas belonging to 
offline nodes.
         maxReplicasPerRack += Math.max(0, dns.size() - replicas);
       }
   ```



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