Repository navigation
Description
Parent Issue
Parent issue: #32278
Detail of Subtask
Catalog ID: D02
Origin: B - Pre-existing in the 4.2 baseline and retained on main
Evidence level: Reproduced behavioral defect
4.2 versus main: provenance
The completeFailedSQLTaskRun path that selects the current RUNNING record by task/account/CN already exists in 4.2 and remains on main. Normal completion gained run/attempt predicates, but repair was not consolidated with it.
Design problem, impact, and existing responsibility
After A persists its completion but loses the acknowledgement, delayed async-failure repair can mark B FAILED for the same task on the same CN. C is then admitted while B is still executing SQL. Repair can modify a wider set of executions than normal completion.
Acceptance criteria
- Reproduce A persisting completion and losing its acknowledgement, B starting, and A repairing: B retains its state and exclusion, and C receives overlap.
- Cover different triggers on one CN, different CNs, retry attempts, stale completion, and owner failure. Existing stale-runner protection remains effective.
- Repair the residual run actually owned by the failed execution without a full-table scan or a new periodic repair service.
Describe implementation you've considered
Consolidate the mapping between run, async trigger/attempt, and owner in the existing TaskStorage/SQLTaskExecutor boundary. Apply the same execution-identity checks to normal completion, failure, and recovery. Define the meaning of zero affected rows; do not infer A's ownership from whichever run is currently RUNNING.
Additional information
Existing investigation and validation limits
TestAuditSQLTaskRepairCrossesExecutionGeneration exercises real execution, admission, and repair. It injects one post-commit acknowledgement error and holds B at a SQL barrier. B becomes FAILED and C successfully acquires execution. Normal and 100 focused race repetitions confirm this; the existing different-CN control still passes. No production business-data corruption is claimed.
main investigation snapshot: pkg/taskservice/task_service.go:212; pkg/taskservice/mysql_task_storage.go:295; pkg/taskservice/sql_task_executor.go:224
4.2 baseline snapshot: pkg/taskservice/task_service.go:212
The named probes are local diagnostic overlays, not committed repository tests. Their names identify the investigation; they cannot be selected directly from an ordinary checkout. Implement the smallest maintained contract regressions and reuse relevant CI/validation proportionally. Temporary evidence commits are not required.
Coordination dependencies: D03 (see the parent catalog). Shared work may be consolidated into one change; a separate PR per subtask is not required.
Related existing work: #25604. Closed items identify implemented controls or historical context; they do not mean this subtask is already resolved.
Activity
[-][Subtask]: D02 [base] 让 SQL task 补偿与正常完成使用同一执行身份,阻止旧执行覆盖新执行[/-][+][Subtask]: D02 [baseline] Use the same execution identity for SQL task repair and normal completion[/+]fix(task): preserve SQL task execution ownership (#32331)