Skip to content

[Bug]: IVFFlat l2_only mode=pre recall regresses 46x and times out on 10M Wiki workload #27474

Closed

Description

@Ariznawlll

Description

On current `main`, the 10M Wiki IVFFlat `l2_only` query with `BY RANK WITH OPTION 'mode=pre'` regresses from a bounded recall run to an Action-timeout failure.

This is tracked as a new regression because the historical issue #24962 had been fixed and closed after #24972. The current failure appears after the later IVF query-path refactor #27297.

Environment

  • Branch / commit: `main` / `dd040ad6913e9b86f592b574e5fffb610003f72a`
  • Deployment: TKE nightly, 3 CNs
  • Dataset: 10M rows, `VECF32(768)`
  • IVF-FLAT: `lists=3162`, `probe_limit=5`, `quantization=float32`
  • Recall workload: `n=10000`, `k=10`, `concurrency=100`
  • Vector benchmark commit: `heni02/vector_benchmark@0bae04528673d7756c4ee2478ac8e4e41f54df1b`

Steps to reproduce

  1. Load the Wiki 10M dataset and create the IVFFlat index with the configuration above.
  2. Run the following recall workload:

```bash
python run_wiki.py recall --config "${WIKI_CFG}" \
--sql-mode l2_only --filter-mode pre \
--gt-source ann -n 10000 -k 10 --concurrency 100
```

The executed SQL shape is:

```sql
SELECT file_id, id
FROM jst_app_wiki.historical_file_blocks_wiki_ivfflat10m
ORDER BY l2_distance(embedding, ?) ASC
LIMIT 10 BY RANK WITH OPTION 'mode=pre';
```

Actual behavior

  • S3 load and index build both succeeded: `LOAD DATA=2035.08s`, `CREATE INDEX=1271.68s`.
  • The first `l2_only` pre-filter recall achieved only about `0.48 QPS`.
  • After about one hour it completed only `1720/10000` requests.
  • The GitHub job reached its configured `timeout-minutes: 200` and was cancelled before the first recall pass completed.
  • No MO panic, OOM, connection failure, or index-build failure was reported.

Evidence: nightly run, failed job.

Expected behavior

The workload should finish in bounded time and at a throughput comparable to the prior baseline, rather than leaving 100 concurrent SQL futures waiting until the overall workflow timeout.

Stability and control

A control nightly used the same vector benchmark commit and workload parameters but an earlier MatrixOne commit:

Current throughput is about 46x slower (`0.48 QPS` versus `20.25 QPS`). Raising the CI timeout would not resolve the product regression.

Code correlation

The current commit contains #27297, which replaced the query-time IVF search TVF with an optimizer-visible `VECTOR_INDEX_SCAN` path; the passing control does not contain it.

This is a strong correlation, not a line-level root-cause claim. The job timed out before its final `EXPLAIN ANALYZE`, so the remaining investigation must determine whether index pruning is missed, the candidate scan expands, or distributed execution blocks.

Suggested verification

  1. Compare `EXPLAIN ANALYZE` and profiles for this SQL on `7fa4a36aa` and `dd040ad6`.
  2. Run a focused 100-query workload at 1/10/100 concurrent clients to locate the scaling breakpoint.
  3. Add a per-query timeout in the benchmark so future failures preserve SQL-level evidence instead of consuming the job-level timeout.

Related

