Skip to content

[Bug]: 4.2-dev Sysbench random_points TPS 下降 84%,二分指向 PR #32878(待隔离复验) #32965

Done

Description

@Ariznawlll

Description

4.2-dev 单机 Sysbench random_points 1000 线程测试出现约 84% 的 TPS 下降。

二分结论:性能下降的边界初步指向 PR #32878:Fix SHOW metadata access for table-level grants。 同一 Slot A 上,其直接父提交 2ff65123ee8a3a58469089434439c89b391d4fa9 为 32,942.64 TPS,合入提交 81d4349caaafe6d7dc3a2ffadd8ed9fac6707d47 为 5,222.34 TPS,下降 84.15%。两个提交相邻,各执行一次,均为 0 ignored errors。

**结论限制:**测试时无法独立核实宿主机后台负载,尚未完成隔离复验和 profile;因此 #32878 是有相邻提交证据的强嫌疑 PR,不是已证实的代码根因。

Environment

  • MatrixOne:4.2-dev,具体提交见下表;128 裸机单机运行,Slot A。
  • 用例:sysbench1000w.random_points_1000,1000 万行、1000 线程、正式测量 5 分钟;所有二分样本使用相同用例与 Slot A 资源配置。
  • 二分工作流控制提交:212e03c0b1754941bd5c3ff75e0e09aa85e1a2e8。构建所需 ONNX 缓存按 subject 中的 SHA-256 校验后,仅放入当前运行的 checkout。

Steps to reproduce

  1. 在 128 单机 Slot A,使用同一工作流和原始 sysbench1000w.random_points_1000 测试 1000 万行、1000 线程、5 分钟,分别构建并运行下表的 MatrixOne 提交。
  2. 比较完成后的事务 TPS、错误数及运行环境;不要将存在资源冲突的样本作为正式性能基线。

Actual behavior

版本 TPS 忽略错误 证据
54956dc8e9e1315e38956b0ba3662e3f8a51b6c4,历史 good 对照 32,844.34 0 run 44663846856
f4dc8554a3bd4f92d1e009cb2dcb2bd227036861,#32905 合入后 32,917.56 0 run 44665340272
2ff65123ee8a3a58469089434439c89b391d4fa9,#32878 的精确父提交 32,942.64 0 run 44669072507
81d4349caaafe6d7dc3a2ffadd8ed9fac6707d47,#32878 合入后 5,222.34 0 run 44667597762
71e22339c8cca62b2f29f9fd6e686e653a1ff2d2,#32891 合入后 5,228.67 0 run 44660858323

原始 nightly 的相同子项为 5,208.85 TPS,参考历史中位数约 30,664 TPS:原始失败 job。#32878 合入后样本比 #32905 对照低约 84.1%。

Expected behavior

相同数据规模、线程数、时间和可比资源拓扑下,random_points 吞吐不应较正常对照出现上述大幅下降。

Stability and controls

  • 目前有两个不同的后续提交低速样本和三个正常提交对照;这不是同一提交 3/3 次复现,也未验证最新官方 main。
  • 以上样本均报告 0 ignored errors;工作流报告对应 owner 的 Slot 清理成功。正确性检查不等同于完整结果 golden 验证。
  • 测试期间宿主机 SSH 不可用,无法独立确认后台稳定性/Chaos 等并发负载及完整资源状态;隔离复测仍是归因前提。
  • [4.2-dev] Fix SHOW metadata access for table-level grants #32878 的精确父提交为 32,942.64 TPS,其直接后继为 5,222.34 TPS,下降约 84.15%;相邻版本各有一个同槽位样本。尚需排除后台干扰并复验,不能将该 PR 当作已确证的根因。

Code analysis

探索性二分边界落在 #32878:其直接父提交正常、合入提交低速。#32878 涉及权限及查询执行路径,但具体慢点和因果链尚未确认,需要资源隔离复测及性能 profile。

Regression coverage

根因确认后,应增加针对相同性能敏感路径的可重复基准或回归测试,并明确资源拓扑与基线。

Related

  • 历史问题 #27838:已关闭,曾有相似 random_points 性能下降,但关联不同 PR 和时间;目前不能断言属于同一根因。

