You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] CompleteSQLTaskRun accepts stale runner completion #25604
CompleteSQLTaskRun updates a task-run row using only run_id. A stale runner can therefore complete a run after that run has timed out/reallocated and overwrite the newer state.
Evidence
Commit: 7821d21c723372e45a8f65da3bbb896a157b1036
pkg/taskservice/mysql_task_storage.go:264-279 executes the update with WHERE run_id=? only.
pkg/taskservice/sql_task_executor.go:224-237 calls CompleteSQLTaskRun after execution, without a lease/attempt/version predicate.
The in-memory storage implementation has the same unconditional RunID overwrite behavior (pkg/taskservice/mem_task_storage.go:421-429).
Expected
Completion should be conditional on the runner's current lease/attempt/version, so a stale runner cannot overwrite a newer allocation or completion.
Please add a test that reallocates/times out a run while the old runner is still executing and verifies that the old completion is rejected.
Activity
fix(taskservice): fence stale SQL task completions (#25662)
LeftHandCold commentedon Jul 14, 2026
fixed
Ariznawlll commentedon Jul 14, 2026
已在最新
main上验证 SQL task stale completion fencing。验证版本
0977fc07c51067ce76b769c7853d7374cb2fccec验证方法
测试先让旧 runner 的 task run 被 reaper 回收/重新分配,再模拟旧 runner 上报完成,检查 storage 是否会错误接受旧 run 的 completion。
实际结果
memory storage 与 refresh 路径均拒绝 stale/reaped run completion,两个子用例全部 PASS。
结论
当前 main 会根据 run identity/version 对完成请求进行 fencing,旧 runner 无法覆盖新 runner 的 task 状态。
fix(taskservice): fence stale SQL task completions (matrixorigin#25662)
fix(taskservice): fence stale SQL task completions (matrixorigin#25662)
fix(taskservice): fence stale SQL task completions (matrixorigin#25662)