Repository navigation
Description
Existing issue check
- I checked existing MatrixOne issues, including [Bug]: ISCP sync iteration is an unbounded work unit: no per-iteration events/bytes/time cap, whole-interval atomic watermark, full-interval replay #26973. That issue describes the generic risk of unbounded ISCP iterations. This report records a concrete 10M IVFFLAT index-build failure whose root cause is not yet confirmed to be identical.
Branch and commit
- Branch:
main - MatrixOne commit:
bc523def3b55de2b305c14ee9fafb61dfec24126 - Regression workflow revision:
e6b23fca19cd1802979131467bd54ca14015d898
Environment
- TKE distributed deployment:
1 TP CN + 2 AP CN - Test workload is sent through the TP CN.
- Dataset:
10,000,000Wiki rows,VECF32(768)embeddings. - Index:
IVFFLAT, L2 (vector_l2_ops),lists=3162,quantization=float32,kmeans_train_percent=2,kmeans_max_iteration=20. - Regression job: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/35518551829/job/106119773347
Actual behavior
CREATE INDEX does not finish after the data load has completed. The KMeans phase completes, but the following mapping/entries-write phase does not reach completion and emits iscp transaction finish timeout repeatedly for more than two hours. The test wrapper later cancels the still-running SQL at its three-hour deadline.
Observed sequence (UTC):
18:16:58: S3 load completes withaffected_rows=10000000.18:16:59:CREATE INDEX idx_l2 ... USING ivfflatstarts.18:17:08to18:31:00: KMeans runs and completes.18:31:01: centroids are inserted and the index status reachesmapping_start.- From
18:31:07onward: TP CN logsinternal error: iscp transaction finish timeoutapproximately every 10 seconds. There is no matchingmapping_endevent before cancellation. 20:41:44: the outer test command reaches its three-hour limit and exits with code124.20:41:48: the server recordscontext canceledfor the internal mappingINSERT ... SELECT. This cancellation is a consequence of the wrapper deadline, not the first failure.
No pod restart, panic, or OOM was observed in the incident window. TP-CN profiling continued to show CPU activity; Go heap was about 2.1 GiB and MO mpool about 18.2 GiB near the deadline. Therefore the available evidence is a stalled/failing ISCP completion path during IVF mapping, not an OOM termination or a test-result assertion failure.
Expected behavior
For the stated 10M dataset and IVF parameters, CREATE INDEX should finish successfully and emit the mapping-completion status. It must not remain in the mapping phase while repeatedly timing out ISCP transaction completion until an external test deadline cancels it.
Steps to reproduce
- Deploy the stated distributed topology on
main. - Load 10,000,000 Wiki
VECF32(768)rows into a table. - Execute:
CREATE INDEX idx_l2
USING ivfflat ON historical_file_blocks_wiki_ivfflat10m(embedding)
lists=3162 op_type 'vector_l2_ops' quantization 'float32'
kmeans_train_percent 2 kmeans_max_iteration 20;- Observe index-build status and TP CN logs through completion or timeout.
Validation status and impact
- Reproduced in the linked weekly TKE regression run:
1/1observed so far. Repeated controlled validation is still needed to establish frequency. - The failure blocks the weekly 10M IVF preparation and all dependent vector recall/performance stages.
- This report does not claim that [Bug]: ISCP sync iteration is an unbounded work unit: no per-iteration events/bytes/time cap, whole-interval atomic watermark, full-interval replay #26973 is the confirmed root cause. The repeated ISCP transaction-finish timeout and the absence of
mapping_endmake the ISCP mapping path the primary triage target.
Suggested diagnostics
- Correlate the first ISCP finish timeout with the lifecycle and transaction state of the IVF mapping writer.
- Preserve per-iteration change volume, transaction duration, retries, and mapping progress, so a blocked build can be distinguished from slow but progressing work.
- After a product fix, rerun this exact 10M build and require successful mapping completion without any
iscp transaction finish timeout.
Related
- [Bug]: ISCP sync iteration is an unbounded work unit: no per-iteration events/bytes/time cap, whole-interval atomic watermark, full-interval replay #26973 — generic ISCP unbounded-iteration risk; related but not asserted as the same root cause.
Activity
LeftHandCold commentedon Sep 21, 2026
补充同一现场的 CPU profile、前一轮对照和代码定位:本次已确认的主要瓶颈是 IVF mapping/质心分配的距离计算,证据高度指向 #29143 引入的普通 float32 建索引性能退化。不能仅凭重复的
iscp transaction finish timeout就认定 ISCP completion 是根因。1. 同一问题,不是新增的 Wiki 校验失败
bc523def3b55de2b305c14ee9fafb61dfec24126e6b23fca19cd1802979131467bd54ca14015d898mo-main-family-35518551829-1nightly-regression-dis-tp-cn-t2g8l1000 万行 LOAD DATA 已成功。
CREATE INDEX未完成后,外层 10800 秒准备预算终止客户端,返回124;之后服务端的context canceled是取消结果。后续 IVF 查询 Job 因 prepare 失败被拦截,六模式实际是not_run,不是查询正确性检查失败。近期 Runner 修改也不在这个失败路径:
mo-nightly-regression#1710的审计在查询后执行,#1714的固定入口改动作用于 recall 而不是 prepare;新#1718尚未合并,未进入这轮运行。2. 前一轮相同准备任务正常,本轮慢在建索引,不是装载
对照:前一轮成功的 prepare,MO
be1591fb50dd653ce58560997e115e5050053980,Namespacemo-main-family-35450514491-2。两轮 vector_benchmark 均为
0bae04528673d7756c4ee2478ac8e4e41f54df1b;数据、CREATE INDEX SQL、workload=tp和上述内存配置一致。因此本轮建索引在取消前,耗时已超过前一轮的 6.4 倍。这是未完成耗时的下界,不是完整执行时间比值。
本轮 KMeans 在 UTC
18:31:00已完成,centroids 在18:31:01已写入;之后持续执行 entries 的INSERT ... SELECT ... CENTROIDX JOIN,直到 UTC20:41:48–49被取消。3. 直接 CPU 证据:持续执行距离计算,不是空等
Grafana 环境
tke,Pyroscope datasourcepyroscope:调用链:
关键占比:
StableL2DistanceSq:累计 96.60%,自身 51.62%。stableDifferenceScale:累计 44.84%,自身 21.30%。math.IsInf自身 13.00%;math.IsNaN自身 7.63%。AP SSB/TPCH 在 UTC
19:08:47已结束。Prometheus 在19:15–20:40的 60 秒采样、2 分钟 CPU rate 显示:TP 平均 13.99 核,两个 AP 分别约 0.175 / 0.172 核,TN 约 0.98 核。此时 ANLI 和 TP 后续重负载尚未开始。因此不能把后半段持续变慢归因为 IVF/ANLI 并发。最终资源门禁也显示 9 个 Pod 均无重启、未报告 OOM。4. 与 #29143 的直接代码联系
#29143 于
2026-09-20 12:56 UTC合入,commit39cc357e3895389915b98e45caeba40024c125f1,已包含在失败版本中:NewCpuBruteForceIndex将 float32 数据的实例从<float32,float32>改成<float32,float64>。ResolveDistanceFn将这类宽结果 L2 分派到StableL2DistanceSq[float32]。StableL2DistanceSq每次距离计算先扫描 scale/NaN/Inf,再逐维执行 float64 缩放除法和累加;这与现场热点逐项吻合。镜像虽然使用GOEXPERIMENT=simd构建,该稳定算法仍绕过原有 typed L2 的 SIMD 选择路径。**归因边界:**当前是实际运行热点 + 精确代码变更 + 前轮对照,尚未做 #29143 父子 SHA 的同环境受控复跑;不能把整轮所有其他失败都归给这个 PR。
5. 修正 ISCP 判断及建议
在 UTC
18:16:07等时间点,CREATE INDEX 开始前就已有iscp transaction finish timeout。这些日志需要另行关联事务/任务身份,不能仅凭出现时间就视为本次 mapping 停滞的起因,也不宜把“环境里完全不再出现这条日志”当作本问题唯一验收条件。建议优先检查 #29143 普通有限 float32 输入的距离热路径,保留极端值正确性,同时恢复常见输入的高效实现;不要只提高 Runner 超时或直接撤销数值正确性修复。验收至少比较建索引完成耗时、距离计算 CPU 开销及极值正确性,并确认后续六模式能够实际执行。
本次仅补充证据,没有修改 Runner、MO 内核或集群,也没有重新启动长任务。
Lundomn commentedon Sep 21, 2026
Root cause confirmed: this is a post-merge performance regression from #29143, not a new ISCP correctness failure. The widened float32 result type preserved #29083's extreme-value correctness, but routing normal float32 L2 distances through StableL2DistanceSq added a per-call scale/NaN/Inf scan. The #29183 CPU profile shows that scan dominating IVFFLAT centroid assignment.
A complete fix is submitted in #29194:
#29194
The PR keeps float64 accumulation and ordering, adds a single-pass finite float32 -> float64 L2 kernel, and falls back to the stable implementation for non-finite inputs. It includes range/precision/NaN/Inf tests plus real Search/SearchFloat32 consumer coverage. Local metric and brute-force suites, vet, and benchmarks pass; the target 10M-row TKE run remains part of CI/QA validation.
fix(vectorindex): standardize vector distances on the float32 domain (#…
Ariznawlll commentedon Sep 26, 2026
测试版本
main7ce783464806490263c184f22aaf5d307225adef3b34a2ee533445fefe8e9b887c06bd6bd0260f33(#29100)验证 commit 已包含修复提交:相对
3b34a2ee533445fefe8e9b887c06bd6bd0260f33为ahead 32 / behind 0。当前main也已包含该修复。原问题验证
使用与本 issue 一致的数据规模、向量维度和建索引参数复测:
10,000,000行VECF32(768)lists=3162、quantization=float32、kmeans_train_percent=2、kmeans_max_iteration=20LOAD DATA成功,affected_rows=10000000CREATE INDEX成功,耗时1260.86 s,约21分01秒iscp transaction finish timeout功能验证
PASS,准备阶段整体成功退出。异常与边界验证
144分45秒仍未完成,最终被外层截止时间取消;修复版本在21分01秒内完成。CREATE INDEXmapping 卡死复现。白盒验证
根因对应普通 float32 L2 距离计算被路由到高开销稳定实现,导致 IVFFLAT 质心分配阶段 CPU 热点和严重性能退化。合入的 #29100 已移除该高开销路径并恢复常规输入的快速距离计算;上述目标规模复测确认修复后的实际建索引路径能够完成。
回归测试
22分33秒bc523def3b55de2b305c14ee9fafb61dfec24126>144分45秒7ce783464806490263c184f22aaf5d307225adef21分01秒修复后耗时已恢复到退化前基线范围,原问题未复现。
测试证据
3b34a2ee533445fefe8e9b887c06bd6bd0260f33测试结论
测试通过。