Skip to content

[Bug]: Sysbench 1000W No-PK random-point TPS drops 60% after #28955 #29322

Closed as not planned

Description

@Ariznawlll

Description

129 单机 sysbench1000w.nopk_random_point_1000 在相邻 MatrixOne commit 间出现显著性能下降。二分定位的 first bad 为 5453d72b7372a9f77263d1dd4c982e616446d4cb,对应 PR #28955。

Environment

  • Branch: main
  • Good commit: db3915689fc9bccfd58a1a05b38b6e5329d43190
  • First bad commit: 5453d72b7372a9f77263d1dd4c982e616446d4cb
  • Deployment: 129 单机、隔离 half-host slot、Sysbench 1000W 数据集
  • Case: sysbench1000w.nopk_random_point_1000
  • Threads: 1000
  • Measurement duration: 5 minutes
  • Date: 2026-09-24

Steps to reproduce

在 mo-auto-test 的 Binary Search On 129 New workflow 上分别运行相邻 commit:

  1. Test_list=sysbench1000w
  2. SYSBENCH_TEST_LIST=sysbench1000w.nopk_random_point_1000
  3. After_Run=cleanup
  4. 比较最终 transactions ... (X per sec.)

Actual behavior

Commit TPS Result Evidence
db3915689fc9bccfd58a1a05b38b6e5329d43190 25,772.01 Good run 35959133717
5453d72b7372a9f77263d1dd4c982e616446d4cb 10,274.40 Bad run 35956227035

相邻 commit 间 TPS 下降 60.13%。相对固定基准 33,637.89 TPS,first bad 下降 69.46%。

两个 workflow 均成功完成;bad run 的 ignored errors 为 0,不是 SQL 报错或未完成测试造成的低值。GitHub compare 显示两个 commit ahead_by=1,中间没有其他 commit。

Expected behavior

同一数据集、拓扑和并发下,TPS 不应在相邻 commit 间下降 60%,且不应超过 25% 性能回归门限。

Stability and controls

  • Reproducer: first bad 当前复现 1/1
  • Control: 相邻 good 当前通过 1/1
  • Fixed baseline: 33,637.89 TPS
  • 25% threshold: 25,228.42 TPS
  • Data correctness: 两次 case 均成功,ignored errors=0
  • Environment: 二分前已释放 Nightly reservation,并清理占用约 23% CPU 的旧 Fulltext 孤儿进程;有效 run 独占 129 half-host slot
  • Follow-up required: 相邻 good/bad 各复跑至少 2 次,并采集 CPU/memory/profile,确认回归稳定性和具体热点

Evidence

Code analysis

二分结果将 first bad 定位到 #28955,但该 PR 的声明范围是 Fulltext2 UUID membership probe,与 Sysbench No-PK random point 没有直接功能关系。目前只能确认性能下降与该 merge commit 的边界相关,尚不能仅凭单次结果断言具体代码路径因果,需要结合复跑和 profile 进一步确认。

Regression coverage

修复后应在 129 单机性能回归中持续覆盖 sysbench1000w.nopk_random_point_1000,并以固定环境指纹和 25% 阈值做回归门禁。

Related

@VioletQwQ-0 请协助确认该提交是否可能影响通用点查执行路径,并结合 profile 排查性能下降原因。

