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
perf(S1): TPCH 10G 查询耗时翻倍 (+109%),二分定位到 #26706 (fix(lock): preserve bounded ranges for large DML batches) #27628
First bad commit: 35db232dfc3be3264c4dc0d2547a3429624392fb PR: #26706 — fix(lock): preserve bounded ranges for large DML batches Author: @XuPeng-SH Last good commit: 6742f958d4 (feat: ENGINE=KAFKA external table)
Activity
LeftHandCold commentedon Aug 26, 2026
这次 TPCC 下降不是正常波动。TPCC 部分可以高置信度定责到昨天合入的 PR #26706 (https://github.com/matrixorigin/matrixone/pull/26706),对应提交 35db232。具体瓶颈是该 PR 改造后的 远端 lock owner 按表释放路径,不是 B-tree 实际解锁变慢。
当前任务使用 8dd1efc,上一次正常任务使用 b89a639,而 b89a639 正好是 #26706 合入前的基线。
性能证据
同配置、同资源、同测试拓扑下:
场景 上次 本次 变化
━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━ ━━━━━━━ ━━━━━━━━
10W / 10 terminals 5361 5385 +0.4%
──────────────────────── ─────── ─────── ────────
10W / 100 terminals 19700 18234 -7.4%
──────────────────────── ─────── ─────── ────────
100W / 100 terminals 25319 23070 -8.9%
──────────────────────── ─────── ─────── ────────
100W / 1000 terminals 23918 16842 -29.6%
──────────────────────── ─────── ─────── ────────
1000W / 1000 terminals 12435 8144 -34.5%
这是典型的并发放大,而不是随机抖动:低并发基本正常,达到 1000 terminals 后锁 owner 饱和,吞吐稳定在更低的平台。
以 100W/1000 为例:
1000W/1000 下 lock-client RPC 更是从 12.73ms 增加到 29.16ms,与 tpmC 下降同步。
代码根因
合入前,owner 收到一个远端 Unlock 请求后调用事务级 s.Unlock():
旧版 service_remote.go (
matrixone/pkg/lockservice/service_remote.go
Lines 593 to 600 in b89a639
第一次请求会释放该 owner 上这个事务的全部锁。后续按表发来的请求通常变成廉价的 txn-not-found/no-op。
#26706 合入后,owner 改成:
新版 service_remote.go (https://github.com/matrixorigin/matrixone/blob/35db232dfc/pkg/lockservice/service_remote.go#L663-L676)
每个远端表都分别执行 unlockRemoteLockTable(),每次都需要:
这保证了 proxy handoff 和 table generation 的正确性,但把原来“一次完整处理加若干 no-op”变成了“每张表都走完整生命周期”。TPCC 每个事务涉及多张表,且热点 lock table 集中到一个 owner,于是产生 RPC 排队、owner CPU throttling和非线性吞吐下降。
#26706 的 benchmark 仅覆盖单 service、单 table,没有覆盖 3 CN、多表远端 owner,因此没有发现这个回归。
排除项
PR #27548 (#27548) 不是根因。它调整的是全局 DNS resolver 的作用域,FileService 使用的 HTTP resolver 没有发生语义变化。
另外,本次 nightly 的 TPCH 也出现了明显异常,并且集群创建阶段比前一天多等待约 9 分钟。这说明整轮任务还存在独立的基础设施或 AP 路径异常。但这些不能解释 TPCC 特有的“低并发正常、高并发 lock owner 饱和”以及 lock RPC 指标变化。TPCC 回归仍然可以单独定责到 #26706。
修复不能简单回退 #26706,否则会重新引入 lock generation/proxy handoff 正确性问题。合理方向是保留按表校验语义,但将同一 owner 的多张表合并成一次 RPC、一次 closure admission 和一次 generation lock,并补充 3 CN、多表远端解锁基准。
fix(lockservice): batch multi-table remote unlocks (#27653)
Ariznawlll commentedon Aug 31, 2026
tpch性能已恢复
fix(lockservice): batch multi-table remote unlocks (matrixorigin#27653)
fix(lockservice): batch multi-table remote unlocks (matrixorigin#27653)
fix(lockservice): batch multi-table remote unlocks (matrixorigin#27653)