github-actions[bot] commented on code in PR #66328:
URL: https://github.com/apache/doris/pull/66328#discussion_r3712200291
##########
be/src/runtime/fragment_mgr.h:
##########
@@ -228,8 +228,10 @@ class FragmentMgr : public RestMonitorIface {
// Saved params and callback for rerunnable (recursive CTE) fragments.
// Only populated when need_notify_close == true during exec_plan_fragment.
- // Lifecycle: created in exec_plan_fragment(), used in
rerun_fragment(rebuild)
- // to recreate PFC with fresh state, cleaned up in remove_query_context().
+ // Lifecycle: created in exec_plan_fragment(), retained across
wait/rebuild/submit rounds,
+ // and removed after a successful final_close. remove_query_context() and
stop() provide
Review Comment:
[P2] Fence recursive-CTE publication against completed cancellation
This fallback cleanup is not a fence for a recursive-CTE PFC being prepared.
Both initial `exec_plan_fragment()` and `rerun_fragment(REBUILD)` perform the
final task cancellation check before publishing the PFC into FragmentMgr and
QueryContext; initial execution also publishes the strong rerunnable entry. If
`cancel_query()` lands in that gap, cancellation snapshots no new PFC, extracts
the existing rerunnable entries, and erases the query maps. The producer can
then publish new state into the already-removed query.
On initial execution, SUBMIT's scheduler sees the canceled context, clears
`_need_notify_close`, and removes the PFC after its tasks close, but the late
rerunnable entry remains the sole owner; FINAL_CLOSE sent before publication or
after PFC removal returns `NotFound` before extracting that entry. On REBUILD,
if the target processes the request but its response is lost, the source skips
SUBMIT, and even a successful FINAL_CLOSE only clears `_need_notify_close` with
`_closed_tasks == 0 < _total_tasks`; no scheduled task can remove the late PFC.
Either branch retains the canceled query and spill tree until shutdown.
Please make publication at both sites atomic with cancellation—for example,
use one cancellation-aware registration gate and roll back every FragmentMgr
PFC/rerunnable insertion if registration is rejected—and add deterministic
post-prepare barrier tests for both initial execution and REBUILD that prove
all maps are empty without relying on later protocol cleanup.
--
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]