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


##########
fe/fe-core/src/main/java/org/apache/doris/qe/runtime/ThriftPlansBuilder.java:
##########
@@ -822,6 +822,7 @@ private static Set<Integer> 
setParamsForRecursiveCteNode(List<PipelineDistribute
                 List<TRecCTETarget> targets = new ArrayList<>();
                 // reset infos for all instances of child fragments (used to 
reset state)
                 List<TRecCTEResetInfo> fragmentsToReset = new ArrayList<>();
+                Set<String> resetFragmentKeys = new HashSet<>();

Review Comment:
   **[P1] Keep one owner for a shared fragment's recursive lifecycle**
   
   This set is recreated for every `RecursiveCteNode`, so it removes duplicates 
only within one controller. A valid reduced plan is:
   
   ```text
   CTEProducer(base) -> Fbase
   Join
   |-- RecCTE r1
   |   `-- recursive side -> inlined edges -> CTEConsumer(base) x2
   `-- RecCTE r2
       `-- recursive side -> inlined edges -> CTEConsumer(base) x2
   ```
   
   `BindRelation` marks the directly referenced `edges` CTE must-inline, but 
not its nested `base`; because `base` has two consumers and the default 
threshold is one, it remains materialized. Deep-copying `edges` retains the 
lower CTE id, and physical translation returns the same 
`MultiCastPlanFragment`, so both fresh sets retain the same `(Fbase, BE)`. Each 
source then independently sends WAIT/REBUILD/SUBMIT/FINAL_CLOSE, while 
`FragmentMgr` owns only one context for that key. For example, R1 can 
WAIT/REBUILD PFC1, R2 can WAIT and remove PFC1, and R1's SUBMIT then returns 
NotFound; full sequential execution still fails after the first controller's 
FINAL_CLOSE removes state. Please clone/inline the transitive fragment per 
controller or add explicit shared lifecycle ownership/round coordination (a 
query-wide drop from one list is insufficient), and add a two-controller 
regression.



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