valepakh commented on code in PR #2152:
URL: https://github.com/apache/ignite-3/pull/2152#discussion_r1223052290


##########
modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/DeploymentManagerImpl.java:
##########
@@ -151,32 +155,72 @@ private void onUnitRegister(UnitNodeStatus status, 
Set<String> deployedNodes) {
     }
 
     @Override
-    public CompletableFuture<Boolean> deployAsync(String id, Version version, 
boolean force, DeploymentUnit deploymentUnit) {
+    public CompletableFuture<Boolean> deployAsync(
+            String id,
+            Version version,
+            boolean force,
+            DeploymentUnit deploymentUnit,
+            InitialDeployMode deployMode
+    ) {
         checkId(id);
         Objects.requireNonNull(version);
         Objects.requireNonNull(deploymentUnit);
 
-        return cmgManager.cmgNodes()
-                .thenCompose(cmg -> 
deploymentUnitStore.createClusterStatus(id, version, cmg))
+        return extractNodes(deployMode)
+                .thenCompose(nodesToDeploy ->
+                        doDeploy(id, version, force, deploymentUnit, 
nodesToDeploy,
+                                undeployed -> deployAsync(id, version, 
deploymentUnit, deployMode)
+                        )
+                );
+    }
+
+    @Override
+    public CompletableFuture<Boolean> deployAsync(
+            String id,
+            Version version,
+            boolean force,
+            DeploymentUnit deploymentUnit,
+            List<String> initialNodes
+    ) {
+        checkId(id);
+        Objects.requireNonNull(version);
+        Objects.requireNonNull(deploymentUnit);
+
+        return extractNodes(initialNodes)
+                .thenCompose(nodesToDeploy ->
+                        doDeploy(id, version, force, deploymentUnit, 
nodesToDeploy,
+                                undeployed -> deployAsync(id, version, 
deploymentUnit, initialNodes)

Review Comment:
   Yes, it is a recursion, it will be called only when `force` is true and we 
successfully undeployed the existing unit



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

Reply via email to