Activity

  1. added this to the MO-202611 milestone on Nov 20, 2026
  2. added
    kind/bug
    on Nov 20, 2026
  3. added theissue type on Nov 20, 2026
  4. changed the title [-][Bug]: 4.2-dev 单机 Sysbench random_points 1000T TPS 下降约 84%(待隔离确认)[/-] [+][Bug]: 4.2-dev Sysbench random_points TPS 下降 84%,二分指向 PR #32878(待隔离复验)[/+] on Nov 20, 2026
  5. added a commit that references this issue on Nov 20, 2026
    1ca6856
  6. XuPeng-SH commented on Nov 20, 2026

    @XuPeng-SH
    Contributor

    转 QA 验证,不代表验收通过。#32983 已于 2026-11-20 10:33:44 UTC 合入 4.2-dev,merge SHA 1ca6856f4f45c03ee6cb8e472764e967da725fea,最终 head 207fc9573a09c8417ad8aadafdd027c6f677c832。

    修复 prepared IN 参数列表的列引用判断:非空列表全部元素均为执行时常量时允许参与 block selectivity 估计,避免 lookup 被高估为 AP 而无法复用 prepare-time physical compilation;仍拒绝含列引用的列表及嵌套列引用。当前未见适用于新修复的已验证反例或未完成开发 follow-up,旧版二分样本不作为新版本失败证据。

    作者报告 Linux 全量 race unit suite、额外 catalog 包、planner vet 与增量 lint 通过;UTC standalone SQL suite 108,941 项 active checks / 1,286 scripts 通过,1,102 项 ignored 不计通过。同机 1,000 线程 sysbench、每版本一次五分钟测量:修复前 1,658 TPS,修复后 2,786 TPS,pre-regression 2,720 TPS;p95 1,352 → 847 ms,固定参数结果一致且执行错误为零。这是 PR 作者报告,不是本轮本地实测;其绝对吞吐不能与原 Slot A 约 32,943 TPS 基线直接拼接,也不是多轮统计结论。

    请 QA 用原 random_points 1,000 万行 / 1,000 线程及可比资源隔离条件复验,记录实际版本、后台负载、吞吐/尾延迟、结果与错误数;检查 prepared/literal 非覆盖二级索引 lookup、执行类型及 prepare 复用,保留含列/嵌套列引用拒绝对照。原现场性能恢复与多轮可重复性仍待验收。本轮仅远端范围核对,未运行本地测试或审计作者原始日志。移除研发负责人,改派唯一 Ariznawlll;不自动扩展到其他分支。

  7. slyunnn commented on Nov 23, 2026

    @slyunnn

    Regression and extended verification for #32965 (2026-11-23)

    Fixed — the reported throughput collapse was reproduced and recovery verified in nine original-size measurements. Keep the issue open as requested.

    Verification Environment

    Latest fetched origin/4.2-dev@6c05e42f9f660a207077b050b8ec285ccf3f8103: [4.2-dev] fix(disttae): isolate clone deletes by logical table (#33043). SSH git fetch origin completed in the isolated clone and HEAD matched the remote ref.

    Built with Go 1.26.4, unchanged service source and vcs.modified=false. Embedded VCS metadata records the full SHA. Binary SHA-256: bf09490349cb0311d7e22dacea31cda8f3011ae3c96e4e6281404e098dc6d500.

    Native topology: 2 CN / 1 TN / 1 Log service / Proxy, using unchanged target-commit launch configuration and fresh isolated data. Proxy 6001, CN1 16001, CN2 16002 each actually executed both added regression cases. All returned git_version()=6c05e42f9f. Protocols: text SQL with SQL PREPARE/EXECUTE, and binary COM_STMT_PREPARE/COM_STMT_EXECUTE.

    The initial unavailable local environment was repaired through a separate build/runtime. Existing source, Docker configuration, binaries and data were preserved. No main acceptance is claimed.

    Original performance acceptance used a separate original-host standalone topology: 1 CN / 1 TN / 1 Log service, with its original SQL frontend, native Sysbench 1.1.0-de18a03, and binary prepared statements. It held one host-exclusive lease throughout all three revisions, used the same CPU/NUMA/memory policy, and built each revision from a fresh clean source checkout. Actual build metadata records full VCS revisions, vcs.modified=false and binary SHA-256 values; each running service returned the expected git_version() prefix. The observed MO container was limited to 32 logical CPUs, NUMA node 0, and 84 GiB memory with no additional swap allowance.

    The original immutable client is mo-sysbench@1a7886fc7566dfc9fd85a81801f09471151365d3; the existing adapter base is d3177a6095e7d70f8387badc60921ec7dfaf8cf4. The test wrapper applies an audited unit-name-only correction to satisfy the unchanged controller's exclusive-owner identity. Service source, original workload SQL and existing deployments were preserved. Complete Actions run and raw/structured artifact.

    What Was Covered

    • OK — repair #32983, [4.2-dev] Preserve block selectivity for prepared IN lookups, merge 1ca6856f4f45c03ee6cb8e472764e967da725fea, is an ancestor of the verified target. Final PR head: 207fc9573a09c8417ad8aadafdd027c6f677c832.
    • OK — 20,002-row functional fixture: prepared/literal equality, non-covering secondary-index lookups, duplicates, NULL, all-miss/all-NULL lists, changed bindings, signed BIGINT limits, column/nested-expression controls, invalid empty IN () returning 1064, and intact data after the error.
    • OK — binary prepared protocol: 10 exact-result checks per endpoint, including forced/unforced index lookups and reuse after all-NULL bindings; 30 checks across the final three-endpoint replay.
    • OK — existing planner tests TestExtractColRefInFilterNested and TestPreparedInIndexLookupKeepsTPPlan passed. The latter uses synthetic 10,000,000-row statistics; it is not a real large-table execution.
    • OK — both added cases recorded; targeted two-case replay on each endpoint: total=2 success=2 failed=0 skipped=0; stmts=24 ok=24 fail=0. MOTR counts the protocol script as one statement; it internally checks 10 results.
    • OK — existing frontend test TestInitExecuteStmtParamReusesCachedCompileWhenNoSchemaChange passed on the same target, directly checking cached compile object reuse in a controlled unit fixture. This is not a production cache-hit counter.
    • OK — post-test SQL health at all endpoints and 9/9 branch-selection checks.
    • OK — original sysbench1000w.random_points_1000: 10 tables × 10,000,000 rows loaded from identical fully hashed CSV inputs; the original four-column query actually targets sbtest1 (10,000,000 active rows). Each revision completed 3 separate measurements with 1,000 threads for at least 300 seconds: 9/9 total. All recorded durations were between 300.1408 and 300.2769 seconds; all execution errors and reconnects were 0.
    • OK — the original SELECT id,k,c,pad FROM sbtest1 WHERE k IN (?,?,?,?,?,?,?,?,?,?) returned the same 909 complete rows under fixed literal/prepared bindings on all three revisions. Complete-row SHA-256: f73688d1e7b6aeafcbc7a08ad06ddaa0ddc1c35894b44e5d37c5d949b29e10d1. All-NULL then rebound checks passed; all nine SELECT c ... ORDER BY c result digests and all per-table row-count checks matched.
    • OK — literal EXPLAIN and actual EXPLAIN ANALYZE retained the expected TP QUERY PLAN / tp query plan titles on all revisions. These literal diagnostics do not distinguish the prepared regression; the focused planner and cached-compile tests cover the relevant prepared mechanisms. Post-query service/connection health passed, and every 5-second sample observed exactly one MO process. Exact owned-resource cleanup and an independent read-only lease audit passed.
    • Not covered — production prepared-cache hit/physical-compilation counters, multi-CN large-load execution and the full BVT/MOTR suite. The original lookup uses a single-CN path; no engine-parallelism claim is made. Numeric fixture values near 8,192 alone do not establish physical block boundaries.

    Findings

    Revision Exact commit Three TPS measurements Median TPS Median p95 (ms)
    Pre-regression 2ff65123ee8a3a58469089434439c89b391d4fa9 33044.48, 32630.17, 32426.43 32630.17 52.89
    Regressed 81d4349caaafe6d7dc3a2ffadd8ed9fac6707d47 5263.07, 5212.37, 5204.91 5212.37 277.21
    Latest repaired 4.2-dev 6c05e42f9f660a207077b050b8ec285ccf3f8103 32730.60, 32226.89, 32037.91 32226.89 53.85

    The regressed revision reproduced a 84.03% throughput loss. The latest repaired target reached 98.76% of the pre-regression median, 6.18× the regressed median; its median p95 returned to 53.85 ms from 277.21 ms. Within-revision sample TPS coefficients of variation were 0.96%, 0.61% and 1.11%, respectively. Three repeats establish observed repeatability, not a statistical confidence interval.

    The repair restores runtime-constant prepared-list selectivity while conservatively rejecting lists with column references. The repeated original-load recovery and correctness checks are consistent with this fix. The original generator remains time-seeded: stochastic parameter sequences differ, while the SQL template, per-thread key-range policy, CSV content and deterministic correctness bindings are identical. Revisions ran serially in pre-regression/regressed/repaired order. Host and owned-cgroup samples were retained; observed CPU activity outside the owned slice was comparable between baseline and repaired runs (per-round medians about 3.5–3.6 CPU cores, including kernel activity and other work).

    Large-data regression was required and completed, because row/selectivity estimates and high-concurrency prepared execution drive this defect. This original standalone workload is separate from the local three-endpoint functional coverage. Local cases/endpoints ran serially (-j 1); the performance workload used 1,000 actual concurrent client sessions. MOTR scheduling is not evidence of engine parallelism.

    Earlier setup/collector attempts were infrastructure/harness failures. One preliminary completed measurement was not used in the nine-round comparison. The completed campaign and independent cleanup audit are the acceptance evidence.

    MOTR / BVT Coverage

    • Base: MOTR 4.2-dev@7ee76c16f9bac6fdb65939d56c997344474791bb.
    • Independent branch: test/issue-32965-prepared-in-lookup.
    • Single source commit: 17d866c2245c2d8f0e8e09cc6fe80e8250b279d4, test: add MOTR regression for #32965.
    • Daily cherry-pick: 63a5b33d0fdbc6116a63a343bf52ed9303533e06, included in daily aggregate PR #381, targeting 4.2-dev. No per-issue MOTR PR was created.
    • Issue branch tracking and remote SHA verified. Both cases are registered for 4.2-dev; exact discovery count updated from 560 to 562; selection checks passed.
    • Dedicated performance test: mo-auto-test PR #286, commit 7ea24f567254048d2587ee3f83b0382e78e3edcb. The successful campaign ran control commit 72fbdf251775c6ec98701058834723d8a8696477; its scripts/workflow are byte-identical to the delivered commit, whose only additional change registers the existing runner label for actionlint. Test-branch CI passed. Full BVT/MOTR and TKE acceptance were not executed.

    Final Conclusion

    Fixed for the reported 4.2-dev Sysbench prepared-IN throughput collapse at 6c05e42f9f660a207077b050b8ec285ccf3f8103. Original-scale three-version comparisons, extended SQL/binary-protocol correctness, prepared-planner/compile mechanisms, health checks and exact cleanup passed. Keep #32965 open, as requested.

  8. added
    close
    on Nov 23, 2026
  9. Ariznawlll commented on Nov 24, 2026

    @Ariznawlll
    CollaboratorAuthor

    结论

    测试通过。4.2-dev 的原始 random_points 吞吐下降在修复版本的原规模对照中已恢复;本轮核查了先前独立运行的原始日志、结构化结果及修复合入关系,并非本轮重新触发压测。

    关键证据

    • 修复 #32983 已合入 4.2-dev,合入 SHA 为 1ca6856f4f45c03ee6cb8e472764e967da725fea。实际验收版本为 4.2-dev@6c05e42f9f660a207077b050b8ec285ccf3f8103;截至本次核查的分支头 9ed1645371c63ad2c417022de9e4d56db8697ecc 包含该验收版本,但分支头本身未重新压测。
    • 原规模隔离对照运行成功,原始日志和结构化数据见验收产物。使用同一单机资源策略和数据:10 张表、每表 1,000 万行;原始查询访问 sbtest1,1,000 并发、每轮至少 300 秒。三版本各 3 轮,9 轮均无 ignored errors 和 reconnects。
    • 回归前父提交 2ff65123ee8a3a58469089434439c89b391d4fa9 的 3 轮 TPS 为 33044.48 / 32630.17 / 32426.43,中位数 32630.17;回归提交 81d4349caaafe6d7dc3a2ffadd8ed9fac6707d47 为 5263.07 / 5212.37 / 5204.91,中位数 5212.37;修复版本为 32730.60 / 32226.89 / 32037.91,中位数 32226.89,恢复至回归前中位数的约 98.76%。对应 p95 中位数为 52.89 / 277.21 / 53.85 ms。
    • 固定参数的原始查询在三版本均返回相同的 909 行,完整结果摘要一致;修复版本的 literal/prepared 结果一致、全 NULL 后重新绑定通过。已有报告还覆盖实际二级索引 lookup、二进制 prepared 协议及异常输入后的连接可用性。
    • 已补充的测试资产:prepared IN 用例见 MOTR PR #381,原规模性能验收见 mo-auto-test PR #286;这两项目前仍为开放 PR。

    待解决点

    本结论仅覆盖该问题的 4.2-dev 单机原始负载;当前分支头、完整 BVT/MOTR 套件和 TKE 大规模负载未在本次核查中重跑,不据此扩展为其他环境均通过。上述两项测试 PR 的合并及后续 CI 由对应 PR 跟踪。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

closekind/bugseverity/s-1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions