You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/04/06 03:53:06 UTC

[GitHub] [ozone] guihecheng commented on a diff in pull request #3258: HDDS-6447. Refine SCM handling of unhealthy container replicas

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


##########
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:
   Maybe a typo, should be r.getSequenceId() < container.getSequenceId() as the comments stated?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org