Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Related: #30387 (4.1.5 client-disconnect detection), and #26067 (Window/UNION cancellation). This report tracks a different, observed boundary: the deployed frontend already detects the disconnected client and invokes cancellation, but a CPU-bound LoopJoin/LIKE execution remains alive afterward. It should not be closed solely because disconnect detection or Window cancellation is implemented.
The Window/Partition fix #26080 (merge commit 4389315727e0176764b91dd1f88e9f2f705a72ee) is already an ancestor of the affected commit; its changes do not cover LoopJoin.scanProbeMatches.
Branch Name
4.2 release line; observed image v4.2.6-71498157cc-2026-10-20. Other branches and an introducing commit have not been established.
Commit ID
71498157cc21f833b8e717f45d50d1f926be3134
Other Environment Information
- Internal IDC QA, distributed MatrixOne on Kubernetes, application connections through MO Proxy.
- Affected TP CN resource limits: 16 CPU / 55 GiB memory each.
- Workload: MOI Catalog background orphan-file reference checking, not an Astra-issued query established by this investigation.
- Investigation was read-only: no new load, KILL, CN restart, or product patch was executed to obtain this evidence.
- Connection/transaction/statement identifiers below are diagnostic correlation keys. Account/user names, addresses, credentials, and application payloads are omitted.
Actual Behavior
Long-running correlated NOT EXISTS queries with dynamic LIKE predicates keep executing in LoopJoin.scanProbeMatches. In two earlier observations, the frontend explicitly logged cancellation after client disconnect, yet the same transaction remained active afterward. One remained active 90 minutes after the cancellation log; a post-cancellation goroutine dump still showed its execution worker running LIKE/regexp inside LoopJoin.
A later recurrence remained COM_QUERY for more than five hours on a CN consuming approximately 15.1 of its 16 CPU cores. The operator reports that KILL did not terminate it. We independently verified the continuing statement and CPU usage, but have not captured the exact KILL command/response or its arrival at the owning CN for this later recurrence. The primary cancellation-failure evidence is therefore the earlier frontend-disconnect timeline, not an assumption that this later KILL was delivered.
Observed timeline
All dates/times below are UTC. Asia/Shanghai is UTC+08:00.
| Execution | Event | UTC timestamp | Asia/Shanghai |
|---|---|---|---|
A, connection 163263046 |
Transaction created | 2026-10-21 17:55:18.611371 | Oct 22 01:55:18 |
| A | Frontend logged client-disconnect cancellation | 2026-10-22 01:51:52.452890 | Oct 22 09:51:52 |
| A | Same transaction still reported active | 2026-10-22 03:22:12.705298 | Oct 22 11:22:12 |
B, connection 163348400 |
Transaction created | 2026-10-22 01:53:59.389788 | Oct 22 09:53:59 |
| B | Frontend logged client-disconnect cancellation | 2026-10-22 03:19:54.094591 | Oct 22 11:19:54 |
| B | Same transaction still reported active | 2026-10-22 03:24:11.468497 | Oct 22 11:24:11 |
C, connection 163396670 |
Current statement started | 2026-10-22 04:44:13.745019 | Oct 22 12:44:13 |
| C | Independent processlist check: still same statement/transaction | Approximately 2026-10-22 10:02 | Approximately Oct 22 18:02 |
Correlation keys:
- A: txn
6e542047007fda5718e042c9b61e7e42, statement01a15f9a-73fd-7cae-8894-1e7d8d584001, frontend goroutine71118407. - B: txn
bb3bbf26f8789ad218e0992801eb2b29, statement01a16150-af14-733e-96b3-b755afb81d7f, frontend goroutine59072223. - C: txn
36806d64829cdd1f18e0bd3cbb8b0c0d, statement01a161ec-877a-72dd-9166-c9b23528d479.
Redacted raw event excerpts (the peer endpoints were correlated privately to the connection IDs):
2026/10/22 01:51:52.452890 +0000
frontend/routine_manager.go:229
cancel active query after client disconnect: connection=<A proxy peer>
2026/10/22 03:22:12.705298 +0000
cn-service found leak txn
txn-id=6e542047007fda5718e042c9b61e7e42
create-at=2026/10/21 17:55:18.611371 +0000
ConnectionID=163263046
2026/10/22 03:19:54.094591 +0000
frontend/routine_manager.go:229
cancel active query after client disconnect: connection=<B proxy peer>
2026/10/22 03:24:11.468497 +0000
cn-service found leak txn
txn-id=bb3bbf26f8789ad218e0992801eb2b29
ConnectionID=163348400
found leak txn is the detector's log wording, not proof of an allocation leak.
Execution evidence
For A, a goroutine dump taken after the frontend cancellation contains:
frontend goroutine 71118407 [chan receive, 555 minutes]
-> compile.(*Compile).runOnce
waiting for execution scopes
worker goroutine 71259177 [runnable]
regexp.(*machine).step / match
regexp.(*Regexp).Match
function.(*regexpSet).regularMatchForLikeOpWithEscape
func_builtin_regexp.go:765
function.opBinaryBytesBytesToFixedWithErrorCheck
baseTemplate.go:2086
colexec.(*FunctionExpressionExecutor).Eval
evalExpression.go:1117
loopjoin.(*container).evalConditionWindow
probe.go:187
loopjoin.(*container).scanProbeMatches
probe.go:311
loopjoin.(*container).probe
probe.go:400
loopjoin.(*LoopJoin).Call
join.go:165
vm.Exec
types.go:378
...
compile.(*Scope).Run(..., 0x266b4214908)
The frontend and worker stacks were linked through the same Compile instance (0x266b4214908), rather than attributing an arbitrary pod-wide regexp stack to this transaction.
For B, the corresponding Compile instance had 15 worker stacks containing LoopJoin; 13 were in regexp-related execution at sampling. Its CN CPU rose from approximately 5.97 cores in the 01:30–01:50 UTC pre-query window to 15.45 cores in the 02:00–03:08 UTC window. This establishes significant resource pressure, not that every CPU cycle on the CN belongs to this query.
Expected Behavior
Once query cancellation is delivered, CPU-bound execution should observe it within a bounded amount of work and unwind. Query scopes, transaction/session cleanup, and their owned resources should not remain blocked for tens of minutes or hours behind a non-yielding operator.
The query may legitimately be expensive, but that does not justify ignoring cancellation. KILL returning OK, a connection disappearing from a view, or changing QueryInExecute is not by itself proof that execution and cleanup have finished.
Steps to Reproduce
Observed real-workload trigger: MOI orphan-file cleanup constructs a correlated anti-join over file candidates and persisted message/snapshot text, plus other reference checks. The actual processlist SQL for C begins with this structure:
SELECT f.file_id
FROM `file` AS f
WHERE ((f.ref_count = 0 AND f.created_at <= <retention_cutoff>)
OR (f.ref_count = -1 AND f.updated_at <= <claim_cutoff>))
AND f.source <> 'builtin'
AND NOT EXISTS (
SELECT 1 FROM data_asset AS da
WHERE da.asset_type = 'file' AND da.asset_ref = f.file_id
)
AND NOT EXISTS (
SELECT 1 FROM agent_runtime_messages AS arm
WHERE arm.parts_json LIKE CONCAT('%', '"', f.file_id, '"', '%')
OR arm.parts_json LIKE CONCAT('%moi://files/', f.file_id, '%')
)
AND NOT EXISTS (
SELECT 1 FROM agent_runtime_turn_snapshots AS arts
WHERE arts.snapshot_json LIKE CONCAT('%', '"', f.file_id, '"', '%')
OR arts.snapshot_json LIKE CONCAT('%moi://files/', f.file_id, '%')
)
/* Additional reference checks omitted. */
ORDER BY f.file_id
LIMIT 100;This is an abbreviated query shape with placeholders, not a complete executable reproduction. The captured processlist text was truncated; the ORDER/LIMIT and further reference checks were verified against the application source. LIMIT 100 bounds returned candidates, not the work performed by the correlated predicates.
For an isolated reproducer/regression test:
- Use the affected MO commit and synthetic file IDs plus long message/snapshot text. Arrange a sufficiently expensive non-equi SEMI/ANTI LoopJoin, including no-match cases; verify the actual operator path rather than assuming the SQL always selects it.
- Start the query and establish that a worker has entered
scanProbeMatches/LIKE evaluation. - In separate runs, exercise client disconnect,
KILL QUERY, andKILL CONNECTION. Correlate the cancellation with the exact owning CN and statement. - Assert bounded execution exit, transaction cleanup, and stable owned-memory/worker baselines after repeated cancellation.
Not yet performed: a deterministic synthetic reproduction or before/after patch validation. Do not replay the expensive query on a shared QA/production cluster to reproduce this report.
Additional information
Exact-version code analysis
The strongest code-level explanation is a cancellation-observation gap in long LoopJoin scans:
RoutineManager.cancelDisconnectedRequestsemits the observed log and invokesroutine.beginClose().Routine.beginCloseinvokes the current request cancellation function.vm.Execchecks cancellation beforeop.Call(proc).scanProbeMatchesscans build batches, condition windows, and rows without checkingproc.Ctxin those loops. Its comment explicitly states that it does not yield midway.probeinvokes that scanning path for SEMI/ANTI/MARK/SINGLE. An output-batch bound is not a bound on the amount of unsuccessful matching work within one Call.- The sampled expression path uses
FunctionExpressionExecutor.EvalandLIKE/regexp matching; the generic Eval path does not supply an inner-loop cancellation boundary. Compile.runOncewaits for scope completion. The observed stuck parent and still-running worker are consistent with this lifecycle.
This is observed cancellation failure with a strongly supported implementation hypothesis. A controlled regression test is still needed to establish the complete fix boundary; we have not experimentally proved that adding one check alone resolves every cancellation path.
Scope and non-claims
- This report is about cancellation responsiveness and delayed resource cleanup, not a demonstrated new memory leak, OOM, data corruption, or identified regression-introducing commit.
- MOI's expensive background query and missing effective execution budget are separate application-side contributors. They do not remove MO's responsibility to honor cancellation.
- [Bug]: in-flight statements are never cancelled when client connection closes mid-execution (4.1.5) — zombie query pileup, throughput collapse, CN OOM loop #30387 primarily describes a 4.1.5 path that does not detect a client disconnect during execution. Here the frontend detection/cancellation log is present; executor responsiveness is the remaining boundary to investigate.
- For recurrence C, preserve the operator's KILL report but do not equate it with independently verified delivery. Bare
KILL <id>means CONNECTION in this version; repeated identical commands do not provide a stronger interruption mechanism. - The investigation did not restart CNs. Earlier affected CNs were replaced by other environment operations; this is not a before/after product-fix validation.
Suggested acceptance criteria
- Deterministically cancel after entering the expensive scan, not only before
Call. - Cover no-match and match-heavy SEMI/ANTI paths and review the shared MARK/SINGLE paths; do not rely only on output-row limits.
- Verify client-disconnect and explicit KILL paths independently, with cancellation delivery and execution exit both witnessed.
- Verify reset/free/transaction cleanup and repeated-run memory/worker baselines, with no premature freeing of buffers still used by executing workers.
- Preserve ordinary query results and normal early-completion semantics. Do not merely hide the session or return from the parent while leaving workers running.
Activity
LeftHandCold commentedon Oct 22, 2026
根因确认与修复验收(2026-10-22)
已经确认是 MO 执行层的合作式取消缺口,不只是 SQL 较慢、负载繁忙或 Runner 误报。
修复 PR:
64b2bf17be8a9509d5098c58eaca912371352959b1934f4523381c0799405293d1cdb18f7aa1d7e11. 已敲定的因果链
vm.Exec只在调用 operator 前检查取消,不能抢占已经进入的LoopJoin.Call。LIMIT 100只限制输出,并不限制证明 NOT EXISTS 所需的扫描。Main 和当前 4.2 都存在该缺口。源码历史表明,当前
scanProbeMatches抽取之前的 LoopJoin 也缺少相应检查;不能据此认定某个最近 PR 首次引入回归。本次也没有把 long-lived txn 日志扩大解释成已证明的内存泄漏。2. 4.2 严格同版本前后验证
在 50 的独立实例验证,没有改动现有 QA、回归或客户服务。
4.2-dev@26d3a200cb13f4be3b5f64d489bac75d8dcc5814。4.2 的既有断连检测有 30 秒 query-age grace 和 5 秒探测周期。因此实验在查询年龄达到 31 秒并重新确认原执行现场后才断开;没有把检测资格等待与执行器响应延迟混为一谈,也没有改变这个策略。
每个 After 场景均进一步检查:原 txn count=0、没有残留 LoopJoin worker、原 worker 已离开 Scope、相同正常查询返回固定答案
missing、SELECT 1 正常,以及 fixture 数据库清理后不存在。客户端返回错误本身不作为服务端清理成功的证明。4.2 KILL 返回既有
1105/HY000: context canceled;Main 验收返回1317/70100: context canceled。没有顺带修改两分支的错误码策略。二进制 SHA256:
Main 候选的同三入口公共验收也全部通过,观测清理时间分别为 126ms、140ms、834ms。但 Main 没有做 public baseline 对照,不把跨分支比较冒充同版本 A/B;其缺陷另有源码和修复前 UT 负例证明。
3. 修复范围与风险控制
两分支 owning-package 普通测试、race、各精确取消测试独立 race×100、Go vet、配置对应的 lint、完整服务编译全部通过。测试还覆盖普通正确结果、真实 window 释放、重复清理和同一个 operator 在新 context 下复用。Main 36 个 LIKE benchmark cell 的三组交替前后对照无新增 allocation;真实 cancellable context 最大 median 增量约 0.51ns/row。该微基准不承诺所有业务零性能变化。
4. 边界与当前状态
这是取消已经送达后仍继续执行的修复,不是把原本昂贵的 NOT EXISTS/LIKE 查询改写成快查询。单次正在执行的 Go regexp 匹配仍不可异步抢占,因此不承诺任意超大单行的固定毫秒取消 SLA,也不声称已经验证所有跨 CN 取消投递情形。
全部自有验收实例已停止。4.2 容器在独立的 2 秒停止 grace 后可能 exit137,但 OOMKilled=false;这发生在已经证明请求/事务/fixture 清理之后,未混作查询退出证据。
本地修复验收通过,PR CI/review 和实际版本合入/部署仍待完成。暂不关闭 issue。
XuPeng-SH commentedon Oct 22, 2026
Main-branch regression follow-up — PR #30862
The latest review of PR #30862 (
8bd800cf9fa4c07c16986d7dd7d543f913545cce) found a separate request-context regression in the Main candidate. I independently inspected the linked GitHub Actions artifacts from run 39773539184:charset_collation_basic.sql:23(SHOW COLLATION ... LIKE '%bin%') andoperator/like_operator.sql:237(SHOW VARIABLES ... ILIKE '%matrixone%') both returnedcontext canceledinstead of normal rows.system_variable/system_variables.sql:76(SHOW VARIABLES ... LIKE 'system%') returnedcontext canceled.These are ordinary SHOW statements, not cancellations initiated by the test. The review traces this to a stale canceled
proc.Ctxon a reused frontend Process; it requests refreshing the execution context at the request boundary while preserving cancellation of the current request. This blocks the Main PR at that head.This is distinct from the 4.2.6 defect tracked here: PR #30863 adds
ResetQueryContextat the request boundary and the latest review of its head reports no code blocker. The issue is now assigned solely to Ariznawlll for tester verification; LeftHandCold was removed as part of the transfer. The issue remains open because the separate Main-branch follow-up is not complete.Merge follow-up (2026-10-22)
PR #30863 is now merged: reviewed head
aa160a4d3fa382aa3707c81d069e3a0114e6fe57, merge commit17f4f87ea0bee9c7b6641b5c12c87e741cdd8321. The latest review reports targeted cancellation/context tests and the public SQL regression passing; it also reports the changed owning-package race tests, coverage UT, SCA, Compose PROXY and Pessimistic BVT passing. These are GitHub/reviewer records, not tests I reran locally.The exact merge commit has no combined status entries or PR-triggered workflow runs available through the GitHub data checked. The review separately records a race-UT failure in
TestGlobalCheckpoint2; it is not attributed to the changed SQL paths, but the required CI gate should be checked independently.PR #30862 remains open at head
1628328874a039b52961c8aef290052811ed3a1c, so the Main-branch half of this issue is not complete. Keep issue #30836 open because the Main-branch follow-up is not complete. Ariznawlll is the sole assignee for tester verification; LeftHandCold was removed.fix(sql): honor LoopJoin and LIKE cancellation on 4.2 (#30863)
XuPeng-SH commentedon Oct 22, 2026
QA follow-up — main fix PR #30862 head
d436f4fd5dbd6c6df4ff7dd4731151d87acc5b2d(2026-10-22)This head adds a scoped frontend-expression context binding/restoration for SHOW filters, prepared SET/simple expressions and
meta_scanprivilege argument evaluation, alongside cancellation checks in LoopJoin and LIKE. Static inspection finds the earlier stale-proc.Ctxissue addressed in the changed call sites: each evaluation defers restoration of the exact previous context, and executor/result cleanup is deferred before the context is restored. LoopJoin checks cancellation at Call/work boundaries and preserves condition-window cleanup; LIKE checks cancellation at row batches and before each regexp match. One running regexp match remains non-preemptible, as the PR documents.The PR author reports owning-package, full frontend, race, coverage-mode and lint passes, including the prior SHOW/LIKE and compiler-context regressions. I did not execute those tests: this workspace is not a MatrixOne checkout and has no Go binary. Exact-head GitHub status has zero commit statuses; the returned Connector/J Pool Reset E2E is still running and Iceberg Connector E2E passed, neither being a targeted result for this change.
No additional actionable finding was established by this static pass. Keep #30836 open pending exact-head required CI and independent frontend/LoopJoin/LIKE tests; its current tester assignee
Ariznawlllis unchanged.Ariznawlll commentedon Oct 23, 2026
测试版本
maind4c37f4d8722dd91b80f5f5547940004bf1b293f原问题验证
补充当前 main 的二进制 prepared + JDBC timeout + 客户端断开后残留执行边界,不是对 #30862 PR head 的修复验收。
JDBC 参数:
useServerPrepStmts=true&cachePrepStmts=false&socketTimeout=30000。(10,10),正确返回10。setQueryTimeout(1),改绑(40000,40000)。CommunicationsException / 08S01,不是在 1 秒附近结束。查询计划是
Aggregate -> INNER Join (l.s LIKE CONCAT(r.s,'%')) -> 两侧 Table Scan,不是等值 hash join 的简单对照。Happy Path 覆盖
(10,10)返回精确计数10。COUNT(*)=40000、SUM(id)=800020000。SLEEP(?)、1 秒 JDBC timeout、随后同句柄SLEEP(0)和SELECT 1,3 次均正常取消并恢复。这说明不应将所有 JDBC timeout 都一概认定失效。Unhappy Path 覆盖
KILL QUERY 443返回20101/HY000: internal error: cannot kill a closed or changing session。本次无法证明这个额外 KILL 已送达执行器;不将其写成“已成功 KILL 后仍运行”的证据。shutdown role still draining(CN,1m0s),最后panic: context deadline exceeded,进程 exit 2。准备强制结束时该 PID 已不存在,实际没有执行成功的强制终止。重启后 SHA 不变,测试库已不存在、SELECT 1 正常。此关闭超时作为残留执行期间的观察,未计为单独新 bug。白盒验证
检查本提交
pkg/sql/colexec/loopjoin/join.go的 Call/Probe 路径、probe.go的外层 probe 循环与动态 LIKE 条件求值。与本 issue 讨论的取消观察缺口吻合。未应用 PR #30862,未进行内部注入或声称已经验证其最新 head;不另开重复 issue。回归测试
本轮仅运行隔离复现脚本,未添加仓库 case/PR。建议现有修复验收补充 server-prepared JDBC 超时、同句柄小→大、客户端断开后的服务端会话/事务退出;不能仅验证客户端收到异常。
测试证据
客户端原始输出摘录:
服务端第一条残留执行:
测试结论
测试不通过。
Ariznawlll commentedon Oct 26, 2026
阶段性 QA 记录(待 TKE 原场景复验,非最终验收结论)
版本与修复状态
2b388dd1690f83e2e807d6809180336dae2a68eb;2026-10-26 核对的官方main为861a2c4cb68961d8b6b01f18e0aa6ac52a3a505f,包含该修复。17f4f87ea0bee9c7b6641b5c12c87e741cdd8321;核对的官方4.2-dev为86a45d39df3d1f23490fcdd7328b46c5520efada,包含该修复。已执行的定向测试
86a45d39df3d1f23490fcdd7328b46c5520efada服务上,用合成数据构造 correlatedNOT EXISTS+ 动态LIKE,EXPLAIN核对进入 ANTI Join。正常查询结果作为对照,未用客户端报错代替服务端退出证明。KILL QUERY、KILL CONNECTION、客户端断开:各 3/3 次观察到原执行/事务在有界时间内退出;客户端断开场景等待 4.2 现有约 30 秒检测资格后再触发。正常查询与连接恢复对照通过。go test -race ./pkg/sql/colexec/loopjoin -run '^TestLoopJoinCancellation' -count=10通过。这里仅记录定向结果,未声称完整测试套件或整套 CI 通过。本次 TKE 检查与未覆盖项
2f8011faecaa402801288ca4e34270d8bd404a92,包含 Main 修复,但比检查时官方 Main 落后 24 个提交,也不是 4.2-dev 镜像。待使用不影响运行中 CI 的隔离环境、准确版本和原规模补测后,再按最终验收格式给出结论。本条仅记录已做与未做,不关闭或改派 issue。
Ariznawlll commentedon Nov 6, 2026
测试版本
MatrixOne 官方 main
65b721e1b93c6b9e05db2063b220e0c35916b335;本地独立 1 LogService / 1 TN / 1 CN,SQL 直连 CN。原问题发生于 4.2.6 的多 CN / Proxy 环境,本轮不将 main 上的结果等同于 4.2 发布版本验证。原问题验证
两个各 30,000 行的表执行
a JOIN b ON a.s LIKE CONCAT('%',b.s,'%');每次先通过SHOW PROCESSLIST确认目标连接正在执行该查询,再执行取消并检查服务端状态。KILL QUERY3/3 次均返回成功,客户端返回1317/context canceled,客户端线程在约 0~3 ms 退出;服务端随后不再将该语句报告为活跃,管理连接仍能执行SELECT 1。Happy Path 覆盖
正常等值 JOIN 小范围对照返回 10 行计数;每次取消后管理连接执行
SELECT 1成功,测试库最终可删除,独立实例正常停止。Unhappy Path 覆盖
NOT EXISTS+ 动态 LIKE 查询,同样的KILL QUERY、KILL CONNECTION、主动断连各 3/3 次退出;断连后进程列表活动语句约 0.5~1.1 秒内消失。该查询的逻辑计划为 MARK Join,不能写成已证明原问题的 ANTI LoopJoin 执行路径。KILL CONNECTION:确认查询在执行后 3/3 次取消,客户端返回 context canceled,服务端不再报告该查询活跃。SHOW PROCESSLIST刷新;本轮未独立核对内部 worker goroutine、事务对象及 CPU 曲线,不能将进程列表变化等同于这些资源全部回收。白盒验证
逻辑 EXPLAIN 显示非等值 LIKE JOIN;本轮未成功取得可用的物理计划,不能断言已直接观察到
LoopJoin.scanProbeMatches。修复及此前定向 race 证据见该 issue 既有评论;本轮没有重新运行对应 Go 测试。回归测试
本轮执行隔离脚本
test_30836_cancel.py、test_30836_kill_connection.py、test_30836_disconnect.py,未向 MatrixOne 主库提交测试 PR。日志中首次测试脚本将 processlist 的conn_id误读为id,修正后重新执行;另一次即时状态断言未等待列表刷新,改为有界轮询后重测。两次中间尝试均重启自建实例清理,不能当作产品通过或失败证据。测试证据
上述三个脚本对应
.log各记录 3 次观察到活跃查询、操作及退出结果。查询为合成 INNER JOIN 和 correlated NOT EXISTS,均为 30,000 × 30,000 行;后者逻辑计划为 MARK Join,未复现原 ANTI LoopJoin 物理路径或实际 MOI 负载、4.2 镜像、多 CN / Proxy、JDBC server-prepared、滚动资源压力或 CPU 下降。测试结论
当前 main 两种本地简化查询的 KILL QUERY、KILL CONNECTION 和 TCP 断连均各 3/3 次在有界时间退出;原 4.2 分布式工作负载、物理 LoopJoin 与事务/worker/CPU 回收尚未完整验收,保持 Open。
Ariznawlll commentedon Nov 18, 2026
QA 双分支回归交付完成(本 issue 的可验证范围)。
已交付
./pkg/sql/colexec/loopjoinANTI/SEMI/MARK 取消与资源释放、./pkg/sql/plan/functionLIKE 批量取消、./pkg/frontend/./pkg/embed表达式上下文作用域)+ SQL 入口场景(KILL QUERY / KILL CONNECTION / 会话中断,事务清理、连接归属、服务健康)。验证证据
517e1695388cbaf1135238d5ab0c19a4556fb551、4.2-dev @72c43e9305d8355c940075e414f30eaf2e4112a6motr --repeat 2:双分支 record 2/2 PASS、verify 2/2 PASS;SQL 取消场景客户端边界均为1317 context canceled,语句/事务/LoopJoin worker 全部移除。保持 OPEN 的原因:原 issue 标题含 4.2.6 高 CN CPU + 多 CN/Proxy 拓扑与 MOI 负载,本交付未覆盖该拓扑(单 CN 本地实例验证),该部分待后续拓扑化验收后关闭。
Ariznawlll commentedon Nov 18, 2026
更新:按"每日每分支一个 PR"策略,前述 #360/#361 已并入今日统一 PR,链接以本评论为准:
原 negotiateAuthenticationMethod Fails #360/Fix negotiateAuthenticationMethod #361 已关闭(内容未丢失,全部提交已合并进对应分支 PR)。验证证据不变。
Ariznawlll commentedon Dec 1, 2026
结论
测试通过。 补齐 4.2-dev 的真实 Proxy / 双 CN / 三 LogService 拓扑,三轮物理 LoopJoin 取消、事务/执行线程清理和 CPU 回落检查通过;七个根测试各 race 三轮通过。最新 4.2-dev 的独立 Linux CI 又完整执行三轮并通过,证据见下。
关键证据
分支、版本、部署
17f4f87ea0bee9c7b6641b5c12c87e741cdd8321;源码 ancestry 已核对。fa22bd6c9fcb8603779f686bb5e568c6f7deec5e,128 隔离目录,未经 QA 修改的 MO 服务二进制。两个 CN 与 Proxy 三个 SQL 入口分别查询git_version(),均等于该完整 SHA。原始问题路径与正常对照
loopjoin.(*container).scanProbeMatches与LoopJoin.Call,确认已进入昂贵执行路径后才取消。实际输出与清理证据
每轮三种入口均核对:不返回正常查询结果;KILL 客户端收到本分支的 context canceled;原 statement/txn 消失;两个 CN 不再存在该 LoopJoin 执行 worker;连接生命周期符合 QUERY/CONNECTION 的差异;后续 SQL 成功。断连另外按 statement/txn 与 Proxy 日志关联 cancel、rollback、routine cleanup、Proxy close,不只凭客户端异常或 processlist 消失判断。
每轮独立测试库均删除;最后七个服务退出码全部为 0,未触发超时强杀。第一次尝试第二轮碰到多个隔离服务同时 SIGTERM,已作为环境中断保留,不计成功或产品失败;这里的三轮是之后完整重跑的结果。
对 fixture 两个 CN 的
/proc/PID/stat分别取计数并求和,每段采样 3 秒;单位是 CPU 秒/墙钟秒(核),只统计自己启动的两个 CN,不使用整机 CPU。各次取消前空闲基线为 0.053–0.090 核。取消后均回到相近基线,结合 worker/txn 归零,支持“执行真正退出”的判断。这里没有复刻原现场 16 核饱和或五小时业务积压,也不宣称客户 SQL 的正常执行性能有所提升。
qa-32855-42-daily.yml,使用 job 实际检出的 4.2-dev 二进制及完整 SHA,完整三轮并保存 receipt/round logs。原有 broader acceptance job 仍复用同一脚本。b063c938a824333006f7b48dbe01bc237e2df1d2。167a1a91999f43146393995286b8237a0f6e0942,三轮均 exit=0、receipt.status=passed,七个服务均 exit=0 且没有 forced_cleanup。这个版本比本地基线增加一个 IVF NaN 主键修复提交,新的真实 SQL 拓扑也已重新覆盖。待解决点
本 Issue 的受控故障语义验收、定向 race 和最新 4.2-dev CI 已完成;MOTR PR 等待合入,每日新步骤须在合入后生效。本轮针对实际 LoopJoin/LIKE 取消交付、执行与事务资源退出、Proxy 路径和 CPU 不继续占用;原始客户数据、跨物理机以及五小时业务负载没有复刻,不据此作业务性能承诺。
最终结论:测试通过。4.2-dev 本地及最新 CI 的双 CN / Proxy 三轮取消均完成,原先取消后执行持续不退出的问题未复现;物理执行线程、事务清理、CPU 回落、正常查询及进程退出均通过,定向 race 21/21 通过。回归已追加现有 MOTR 4.2-dev PR #399;本轮未确认该范围内的产品失败,不外推为 main 或其他业务负载已验收。