github-actions[bot] commented on code in PR #68269:
URL: https://github.com/apache/doris/pull/68269#discussion_r4081723177


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/ivm/IvmIncrRefreshManager.java:
##########
@@ -97,6 +97,8 @@ void executeInternalRefresh(IvmIncrRefreshContext context) 
throws Exception {
         MTMV mtmv = context.getMtmv();
         StatementContext statementContext = new StatementContext(
                 context.getConnectContext(), new 
OriginStatement(mtmv.getQuerySql(), 0));
+        // SET_VAR hints are applied while parsing the MV query, before 
executeCommand runs.
+        context.getConnectContext().setStatementContext(statementContext);

Review Comment:
   [P2] Preserve the captured compute group after parsing hints
   
   Installing this context makes stored `SET_VAR` hints effective during 
incremental parsing, including `compute_group`. In cloud mode 
`executeSingleIvmAttempt` has already applied the manual refresh's captured 
group (say `cg_a`) with `setupComputeGroup`, so a stored 
`SET_VAR(compute_group='cg_b')` now overwrites it before planning. 
COMPLETE/PARTITIONS do the reverse—parse first, then call 
`setupComputeGroup`—so they stay on `cg_a`; incremental can run on `cg_b` while 
the task still reports the pre-hint `cg_a`. Please apply one precedence rule 
across refresh modes (for example, reapply the captured task group after 
parsing) and cover the conflicting-group case.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/RefreshMTMVCommand.java:
##########
@@ -152,6 +152,9 @@ StatementContext createDryRunStatementContext(MTMV mtmv, 
ConnectContext internal
         
stmtCtx.setIvmRewriteContext(Optional.of(IvmRewriteContext.incrementalDryRun(mtmv,
 dryRunLimit)));
         // Excluded trigger tables must not be validated for binlog / key-type 
support.
         stmtCtx.setExcludedTriggerTables(mtmv.getExcludedTriggerTables());
+        // The MV query is parsed before the internal executor is created. 
SET_VAR hints
+        // need this context already installed on the internal session during 
parsing.
+        internalCtx.setStatementContext(stmtCtx);

Review Comment:
   [P2] Latch dry-run cancellation across setup and planning
   
   This lets `buildQueryPlan` proceed, but `dryRunRefresh` still parses before 
the inner executor and `cancelDelegate` exist. A Ctrl+C/KILL/timeout in that 
window makes the outer `StmtExecutor.cancel` return with no delegate, 
coordinator, or `CancelableCommand`, so nothing records the cancellation and 
the inner query starts afterward. There is a second lossy window while the 
inner executor is planning but has not created its coordinator. Please retain 
the first cancel reason across setup/planning and check or replay it before 
execution, with a latch-based test that proves no delta query starts after an 
early cancel.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to