hanishakoneru commented on code in PR #3258:
URL: https://github.com/apache/ozone/pull/3258#discussion_r846428976


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java:
##########
@@ -1308,15 +1323,19 @@ private void handleOverReplicatedContainer(final 
ContainerInfo container,
           r.getDatanodeDetails().getPersistedOpState() !=
               HddsProtos.NodeOperationalState.IN_SERVICE);
 
+      // If there are unhealthy replicas, then we should remove them even if it
+      // makes the container violate the placement policy, as excess unhealthy
+      // containers are not really useful. It will be corrected later as a
+      // mis-replicated container will be seen as under-replicated.
+      // Update - delete only those unhealthy replicas which have bcsId <
+      // container bcsId
+
       final List<ContainerReplica> unhealthyReplicas = eligibleReplicas
           .stream()
           .filter(r -> !compareState(container.getState(), r.getState()))
+          .filter(r -> r.getSequenceId() > container.getSequenceId())

Review Comment:
   Yes. Thanks @guihecheng for catching this.



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