Repository navigation
Description
Summary
在 129 单机的完整 TPCC suite 中,MatrixOne 在没有 OOM、没有进程重启的情况下出现长时间持有行锁和事务完成停滞,随后级联产生 1205 Lock wait timeout、context deadline exceeded,最终多个 TPCC case 被 workflow 以 exit 124 终止。
本 issue 关注的是“事务未及时完成/释放锁导致的级联失败”,与 #26182 中的高并发锁等待现象相关,但本次故障在较小的 10W/100T 阶段已经开始,并且初始故障发生时没有内存上限压力。
Reproduction
- Workflow Run: https://github.com/matrixorigin/mo-auto-test/actions/runs/36329945107
- TPCC execution Job: https://github.com/matrixorigin/mo-auto-test/actions/runs/36329945107/job/108651250033
- Report Job: https://github.com/matrixorigin/mo-auto-test/actions/runs/36329945107/job/108680976728
- Evidence artifact: https://github.com/matrixorigin/mo-auto-test/actions/runs/36329945107/artifacts/10938793095
- MatrixOne commit:
a99db843c7b4630a86883addc9424433d93fc2d2 - mo-auto-test commit:
4f1a07383c2b7a68d75215e92c5d36aa29b3a2cc - Workflow: scheduled
mainfull family regression - Host:
mo-srv-129 - MatrixOne container memory limit:
84 GiB - MatrixOne
GOMEMLIMIT:76 GiB
执行顺序为 TPCC load 10W、10W/10T、10W/100T、100W/100T、100W/1000T、1000W/1000T。
Actual result
| Case | Result | Evidence |
|---|---|---|
10W/10T |
Functional PASS, but tpmC=81.88 |
历史基线中位数为 7464.95,性能检查要求重试 |
10W/100T |
Verify FAIL | 3 次 1205 Lock wait timeout;一致性校验本身通过 |
100W/100T |
exit 124 |
13 次 1205;达到时间限制后一直等待活动事务结束 |
100W/1000T |
exit 124 |
72 次 1205、1913 次 20101 context deadline exceeded |
1000W/1000T |
exit 124 |
9 次 1205、2149 次 20101 context deadline exceeded |
100W/100T 的 jTPCC 日志先记录:
The time limit has been reached.
Waiting for all active transactions to end...
随后 case 达到 workflow 的 15 分钟硬超时,返回 124。
Relevant logs
MatrixOne 服务日志中,在第一个 TPCC 1205 之前已经出现:
cn-service.lockservice: wait too long
wait: 1m+
lock: Exclusive(row): holder(...), waiters(...)
时间线(Asia/Shanghai):
23:51:52:开始反复出现iscp transaction finish timeout23:51:57:lockservice 首次报告行锁等待超过 1 分钟23:52:31:服务端首次记录 TPCC1205,语句为bmsql_district ... FOR UPDATE23:52:32:客户端首次记录 TPCC1205
这表明失败不是单个事务偶发重试,而是存在持锁事务未及时完成、后续请求排队的迹象。iscp transaction finish timeout 与故障时间相关,但 #29392 已指出该类日志可能存在构造阶段误报,因此还需要独立确认其与锁释放的因果关系。
Memory and OOM evidence
本次没有发现硬 OOM:
memory_failcnt=0- Docker
OOMKilled=false - MatrixOne 没有重启
- 主机
oom_kill保持34 -> 34 - 初次出现锁等待时,lane aggregate cgroup 内存约为
5–8 GiB
后续 1000W 阶段 lane aggregate cgroup 峰值约 84.62 GiB,但这发生在锁等待问题已经出现之后,不能作为初始根因。
Initial assessment
当前最可能的故障链路是:
事务完成/锁释放停滞
-> 行锁等待超过 1 分钟
-> TPCC 返回 1205
-> 活动事务无法及时结束
-> 后续 case 出现 context deadline exceeded
-> workflow 以 exit 124 终止
目前 artifact 中没有记录完整的持锁事务调用栈,因此尚不能确定具体是事务提交、锁服务、ISCP transaction finish,还是其他后台任务阻塞了事务完成。
Expected result
完整 TPCC suite 应在所有阶段完成,事务错误为 0,活动事务能够在 case 到达时间限制后正常退出,并且不应持续出现超过 1 分钟的行锁等待。
Suggested investigation
- 在首次
lockservice wait too long时采集持锁事务的状态、SQL、开始时间和提交/回滚路径。 - 关联
iscp transaction finish timeout与具体事务 ID,确认它是否阻塞锁释放,或只是误报日志。 - 在每个 TPCC case 结束时检查是否仍有 active transaction/lock waiter,避免后续 case 继承前序状态。
- 使用全新 MatrixOne 实例分别运行
10W/100T和完整 suite,区分单 case 问题与前序状态累积。 - 增加完整 TPCC suite 的回归测试,覆盖零 OOM 但事务锁长期不释放的场景。
Related issues
- [Bug] TPCC warehouse=1000 Go GC 长暂停(500-900ms)导致 Lock wait timeout(4.2-dev / main 均偶现) #26182 — TPCC 高并发锁等待/性能下降
- [Bug]: ISCP timeout causes are reported immediately before timeout #29392 — ISCP timeout 日志可能误报
- [Bug]: TPCC 100W/1000 terminals OOM-kills 84GiB single-node MO on main #29270 — TPCC 完整 suite 的内存压力问题
Activity
daviszhen commentedon Sep 28, 2026
补充最近 3 天
mo-auto-testmain 分支中标题为129 Family · full · all · full · main的回归结果。结论:最近 3 次运行中有 1 次明确出现 TPCC 锁等待问题,另外 2 次未复现,当前表现为间歇性问题。
Lock wait timeout;后 3 个 case 以 exit 124 超时Run
36329945107的详细证据:Lock wait timeout exceeded、151 条wait too long。81.88;正常的两次运行分别为7464.95和7456.90。Run
36252336114和36155105197的服务日志中虽然存在iscp transaction finish timeout,但没有lockservice wait too long或Lock wait timeout exceeded,且 TPCC 全量验证成功,因此不能仅凭这些日志判定为 TPCC 锁问题。另外,三次 GitHub 回归任务的整体状态均为 failure,但后两次的 TPCC job 均成功,整体失败来自其他测试族或检查。
LeftHandCold commentedon Sep 28, 2026
Root-cause update: confirmed performance regression introduced by #28851
The investigation now has a deterministic adjacent-commit reproduction of a prepared numeric-primary-key storage-filter regression, in addition to the TPCC symptoms originally reported here. A TKE run reproduces the severe throughput collapse and also exposes Sysbench failures through the same affected point-lookup path.
This is not an OOM explanation, a generic claim that high concurrency is unsupported, or an attribution based only on commit timing.
Affected version and introducing commit
fix: align date compatibility semantics.a99db843c7b4630a86883addc9424433d93fc2d2.1575e70c3db676d3ed00abc080aadc029b0e1435.d99187d7b3bfda8744088b3ae8cf16739b690aa0.mo-main-family-36409954461-1; TP CN:nightly-regression-dis-tp-cn-q5ld4.useServerPrepStmts=true).The original 129 reproduction in this issue also used the introducing commit
a99db843c7. The detailed runtime chain below was independently collected from TKE; it is not presented as a reconstruction of every transaction from the original 129 run.The code defect
For a normal parameterized integer-key predicate such as
WHERE id = ?, the prepared plan contains an implicit string-shaped-parameter-to-integer CAST. The new statement-diagnostic classification treats this CAST as potentially diagnostic and removes the containing predicate from storage filters even when the current bound value is a valid integer.The original SQL predicate remains in the upper-level filter, so this is a selectivity/performance regression, not evidence that the WHERE condition stops being enforced.
Relevant source at the affected job SHA:
filterScanStorageExprsbefore folding the current execution's parameters. Both reader filters and block filters go through this screening.The join-specific diagnostic-free proof does not cover an ordinary single-table point lookup. Normal numeric parameter executions can retain the prepared plan; they do not necessarily replace the CAST with a literal before this check.
Deterministic parent/commit/current verification
An isolated local worktree was used. Production implementation was not changed or stubbed. The harness exercises the production SQL parser,
BuildPlan, storage-filter selection, and parameter folding.The parser/planner probes are:
tpch.parthere is the existingNewMockCompilerContexttable, not a separately loaded benchmark dataset. The prepared query is bound to valid value7in the process parameter vector. A second expression-level probe independently verifies that the sameCAST(?)successfully folds to integer 7.1575e70c3da99db843c7d99187d7b3The job SHA was additionally tested with
-count=5: both parameterized assertions failed on all five executions, while the literal control passed all five times. These are intentional invariant-check failures demonstrating the defect, not test compilation or setup failures.This pins introduction of the storage-filter defect to the adjacent transition
1575e70c3d -> a99db843c7. It is not a claim that a full TKE TPCC suite was rerun on the parent or that a fix has already passed acceptance.Historical throughput: the previous nightly was already affected
b1b68925d75a96035fc7d99187d7b3Values are tpmC. Sources: earlier run 36250512349, previous run 36335119263, and the current TKE job above.
Sysbench
point_select, 1000 clients, 10 tables of 10 million rows each:b1b68925d7d99187d7b3The previous nightly already contains #28851 and has almost the same collapse. Therefore the additional dual-AP-ingress workflow change in the current manual run cannot explain the introduction of this regression.
Runtime evidence: scans, lock holding, and admission
All timestamps in this section are UTC on 2026-09-28; add eight hours for CST.
Scan amplification
txn.table.ranges.logrepeatedly reportsbmsql_stock,exprs="",blocks=125.exprs="",blocks=1230.sbtesttables repeatedly reportexprs="",blocks=1231.The
exprsfield records the storage BlockFilters, not the absence of an SQL WHERE clause. Together with the reproducible reader-filter loss and CPU stack, this establishes the selective-query-to-large-scan failure mechanism.Same-holder lock-wait chain
Holder transaction:
0b2bee4edc43841018d97698c30799a5.0b2bee4edc43841018d97698c3079a32has waited about 61.975 seconds for this holder01a0e7ba-ee2f-72eb-9698-c2c9940f7e27reportsExec.Runduration 80.744 secondsThe waiter executes
UPDATE bmsql_district SET d_ytd=d_ytd+? WHERE d_w_id=? AND d_id=?, with parameters4665.7,57,4.This is evidence of very slow work while holding locks, rather than proof of a lockservice unlock leak or a commit deadlock.
CPU profile
TP CN CPU profile, 10:57-11:02:
runtime.memmove: 29.96% self.Vector.unionBatchContiguousVarlenRange: 19.21% self.vector.shrinkFixed: 13.91% self.ConstructRowidColumnTo: 3.77% self.The dominant copy stack goes through
TableScan -> reader.Read -> BlockDataRead -> materializeBlockData -> LoadColumnsDataInto -> CopyCachedVectorAll -> UnionBatch, followed by the upper-level Filter. Cached data still incurs this repeated materialization/filtering cost.Sysbench connection/admission failures
backend handshake timeout, stageread-auth-response, against the TP CN.all candidate CN servers are temporarily unhealthy,candidate-count=1; read_only starts failing with 20508 at 12:54:37. This is the matching TP candidate being temporarily unavailable, not evidence that all AP CNs are also unavailable.transaction error: wait active; update_index/update_non_index fail withcontext deadline exceeded / createTxnOpUnsafe.Impact and remaining boundaries
No production code or cluster configuration was changed during this investigation.
daviszhen commentedon Sep 29, 2026
Lock wait timeout 二分结论
已使用 129 TPCC workflow,固定运行以下 4 个场景:
tpcc10.10、tpcc10.100、tpcc100.100、tpcc100.1000。二分边界
正常 commit:
1575e70c3db676d3ed00abc080aadc029b0e1435Transaction Error = 0Lock wait timeout、ErrorCode 1205或wait too long异常 commit:
a99db843c7b4630a86883addc9424433d93fc2d2tpcc10.100出现 2 次ErrorCode 1205: Lock wait timeout exceeded,均为TT_PAYMENTTransaction Error = 2,校验失败;后续tpcc100.*未继续执行wait too long和iscp transaction finish timeout结论
1575e70c...与a99db843...为相邻提交,因此当前二分已定位到:a99db843c7b4630a86883addc9424433d93fc2d2是首个出现 Lock wait timeout 的异常 commit。该提交标题为
fix: align date compatibility semantics (#28851)。测试期间内存峰值约 8.9 GiB,memory_failcnt=0,主机 OOM 计数未增加,因此本次失败不是内存压力导致。以上结论是回归定位证据,具体代码根因仍需进一步检查该提交的变更。fix: restore prepared TPCC filter selectivity with per-binding proof (#…
fix: preserve prepared ROUND and TRUNCATE value domains (#29508)
Ariznawlll commentedon Oct 2, 2026
测试版本
maina36da7f72d78030d8822ac310a9d20089db4c90f32f54981401fd3888702f2dab8702d2e62c6997amain:d59cc02ef6ca68f340c9570e56f7eb71d90e42e7已核对 Git 提交关系:修复 commit 和验证 commit 均为当前
main的祖先,当前main已包含该修复。原问题验证
原问题已定位到 #28851 的 commit
a99db843c7b4630a86883addc9424433d93fc2d2。普通 prepared 数值主键条件的 storage filter 被移除,点查/点更新退化为大范围扫描;事务执行时间和持锁时间被放大后,级联产生1205 Lock wait timeout、context deadline exceeded,最终多个 TPCC case 被外层超时以exit 124终止。修复 #29462 在参数绑定和优化阶段恢复了 prepared 数值条件的选择性,并保留转换诊断语义。修复合入后,使用完整 TPCC suite 进行了两轮独立验证,均执行以下五个场景:
10W / 10 terminals10W / 100 terminals100W / 100 terminals100W / 1000 terminals1000W / 1000 terminals两轮均完成全部负载与一致性校验,没有再次出现原问题的长时间持锁、case 无法收尾或 workflow 超时终止。
正常路径覆盖
3164.903054.630 / 08636.908850.230 / 09262.409224.550 / 08588.108536.450 / 06215.636307.470 / 0exit 124。异常症状核对
对两轮完整 Job 日志检查以下原问题特征:
Lock wait timeout:0wait too long:0Transaction Error:0context deadline exceeded:0exit 124:0原失败 Run
36329945107中,10W/100T之后出现1205,后续三个大场景超时退出;修复后的两轮中,相同场景全部完成且事务错误为 0,说明原来的“扫描放大 → 长持锁 → 锁等待 → active transaction 无法结束 → 超时终止”链路未再复现。白盒验证
修复 PR 增加了
test/distributed/cases/prepare/issue_29429_prepared_filter.sql及对应结果文件,覆盖 prepared 参数绑定、数值主键过滤和重复执行。PR 验证记录还包括:61/61通过;相邻 vector prepared-range 用例64/64通过。500/500通过。102.59%,恢复了该缺陷对应的 prepared 执行性能。回归测试
maincommit32f54981401fd3888702f2dab8702d2e62c6997a,完整覆盖五种仓库数/终端数组合。范围说明
当前另有独立问题 #29564:#29527 引入 prepared stats admission 重复重建计划,导致 TPCC 吞吐下降。该问题的五个场景可以完成、事务错误为 0,不会复现本 issue 的
1205、长持锁和exit 124链路,因此继续由 #29564 单独跟踪,不作为 #29429 的复现。测试证据
测试结论
测试通过。