Activity

  1. added this to the MO-202609 milestone on Sep 24, 2026
  2. added
    kind/bug
    on Sep 24, 2026
  3. added theissue type on Sep 24, 2026
  4. VioletQwQ-0 commented on Oct 19, 2026

    @VioletQwQ-0
    Collaborator

    Handoff — evidence and remaining work (2026-10-19)

    Attachment v2: issue29322-handoff-evidence-v2-20261019.zip (15.95 MB). This replaces the earlier compact ZIP, which omitted historical TPS/profile evidence.

    SHA256: ff2cc4e04d44fd8ccfe32de2a5e3f5f91f07bd4b0fa0402f90dd3ae0bd09ab20

    Historical TPS and actual CPU evidence

    Latest recovered complete steady window per listed subject in this investigation; these are historical measurements, not current-main results:

    Date Subject Role Steady TPS Run / whole-workflow result
    Sep 28 db391568 Original Good, follow-up 25,449.33 36410730222, success
    Sep 28 5453d72b Original first Bad, follow-up 25,547.90 36402912804, success
    Sep 29 0562e8eb Diagnostic subject 15,215.36 36559838939, success
    Sep 29 ae3b2792 Diagnostic subject 15,517.16 36566049092, failure after steady at the daily fence
    Sep 30 c6288361 Then-main 3,601.12 36686381733, success
    Sep 30 1d6c7573 Historical candidate 5,839.21 36692316433, success
    Oct 8 bab4b328 Then-main 6,040.18 37722405255, success

    The original Sep 24 report was 25,772.01 vs 10,274.40 TPS. The Sep 28 follow-up pair did not reproduce that 60% fall. Historical semantic checks/zero SQL errors do not establish full result equivalence; differing builds/data/profile contracts also prevent treating all rows as one controlled series. The original #28955 causal claim remains unconfirmed.

    There are real CPU profiles: bab4 has three 10-second samples at steady offsets 60/150/240s. OrderedLinearSearchOffsetByValFactory[uint64].func1 accounts for 52.81% / 53.38% / 52.41% flat CPU. Raw pprof, top/caller output, exact ELF hash and BuildID are included. These samples overlap the 6,040.18-TPS window; this is not an unprofiled arm. They identify a historical hotspot, not a measured optimization benefit.

    Established progress and limits

    • Complete controlled 10M correctness: G/B retained all 4,128 requests, identical logical data/trace/native client and 1,000 worker receipts. G had 4,080 mismatches, B had 0. For 4,000 ordinary requests, G returned 0 rows, B/oracle 40,186. G cannot serve as an equivalent performance Good in this fixture. This does not prove historical 100M runs wrong or quantify their TPS loss.
    • Optimization lead: B's derived ordinary-path analysis found 140,812 matcher calls; offline block-range filtering reduces aggregate candidate count by 88.03%, but all those block subsets remain nonempty. This is a matching-cost opportunity, not measured CPU/TPS gain or evidence that backfill reads disappear.
    • Code: earlier partial repair Fix primary-key runtime filter for index join backfill #29466 was merged; it did not close this issue's performance acceptance. The newer block-range prototype is inactive, with native/lifecycle correctness evidence but both component stability windows INCONCLUSIVE. Exact prototype/base identities and the patch are included. No newly qualified production matcher candidate or ABBA benefit exists. Tooling remains in matrixorigin/mo-auto-test#241 (Draft).
    • Where work stopped: planned baseline 914959373c3e1fcdd3e404e52448e466694bdaa9 has no completed full 10M correctness/TPS/profile milestone. Two personal 100M seed attempts failed (memory guard; then unavailable watchdog observation), leaving no accepted immutable seed. The second observation failure's exact operation remains unknown. Native TPS boundary hooks and candidate ABBA were not completed. Execution was cancelled; 129 remains paused.

    Package contents and suggested takeover

    historical-tps/: seven steady client logs/excerpts, other phase totals, full SHAs/run states and original-source hashes. profiles/: the three bab4 profiles and readable analysis. G/, B/: full selected result/trace/oracle/receipt JSON. Other files contain derived attribution, component failures, exact identities/status, and the inactive code/test patch. MANIFEST.json plus offline python3 verify.py checks included bytes, all wire results/receipts, historical TPS values and profile integrity. It does not rederive omitted raw probe aggregates or certify performance qualification. Service logs, database files, binaries and personal-host details are excluded.

    Next: inspect the existing profiles and prototype first; establish a correct baseline's 1,000-thread TPS and independent CPU profiles on a validated 10M seed, then test one optimization through real SQL under identical conditions. Keep historical regression attribution separate. A validated 10M comparison can support a production Draft; full 100M confirmation and explicitly reauthorized 129 acceptance (two valid steady windows at least 25,228.42 TPS, CI/QA) remain outstanding. This handoff does not close the issue.

  5. daviszhen commented on Oct 20, 2026

    @daviszhen
    Contributor

    First-appearance analysis — mechanism-fit first-bad candidate, staged confidence (2026-10-19 follow-up)

    Based on the Oct-15 G/B controlled replay evidence plus the sanctioned historical series (handoff v2), the collapse can now be bounded and ranked by mechanism fit. Three confidence tiers are kept strictly separate, matching the existing historical_60_percent_cause: UNCONFIRMED stance.

    1. Mechanism fingerprint (decisive, from G/B arms, identical trace/data bytes)

    G arm (base db391568, Sep-17 code) B arm (base bab4b328, Oct-8 then-main)
    4,000 ordinary requests index_read_calls=0, base_read_calls=0 index_read=7,978, base_read=140,812
    Block matcher candidate evaluations 0 1,153,412,928 (hits 40,186 = 0.0035%; 71.6% no-hit)
    Base-read calls per ordinary request 0 35.2

    On Sep-17 code this workload never enters the block-level linear match path at all — a structurally different fast shape. On current code every point read degrades into mass linear block search (consistent with OrderedLinearSearchOffsetByValFactory[uint64].func1 ≈ 52.8% flat CPU at steady). The regression is loss of the fast reader shape, not a slow query.

    2. Timeline (measured, sourced from handoff v2 index + nightly artifacts)

    Date Subject Steady TPS Note
    Sep 28 re-run db391568 (Sep-17 code) 25,449.33 Sep-17 code good; above gate 25,228.42
    Sep 28 re-run 5453d72b (same SHA as original first-bad) 25,547.90 Original #28955 causal claim disproven
    Sep 29 0562e8eb / ae3b2792 (diagnostic branches) 15,215.36 / 15,517.16 ~40% loss already present
    Sep 30 c6288361 (then-main) 3,601.12 Second collapse (15k → 3.6k)
    Oct 4 #29466 merged (partial repair) —
    Oct 8 bab4b328 (then-main) 6,040.18 low plateau
    Oct 16–19 main nightlies (38925029506, 39045458288, 39140936814, 39279222025) 5,955 / 6,028 / 5,877 / 5,976 No recovery; ≈ 23–24% of gate. Sibling case nopk_point_select stays healthy at 26–27k, so damage is isolated to the random-point linear-search path.

    3. Staged verdict

    Excluded: 5453d72b / #28955 — same-SHA re-measurement at 25,547.90; mechanism unrelated (fulltext UUID probe).

    Primary suspect (mechanism-fit), first collapse (25.5k → ~15k, merge window Sep 23–24): c701ffa4 = #29352 (Sep 24, "release completed prepared scan readers"), pkg/sql/compile/scope.go +6 −0:

    // A prepared scope is retained for reuse, so do not keep its closed reader
    // (and the reader's snapshot) reachable until the next EXECUTE.
    if s.DataSource != nil && !s.DataSource.isConst {
        s.DataSource.R = nil
    }

    Nil'ing the retained reader on prepared scopes forces the next EXECUTE to rebuild the reader from scratch; if the rebuild loses the preserved filter/pushdown binding state, point reads fall back to the block linear-scan shape observed in the B arm. Triple corroboration: (a) the Sep-29 probe ladder themes (Probe index scan storage filters, record block filter state, Fix prepared index filter storage pushdown after diagnostic proof, scope prepared rebinding rows to each execution); (b) in-tree fixes aimed at exactly this family — #29462 "restore prepared TPCC filter selectivity" (a36da7f7, Sep 29) and #29466 partial repair (ff53ee2e, Oct 4); (c) the fallback path's CPU hotspot is precisely the block linear search.

    Same-window candidates not yet excluded (weaker mechanism fit): #29189 b0ab3f29 (Sep 23 — changes ConstructBlockPKFilter semantics for invalid base PK predicates; nopk tables are exactly the invalid-PK case), #29100 3b34a2ee (Sep 23, vector distance domain), #29369 5d80e0bc (Sep 24 18:53, prepared table-function domains; after the Sep-24 nightly boundary).

    Second collapse (15k → 3.6k, Sep-30 main): suspects #29513 76862df5 (block-filter/expr_opt rewrite — the investigator probed this exact commit twice on Sep 30) and/or #29462 blast-radius. Not decidable from current data.

    4. Minimal pinning experiment (the one remaining gap)

    Same slot, paired A/B: c701ffa4^ (parent-chain point after #29189's merge) vs c701ffa4, ≥ 2 steady windows each, immutable seed. The revert surface is 6 lines, risk minimal. A reproduced ~40% delta closes first-bad attribution for the first collapse; the Sep-30 stage needs its own pair (#29513^ vs #29513) afterwards.

    Bottom line: first appearance = Sep 23–24 merge window, mechanism-primary suspect #29352 c701ffa4; the Sep-30 aggravation is a separate, second event; the original #28955 attribution was noise. Current main remains at ~6k TPS (≈ 18% of the 33,637.89 baseline), so the performance acceptance (two valid steady windows ≥ 25,228.42 TPS) is still unmet.

  6. LeftHandCold commented on Nov 16, 2026

    @LeftHandCold
    Collaborator

    2026-11-16 复核与关闭说明

    按维护者本次明确要求,在补充以下复核证据后关闭此 Issue。关闭原因使用 not_planned,不是 completed:不表示原性能目标已恢复,也不表示已证明不存在性能问题。 原报告将问题归因于 #28955 的结论没有得到后续受控证据支持,本条不再按该归因继续追踪。

    1. 最近四轮 129 Main 正式回归确实执行了对应 Case

    日期按 Case 实际执行的北京时间计算;以下均为 sysbench1000w 的 No-PK random-points,不混用 TKE 或普通 point-select 数据。

    日期 实际 MO Commit TPS 查询错误 / 重连 正式测量时长 原始 Job
    11/13 b9c06b27b0d7 8,066.07 0 / 0 300 秒 43244688168
    11/14 5009da9d29ca 7,804.97 0 / 0 300 秒 43449607733
    11/15 bc9b822cd1f5 7,980.06 0 / 0 300 秒 43608470213
    11/16 294076edf496 7,371.45 0 / 0 300 秒 43728114211

    四轮都完整执行,并非跳过后的绿灯。当前处于约 7,400–8,100 TPS;没有证明恢复到原报告约 25,000 TPS 的水平。

    原二分 Workflow 与最新正式回归锁定同一个 mo-sysbench SHA 1a7886fc7566dfc9fd85a81801f09471151365d3。查询为 binary prepared SELECT id,k,c,pad FROM sbtest1 WHERE k IN (10 个参数),1,000 线程、300 秒。虽然准备了 10 张各 1,000 万行的表,该脚本实际查询 sbtest1;1000 指线程数,不是 IN 参数数。冻结脚本

    最新资源回执为 129 半机独占 Slot、28 个绑定 CPU、Slot 总预算 96 GiB、MO 容器上限 84 GiB。历史与当前不是同一物理数据种子及缓存状态的受控 A/B,不能把跨日期数值差距全部归因于某个 PR。现有行数/聚合合同和零 SQL 错误,也不能替代每条查询结果的独立正确性核验。

    2. 近期 PASS 不等于原性能问题已修复

    最新发布日志为:

    current=7371
    baseline_median=8043
    history=[7980,7805,8066,8043,8094]
    allowed_regression=25%
    

    当前值比滚动基线低约 8.35%,因此通过该门限;它不是在检查本 Issue 原固定验收线 25,228.42 TPS。没有发现这条 PASS 的计算错误,但不能拿滚动基线 PASS 证明历史性能恢复。

    3. 修复进展和原归因的边界

    • Fix primary-key runtime filter for index join backfill #29466 已合入且包含于最新实测版本;该 PR 明确属于索引回表 runtime filter 的部分修复,不构成本 Issue 完整性能验收。
    • perf: accelerate unordered primary-key IN filtering #32082 的无序主键 IN 匹配优化也包含于最新实测版本;其局部验证不等于本 Case 在正式规模、1,000 并发下已恢复,不能仅凭合入关闭为 fixed。
    • 10/19 交接证据中,原 Good 与原 First Bad 复跑分别为 25,449.33 / 25,547.90 TPS,最初 60% 降幅未稳定重现,因此 fix(fulltext2): avoid boxing loaded UUID membership probes #28955 引入点未被证实。
    • 同一交接材料中的受控 1,000 万行正确性实验,G 在 4,128 个请求中有 4,080 个结果不匹配,B 为 0;其中 4,000 个普通请求 G 返回 0 行,B/独立答案共 40,186 行。G 在该实验中不是合格的等价性能 Good。 这不证明所有历史大规模高 TPS 结果均错误,也不证明某个后续修复造成了回归。
    • 对 fix(compile): release completed prepared scan readers #29352 等 PR 的后续怀疑,仍不能代替返回结果一致的父子版本性能 A/B。
    • 采集时 Main HEAD 已推进至 7fcd9bdff843,其中有昨晚实测版本之后的执行优化;本次没有该 HEAD 的专项实测,不能提前声称这些更新已解决本问题。

    4. 关闭的含义与后续重新打开条件

    本次是维护者要求的停止跟踪决定,不是“性能修复验收通过”。不修改测试、基线、资源配置或本 Issue 其他元数据。

    后续若继续追踪,应先固定 SQL、数据、资源和预热条件,并用独立答案确认对照版本与候选版本返回结果一致,再取得至少两次完整 300 秒测量和对应执行计划/CPU profile。出现可重复、正确性等价的性能差距时,可重新打开本 Issue 或按明确机制关联新的 Issue;不要继续沿用未经证实的 #28955 因果结论。原固定基线如不合格,应明确修订验收依据,而非把错误结果的吞吐作为恢复目标。

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions