You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Pochatkin (via GitHub)" <gi...@apache.org> on 2023/06/27 09:54:52 UTC

[GitHub] [ignite-3] Pochatkin commented on a diff in pull request #2238: IGNITE-19694 Introduce deployment unit operation ID

Pochatkin commented on code in PR #2238:
URL: https://github.com/apache/ignite-3/pull/2238#discussion_r1243469230


##########
modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/metastore/DeploymentUnitFailover.java:
##########
@@ -113,12 +116,43 @@ private void processStatus(UnitClusterStatus unitClusterStatus, UnitNodeStatus u
             case REMOVING:
                 deploymentUnitStore.getAllNodeStatuses(id, version)
                         .thenAccept(nodes -> {
-                            UnitNodeStatus status = new UnitNodeStatus(id, version, REMOVING, nodeName);
+                            UnitNodeStatus status = new UnitNodeStatus(id, version, REMOVING, unitClusterStatus.opId(), nodeName);
                             nodeEventCallback.onUpdate(status, nodes);
                         });
                 break;
             default:
                 break;
         }
     }
+
+    private boolean checkClusterNullStatus(String id, Version version, UnitClusterStatus clusterStatus) {
+        if (clusterStatus == null) {
+            deployer.undeploy(id, version)
+                    .thenAccept(success -> {
+                        if (success) {
+                            deploymentUnitStore.removeNodeStatus(nodeName, id, version);
+                        }
+                    });
+            return true;
+        }
+        return false;
+    }
+
+    private boolean checkAbaProblem(UnitClusterStatus clusterStatus, UnitNodeStatus nodeStatus) {
+        String id = nodeStatus.id();
+        Version version = nodeStatus.version();
+        if (clusterStatus.opId() != nodeStatus.opId()) {
+            if (nodeStatus.status() == DEPLOYED) {
+                deployer.undeploy(id, version).thenAccept(success -> {
+                    if (success) {
+                        deploymentUnitStore.removeNodeStatus(nodeName, id, version);
+                    }
+                });
+            } else {
+                deploymentUnitStore.removeNodeStatus(nodeName, id, version);

Review Comment:
   This `nodeStatus` can't be changed, because failover start to download unit content after this ABA check



-- 
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: notifications-unsubscribe@ignite.apache.org

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