siddhantsangwan commented on code in PR #4227:
URL: https://github.com/apache/ozone/pull/4227#discussion_r1100049159


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisOverReplicationHandler.java:
##########
@@ -95,12 +96,11 @@ public Set<Pair<DatanodeDetails, SCMCommand<?>>> 
processAndCreateCommands(
     Set<ContainerReplica> healthyReplicas = replicas.stream()
         .filter(r -> ReplicationManager.getNodeStatus(
             r.getDatanodeDetails(), nodeManager).isHealthy()
-        )
-        .collect(Collectors.toSet());
+        ).collect(Collectors.toSet());
 
     RatisContainerReplicaCount replicaCount =
         new RatisContainerReplicaCount(containerInfo, healthyReplicas,
-            pendingOps, minHealthyForMaintenance);
+            pendingOps, minHealthyForMaintenance, true);

Review Comment:
   When checking for over replication of healthy replicas, we have a stricter 
check in `RatisReplicationCheckHandler`:
   ```
         if (!overHealth.isReplicatedOkAfterPending() &&
             !overHealth.hasMismatchedReplicas()) {
           request.getReplicationQueue().enqueue(overHealth);
         }
   ```
   This means we don't enqueue at all if there are some mismatched replicas. 
This is the same point (number 5) that I put in the description above. This 
logic is different from Legacy but I couldn't come up with a good way to check 
for sufficient number of matching replicas.
   
   When considering unhealthy replicas, we first verify there is perfect 
replication (no under/over) in  
`RatisUnhealthyReplicationCheckHandler#verifyPerfectReplication`.
   



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