Activity

  1. added theissue type on Aug 22, 2026
  2. added this to the MO-202608 milestone on Aug 22, 2026
  3. Ariznawlll commented on Aug 22, 2026

    @Ariznawlll
    CollaboratorAuthor

    补充定位结果:

    已将回归范围收敛到 commit 5735684d69c9b171c4d7a5ebee3ebcc539ffc8cc(refactor: replace IVF search TVF with vector index scan #27297)。

    对比证据:

    • 正常基线 run 32384567524 使用 MO 7fa4a36aa,该 commit 尚未包含 5735684d;相同 vector_benchmark commit 和相同 10M Wiki / nprobe=5 / 100 并发配置下,首个 l2_only + mode=pre case 为约 20.25 QPS,10,000 queries 在约 494 秒完成。
    • 异常 run 32496073370 / job 96915377384 使用 MO dd040ad,已包含 5735684d;同一 case 仅约 0.48 QPS,运行约 1 小时只完成 1,720 / 10,000 queries,最终被 workflow 的 200 分钟 job timeout 取消。
    • 7fa4a36aa..dd040ad 范围内,IVF/vector 执行路径的改动来自 refactor: replace IVF search TVF with vector index scan #27297。

    初步代码级原因:

    1. refactor: replace IVF search TVF with vector index scan #27297 将 legacy ivf_search TVF 改为 VECTOR_INDEX_SCAN。
    2. 新路径在 relation_search.go 对 entries 扫描统一设置 PostFilterTopOnly: true。
    3. 该开关在 plan_reader.go 会跳过 reader.SetIndexParam,即不再走存储侧的向量 Top-K 下推;读取候选 entries 后才在 CN 内计算距离并本地压缩 Top-K。
    4. 当前 l2_only SQL 没有 WHERE 条件,因此 mode=pre 没有实际 membership filter。旧路径会执行带 ORDER BY vec_dist LIMIT 10 的 entries 查询;新路径仍无条件禁用物理 Top-K,导致每个请求需要读取并计算 nprobe 命中的大量 768 维候选向量。按 10M rows / 3162 lists / nprobe=5 估算,约为 15,800 candidates/query;100 并发下放大为明显吞吐回归。

    因此目前可以确认:性能回归由 #27297 引入;主要怀疑点是无过滤 IVF 查询也被强制走 PostFilterTopOnly,丢失物理 Top-K 下推。请研发确认无 membership / pushdown filter 的路径是否可恢复 storage-level vector Top-K,同时保留有 pre-filter 时的正确性保护。

  4. assigned and unassigned on Aug 24, 2026
  5. Ariznawlll commented on Aug 25, 2026

    @Ariznawlll
    CollaboratorAuthor

    在最新 main 对应的 TKE 回归环境复测:本次部署 MatrixOne commit b89a639b0,已包含修复 PR #27494。

    针对本 issue 的原始场景(10M Wiki、IVFFlat、无 WHERE、l2_only、mode=pre、10000 queries / concurrency=100)已恢复并可完整结束:

    • 第 1 轮:10000/10000,49.72 QPS,201.14s
    • 第 2 轮:10000/10000,17.27 QPS,579.03s

    对比本 issue 中原始现象约 0.48 QPS、1 小时仅完成约 1720/10000、最终触发 200 分钟超时,原始的无过滤 l2_only + mode=pre 性能回归未再复现。

    本次夜间任务最终被取消,是在后续另一条 l2_filter + mode=pre 路径(SQL 带 WHERE file_id = ?)中仅约 0.37~0.39 QPS,超时前约完成 2367/10000。该场景与本 issue 的无过滤复现条件不同,不能据此判定 #27474 未修复;建议作为带过滤条件的 IVF pre-filter 性能问题单独跟踪,并可结合 #26241 继续分析。

    关联任务日志:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/32743654178/job/97598706330

  6. assigned and unassigned on Aug 25, 2026
  7. Ariznawlll commented on Aug 26, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:b89a639b0c4ac30ae143cae3b67925678d347d3b
    • 部署方式:TKE big-data,10M Wiki 数据集,IVFFlat,100 并发
    • 测试日期:2026-08-25

    原问题验证

    按 Issue 原始条件执行:无 WHERE、l2_only、mode=pre、10,000 queries、concurrency=100。

    • 第 1 轮:10,000/10,000 完成,49.72 QPS,201.14s。
    • 第 2 轮:10,000/10,000 完成,17.27 QPS,579.03s。

    原问题约 0.48 QPS、运行 1 小时仅完成约 1,720/10,000 并最终超时;本次原始无过滤路径未再出现该性能回归。

    Happy Path 覆盖

    1. 10M Wiki + IVFFlat + l2_only + mode=pre,两轮均完整完成。
    2. 10,000 条查询全部返回,未出现超时、任务中断或结果缺失。

    Unhappy Path 覆盖

    1. 后续带 WHERE file_id = ? 的 l2_filter + mode=pre 路径仍出现约 0.37–0.39 QPS;该路径不属于本 Issue 原始无过滤复现条件,不能作为本 Issue 的失败结论,需另行跟踪派生性能问题。

    白盒验证

    不适用;本 Issue 验收目标是 10M 数据集上的黑盒性能与完成性。

    回归测试

    已在 TKE big-data 回归中覆盖原始 10M Wiki 场景;修复 PR:#27494。

    测试证据

    TKE big-data job

    测试结论

    测试通过。

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

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions