sashapolo commented on code in PR #3216:
URL: https://github.com/apache/ignite-3/pull/3216#discussion_r1491050321


##########
modules/index/src/main/java/org/apache/ignite/internal/index/ChangeIndexStatusTask.java:
##########
@@ -149,28 +158,33 @@ CompletableFuture<Void> start() {
         }
 
         try {
-            return supplyAsync(() -> 
awaitActivateForCatalogVersionOfIndexCreation()
-                    .thenCompose(unused -> 
ensureThatLocalNodeStillPrimaryReplica())
-                    .thenCompose(unused -> 
inBusyLocks(logicalTopologyService::logicalTopologyOnLeader))
-                    
.thenComposeAsync(this::awaitFinishRwTxsBeforeCatalogVersionOfIndexCreation, 
executor)
-                    .thenComposeAsync(unused -> switchIndexToBuildingStatus(), 
executor), executor)
-                    .thenCompose(Function.identity())
-                    .handle((unused, throwable) -> {
+            LOG.info("Starting task to change index status. Index: {}", 
indexDescriptor);
+
+            return awaitCatalogVersionActivation()

Review Comment:
   Can you please clarify? What's the problem of going to the network, if we 
wait for the response asynchronously? It seems quite strange to dispatch a 
method that returns a `CompletableFuture` on a different executor, since the 
original method is already asynchronous and should not perform any sync IO. 



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