Repository navigation
Description
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
- Load the Wiki 10M dataset and create the IVFFlat index with the configuration above.
- 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:
- Control run: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/32384567524
- Control commit: `7fa4a36aa`
- `l2_only` + `mode=pre`: `20.25 QPS`, `493.77s` for 10,000 requests
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
- Compare `EXPLAIN ANALYZE` and profiles for this SQL on `7fa4a36aa` and `dd040ad6`.
- Run a focused 100-query workload at 1/10/100 concurrent clients to locate the scaling breakpoint.
- Add a per-query timeout in the benchmark so future failures preserve SQL-level evidence instead of consuming the job-level timeout.
Related
- Historical resolved issue: [Bug] IVF l2_only pre-filter recall hangs with severe CN read amplification on 10M wiki dataset #24962
- Suspected regression PR: refactor: replace IVF search TVF with vector index scan #27297
Activity
Ariznawlll commentedon Aug 22, 2026
补充定位结果:
已将回归范围收敛到 commit
5735684d69c9b171c4d7a5ebee3ebcc539ffc8cc(refactor: replace IVF search TVF with vector index scan #27297)。对比证据:
7fa4a36aa,该 commit 尚未包含5735684d;相同vector_benchmarkcommit 和相同 10M Wiki /nprobe=5/ 100 并发配置下,首个l2_only + mode=precase 为约 20.25 QPS,10,000 queries 在约 494 秒完成。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。初步代码级原因:
ivf_searchTVF 改为VECTOR_INDEX_SCAN。PostFilterTopOnly: true。reader.SetIndexParam,即不再走存储侧的向量 Top-K 下推;读取候选 entries 后才在 CN 内计算距离并本地压缩 Top-K。l2_onlySQL 没有 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 时的正确性保护。Ariznawlll commentedon Aug 25, 2026
在最新 main 对应的 TKE 回归环境复测:本次部署 MatrixOne commit
b89a639b0,已包含修复 PR #27494。针对本 issue 的原始场景(10M Wiki、IVFFlat、无
WHERE、l2_only、mode=pre、10000 queries / concurrency=100)已恢复并可完整结束:对比本 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
fix: bound IVFFlat pre-filter search (#27570)
Ariznawlll commentedon Aug 26, 2026
测试版本
mainb89a639b0c4ac30ae143cae3b67925678d347d3b原问题验证
按 Issue 原始条件执行:无
WHERE、l2_only、mode=pre、10,000 queries、concurrency=100。原问题约 0.48 QPS、运行 1 小时仅完成约 1,720/10,000 并最终超时;本次原始无过滤路径未再出现该性能回归。
Happy Path 覆盖
l2_only+mode=pre,两轮均完整完成。Unhappy Path 覆盖
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
测试结论
测试通过。
fix: bound IVFFlat pre-filter search (matrixorigin#27570)
fix: bound IVFFlat pre-filter search (matrixorigin#27570)
fix: bound IVFFlat pre-filter search (matrixorigin#27570)