You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by lj...@apache.org on 2021/07/20 05:31:56 UTC

[ozone] branch master updated: HDDS-5464. fail move if node is not in IN_SERVICE state (#2437)

This is an automated email from the ASF dual-hosted git repository.

ljain pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 24f5641  HDDS-5464. fail move if node is not in IN_SERVICE state (#2437)
24f5641 is described below

commit 24f56415829732ce0b4197d8df97eb65120ed46d
Author: Jackson Yao <ja...@tencent.com>
AuthorDate: Tue Jul 20 13:31:33 2021 +0800

    HDDS-5464. fail move if node is not in IN_SERVICE state (#2437)
---
 .../hadoop/hdds/scm/container/ReplicationManager.java      | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
index d647055..104ef28 100644
--- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
+++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
@@ -172,6 +172,8 @@ public class ReplicationManager implements MetricsSource, SCMService {
     REPLICATION_FAIL_NODE_NOT_IN_SERVICE,
     // replication fail because node is unhealthy
     REPLICATION_FAIL_NODE_UNHEALTHY,
+    // deletion fail because of node is not in service
+    DELETION_FAIL_NODE_NOT_IN_SERVICE,
     // replication succeed, but deletion fail because of timeout
     DELETION_FAIL_TIME_OUT,
     // replication succeed, but deletion fail because because
@@ -532,7 +534,7 @@ public class ReplicationManager implements MetricsSource, SCMService {
           if (isCompleted || isUnhealthy || isTimeout || isNotInService) {
             iter.remove();
             updateMoveIfNeeded(isUnhealthy, isCompleted, isTimeout,
-                container, a.datanode, inflightActions);
+                isNotInService, container, a.datanode, inflightActions);
           }
         } catch (NodeNotFoundException | ContainerNotFoundException e) {
           // Should not happen, but if it does, just remove the action as the
@@ -558,6 +560,7 @@ public class ReplicationManager implements MetricsSource, SCMService {
    */
   private void updateMoveIfNeeded(final boolean isUnhealthy,
                    final boolean isCompleted, final boolean isTimeout,
+                   final boolean isNotInService,
                    final ContainerInfo container, final DatanodeDetails dn,
                    final Map<ContainerID,
                        List<InflightAction>> inflightActions)
@@ -613,6 +616,9 @@ public class ReplicationManager implements MetricsSource, SCMService {
         if (isUnhealthy) {
           inflightMoveFuture.get(id).complete(
               MoveResult.REPLICATION_FAIL_NODE_UNHEALTHY);
+        } else if (isNotInService) {
+          inflightMoveFuture.get(id).complete(
+              MoveResult.REPLICATION_FAIL_NODE_NOT_IN_SERVICE);
         } else {
           inflightMoveFuture.get(id).complete(
               MoveResult.REPLICATION_FAIL_TIME_OUT);
@@ -624,6 +630,9 @@ public class ReplicationManager implements MetricsSource, SCMService {
         } else if (isTimeout) {
           inflightMoveFuture.get(id).complete(
               MoveResult.DELETION_FAIL_TIME_OUT);
+        } else if (isNotInService) {
+          inflightMoveFuture.get(id).complete(
+              MoveResult.DELETION_FAIL_NODE_NOT_IN_SERVICE);
         } else {
           inflightMoveFuture.get(id).complete(
               MoveResult.COMPLETED);
@@ -1294,7 +1303,8 @@ public class ReplicationManager implements MetricsSource, SCMService {
   private boolean isPlacementStatusActuallyEqual(
                       ContainerPlacementStatus cps1,
                       ContainerPlacementStatus cps2) {
-    return cps1.actualPlacementCount() == cps2.actualPlacementCount() ||
+    return (!cps1.isPolicySatisfied() &&
+        cps1.actualPlacementCount() == cps2.actualPlacementCount()) ||
         cps1.isPolicySatisfied() && cps2.isPolicySatisfied();
   }
 

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