AMashenkov commented on code in PR #2449:
URL: https://github.com/apache/ignite-3/pull/2449#discussion_r1305613580


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -429,93 +430,120 @@ private CompletableFuture<AsyncSqlCursor<List<Object>>> 
querySingle0(
             return CompletableFuture.failedFuture(new 
SessionNotFoundException(sessionId));
         }
 
-        CompletableFuture<Void> start = new CompletableFuture<>();
+        CompletableFuture<AsyncSqlCursor<List<Object>>> start = new 
CompletableFuture<>();
 
-        AtomicReference<InternalTransaction> tx = new AtomicReference<>();
+        CompletableFuture<AsyncSqlCursor<List<Object>>> stage = 
start.thenCompose(ignored -> {
+            ParsedResult result = parserService.parse(sql);
 
-        CompletableFuture<AsyncSqlCursor<List<Object>>> stage = start
-                .thenCompose(ignored -> {
-                    ParsedResult result = parserService.parse(sql);
+            validateParsedStatement(context, result, params);
 
-                    validateParsedStatement(context, outerTx, result, params);
+            QueryTransactionWrapper txWrapper = 
wrapTxOrStartImplicit(result.queryType(), transactions, outerTx);
 
-                    boolean rwOp = dataModificationOp(result);
+            return waitForActualSchema(schemaName, 
txWrapper.unwrap().startTimestamp())
+                    .thenCompose(schema -> {

Review Comment:
   `waitForActualSchema` future may completes in Metastorage thread.
   So, `prepareAsync` or/and `executePlan` may be processed in Metastorage 
thread.
   Should we use `thenComposeAsync` here?



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