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 2020/10/14 09:37:10 UTC

[GitHub] [hadoop-ozone] linyiqun commented on a change in pull request #1495: HDDS-4343: ReplicationManager.handleOverReplicatedContainer() does not handle unhealthyReplicas properly.

linyiqun commented on a change in pull request #1495:
URL: https://github.com/apache/hadoop-ozone/pull/1495#discussion_r504539793



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
##########
@@ -746,8 +746,9 @@ private void handleOverReplicatedContainer(final ContainerInfo container,
         if (excess > 0) {
           sendDeleteCommand(container, r.getDatanodeDetails(), true);
           excess -= 1;
+        } else {
+          break;
         }
-        break;

Review comment:
       Looking into this PR change, I am thinking if we still need to do excess check before sending delete command for unhealthy containers. As we want to remove all unhealthy container replicas, we can just send delete command and decrease the excess count by the way.
   
   I prefer simplified the logic like below:
   ```java
         for (ContainerReplica r : unhealthyReplicas) {
             sendDeleteCommand(container, r.getDatanodeDetails(), true);
             excess -= 1;
         }
   ```




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

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



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