Skip to content

[Bug]: IVF Wiki 10M has sustained object-column read/decompression amplification under bounded cache #28627

Closed

Description

@LeftHandCold
  • I have checked the existing issues.

Branch Name

main、4.2-dev

Commit ID

本问题在以下三个部署版本中观察到:

  • Main 三 CN 基线:39225f5fbc63b44a190cdd43f954ee07d78e6cdc
  • 4.2-dev Family:4199b11c5c7bb24eccdb379cd6f68abcbd89e450
  • Main Family:f0c31cd4b830be32442cf329e0a3fb08aa9c16c3

当前证据可以确认实际运行瓶颈及热点代码路径,但还不能定位到单个引入 PR。三次运行不是只替换 image 的受控 A/B,因此暂不能把本问题定性为某个版本或 PR 的回归。

Other Environment Information

  • 负载:Wiki 10M IVF-FLAT benchmark
  • 数据:10,000,000 条、768 维、float32 向量
  • 查询:每轮 10,000 条,100 并发,k=10、probe_limit=5、ivf_preload_entries=0
  • 索引参数:lists=3162、vector_l2_ops、kmeans_train_percent=2、kmeans_max_iteration=20
  • benchmark commit:0bae04528673d7756c4ee2478ac8e4e41f54df1b
  • Main 基线拓扑:3 个通用 CN,每个 CN 为 14 CPU / 55Gi memory / 12Gi Memory Cache / GOMEMLIMIT=25000MiB
  • Family 拓扑:1 个 TP CN + 2 个 AP CN,每个 CN 为 14 CPU / 48Gi memory / 12Gi Memory Cache / GOMEMLIMIT=25000MiB;向量压测使用 workload=ap
  • 几次运行中 IVF entries 隐藏表约为:10M 行、212-213 个 object、1272-1274 个 block、原始大小约 29.29GiB、压缩大小约 28.96GiB。

Actual Behavior

总结

当 Wiki 10M IVF 查询由两个、各配置 12Gi Memory Cache 的 AP CN 提供服务时,性能出现明显断崖。差距不能只用“两个 CN 比三个 CN 少三分之一算力”解释:

  • Main 三 CN 基线:两轮 l2_only/pre 共 23.88 分钟。
  • 4.2-dev 两 AP:相同两轮共 55.41 分钟。
  • Main 两 AP:相同两轮共 138.26 分钟。

Prometheus 和 Pyroscope 共同表明:额外墙钟时间对应 ObjectIO/FileService 列读取路径中显著增加的 CPU 工作。Memory Cache 未命中后,IVF entries 的压缩列从 DiskCache 读取,随后重新构造缓存列数据并进行 LZ4 解压,两个 AP CN 长时间接近 CPU 上限。采样中向量距离计算和 Go GC 占比都很低。

因此可以确认这是持续的“列读取/解压放大”性能问题。尚未证明 Memory Cache 容量是唯一上游原因,也尚未定位引入该行为的具体 PR。

三次运行总览

Run / 部署 实际参与 IVF 的 CN 第一轮 第二轮 两轮合计
Main Run 34136649854 / Job 101873583884,39225f5f 3 782.61s,12.78 QPS 650.45s,15.37 QPS 1433.06s / 23.88min
4.2-dev Run 34367823695 / Job 102598577698,4199b11c 2 AP 2459.40s,4.07 QPS 865.23s,11.56 QPS 3324.63s / 55.41min
Main Run 34307530968 / Job 102404950664,f0c31cd4 2 AP 4725.83s,2.12 QPS 3569.67s,2.80 QPS 8295.50s / 138.26min

三次运行使用相同 benchmark commit 和查询/索引参数。但 MO SHA、拓扑、前序负载、索引物理布局和 recall 并非全部相同,因此上表可以证明实际现象,不能直接作为版本回归 A/B。

Case 1:Main 三 CN 基线

Job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34136649854/job/101873583884

  • IVF setup 约在 2026-09-07 22:49:20 UTC 结束。
  • 第一轮:22:49:22-23:02:24 UTC,782.61s,12.78 QPS,avg 7.677s,p50 0.07284s,p95 41.804s,max 553.081s,recall 75.61%。
  • 第二轮:23:02:25-23:13:15 UTC,650.45s,15.37 QPS,avg 6.423s,p50 1.346s,p95 29.855s,max 147.743s,recall 75.61%。
  • 第一轮三个 CN 合计约消耗 21,918 CPU-seconds,平均实际使用约 28.0 核。
  • Memory Cache entry 命中率约 97.14%,约 742,827 个 entry 下沉到 DiskCache。
  • 这组基线更快,但不是所有请求都稳定低延迟:第一轮前 8,114 条查询约 114 秒完成,剩余请求形成明显长尾。

Case 2:4.2-dev Family,1 TP + 2 AP

Job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34367823695/job/102598577698

  • IVF setup 约在 2026-09-09 19:32:11 UTC 结束。
  • 第一轮:19:32:13-20:13:12 UTC,2459.40s,4.07 QPS,avg 24.565s,p50 20.357s,p95 49.646s,max 221.07s,recall 36.82%。
  • 第二轮:20:13:13-20:27:38 UTC,865.23s,11.56 QPS,avg 8.631s,p50 7.752s,p95 18.052s,max 36.381s,recall 34.97%。
  • 第一轮两个 AP 合计约消耗 65,946 CPU-seconds,平均实际使用约 26.82 核;两个 AP 分别平均使用约 13.48 和 13.34 核。
  • Memory Cache entry 命中率约 85.63%,约 233 万个 entry 下沉到 DiskCache;DiskCache entry 命中率约 99.43%。
  • IVF entries 表提交时记录 10M 行、212 objects、1272 blocks、原始大小 29.29GiB、压缩大小 28.97GiB。
  • 索引物理布局在测试期间仍在变化:第一轮记录到 74 条 MERGE-START 和 72 条 MERGE-END;其中一次 Merge 报告 pointDepth 173 >= 3,说明初建索引存在较高 object range 重叠。
  • 两个 AP 后续在 post 阶段分别于 20:30:52、20:31:08 UTC 被 OOMKilled;两轮 pre 已在 20:27:38 结束。因此 OOM 不可能倒推造成已经结束的 55 分钟 pre,OOM 的内存责任栈应另行分析。

Case 3:Main Family,1 TP + 2 AP

Job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/34307530968/job/102404950664

  • IVF setup:2026-09-09 09:06:12-10:05:28 UTC。
  • 第一轮:10:05:29-11:24:15 UTC,4725.83s,2.12 QPS,avg 47.131s,p50 45.881s,p95 53.182s,max 330.745s,recall 75.53%。
  • 第二轮:11:24:17-12:23:46 UTC,3569.67s,2.80 QPS,p50 35.343s,p95 45.473s,recall 75.53%。
  • 后续两轮 post 分别约为 1136.96s / 8.80 QPS、866.43s / 11.54 QPS,合计仍约 33.39 分钟。pre 和 post 是不同执行模式,不能把它们当成纯粹的冷/热缓存 A/B。
  • 本次运行 CN/TN/Log restart 均为 0,没有 OOM 证据。

本次运行同期存在其他 Job,但时间线不能解释掉 IVF 自身瓶颈:

任务 UTC 时间
SSB + TPCH Family 05:41:05-09:05:38
IVF setup 09:06:12-10:05:28
MOTR 09:44:54-10:33:34
ANLI 09:51:13-11:50:44
IVF pre 第一轮 10:05:29-11:24:15
IVF pre 第二轮 11:24:17-12:23:46
  • TPCH 在 IVF setup 开始前已经结束。
  • MOTR 只与前段重叠;ANLI 与第一轮和第二轮前约 26 分钟重叠。
  • ANLI 结束后,第二轮剩余约 6,077 条查询仍耗时约 2,000 秒,约 3.04 QPS。
  • 12:00 UTC,已观测到的其他负载结束后,两个 AP 仍分别使用约 13.92 和 10.58 核,TP CN 仅使用约 0.72 核;该分钟 AP 的 ranges 日志均指向 IVF entries 表。
  • 第一轮两个 AP 合计约消耗 126,664 CPU-seconds,是 Main 三 CN 基线的约 5.78 倍;两边平均实际总用核却接近(26.8 对 28.0)。
  • Memory Cache entry 命中率约 85.49%,约 403 万个 entry 下沉到 DiskCache,是 Main 基线的约 5.42 倍;DiskCache entry 命中率为 99.66%。
  • 第二轮仍记录约 326 万次 DiskCache entry 读取,Memory Cache entry 命中率约 85.02%。第一轮结束后,活跃 decoded-column working set 仍未完整驻留内存。

运行时热点与代码路径

在并发 Job 结束后采集的五分钟 CPU profile 中,两个 AP 的热点几乎一致:

Symbol AP 1 AP 2
relationScanner.ScanRelation cumulative 94.99% 95.26%
LoadColumnDataByTopN cumulative 94.07% 94.18%
DiskCache.Read cumulative 89.81% 90.77%
compress.Decompress cumulative 57.46% 55.57%
runtime.memmove flat 57.01% 55.10%
L2DistanceSqFloat32 cumulative 0.13% 0.18%

4.2-dev 第一轮 profile 也呈现相同形态:LoadColumnDataByTopN cumulative 约 94%,解压/memmove 约 58%,向量距离计算仅约 0.1%;Go GC 在这些样本中同样可以忽略。

实际观测到的执行路径为:

IVF planReader
  relationScanner.ScanRelation
    BuildReaders / reader.Read
      BlockDataReadInner
        LoadColumnDataByTopN / ReadColumnTopN
          ObjectIO column read
            S3FS.Read -> Memory Cache miss -> DiskCache.Read
              IOEntry.ReadFromOSFile
                IOEntry.setCachedData
                  columnCacheConstructorFactory / constructorFactory
                    compress.Decompress -> LZ4 decode -> runtime.memmove

受影响 Main SHA 中的对应代码:

因此 DiskCache 命中不等于已命中解压后的列数据:仍可能需要读取压缩字节、构造列表示并解压。SQL 最终只返回 k=10,并不保证存储层只读取或解压 10 行数据。

证据分级

已经确认:

  • 24、55、138 分钟分别是两轮真实查询时间,不包含索引 setup,也不是 stdout 时间戳误判。
  • 慢运行实际走 IVF entries 隐藏表,AP CN 长时间 CPU-bound。
  • 主要采样开销位于 ObjectIO/FileService 列读取、缓存数据构造和 LZ4 解压,而不是向量距离计算或 Go GC。
  • Main Family 慢运行在已观测并发任务结束后仍持续低 QPS。
  • DiskCache 大部分命中,但 Memory Cache miss 与 decoded-column 重建仍然很高。
  • 4.2 的 AP OOM 发生在 pre 结束后,不能解释此前的慢查询。

高可信推断,但尚未闭环为唯一根因:

  • 约 29.29GiB 的 entries 表跨越两个彼此独立的 12Gi Memory Cache,相比三个独立的 12Gi Cache,可能跨过缓存容量/分布阈值。85% 对 97% 的 entry 命中率以及 5.4 倍 DiskCache entry 数量支持这一解释。
  • Cache 并不是一个统一共享的 24Gi/36Gi 池;object 分布、重复读取、其他数据占用、cache admission 和持续 Merge 重写都会降低有效驻留率。

尚未证明:

  • 每条查询都会读取或解压整个 29GiB entries 表。
  • MOTR/ANLI 并发是主要原因。
  • S3 网络等待是主要原因;profile 是 CPU-heavy,DiskCache 命中率也很高。
  • 单纯增大 Memory Cache 可以安全解决;当前环境同时存在 OOM 风险。
  • 某个具体 MatrixOne PR 引入该问题;尚未完成同布局、同拓扑、只替换 image 的 A/B。
  • 几次运行之间 recall 差异就是 correctness bug。recall 差异首先意味着当前跨运行性能比较不完全等价,需要单独验证。

Expected Behavior

当 decoded data 超过 Memory Cache 后,IVF-FLAT 查询性能应可预测、平滑地下降,而不是因为持续重建/解压 object column 耗尽大部分 CN CPU,并相对可比运行下降 3-6 倍。对于能够安全复用的 DiskCache 数据,应在对象格式、ownership 和内存记账允许的前提下避免不必要的重复解码。

本 Issue 不要求两个 AP CN 达到三个 CN 的性能,也不报告 wrong result 或数据损坏。后续修复/优化必须受 CN 内存预算约束,不能用 OOM 换取 QPS。

Steps to Reproduce

当前是生产化回归环境中的多次观测,还不是最小确定性 UT:

  1. 部署 1 个 TP CN + 2 个 AP CN;每个 CN 配置 14 CPU、48Gi memory limit、12Gi Memory Cache、GOMEMLIMIT=25000MiB。
  2. 通过 workload=ap 将向量压测租户路由到 AP CN。
  3. 加载 Wiki 10M、768 维、float32 数据。
  4. 创建 IVF-FLAT 索引:lists=3162、vector_l2_ops、kmeans_train_percent=2、kmeans_max_iteration=20。
  5. 使用 100 并发执行 10,000 条 l2_only 查询,参数为 k=10、probe_limit=5、ivf_preload_entries=0,连续执行两轮 pre。
  6. 保存每轮 QPS/latency、每个 CN 的 CPU、Memory Cache entry hit/miss、DiskCache read、FileService 分阶段计数和 CPU profile。
  7. 使用同一个 image、同一批物理索引 object 和同一组查询向量,对照两个与三个实际参与 IVF 的 CN;然后固定拓扑/布局,仅替换 image 做第二组 A/B。

上述三个公开 Job 均可作为现象复现记录。

Additional information

在归因具体 PR 前建议完成的验证

  1. 固定相同的物理索引 object 和查询向量顺序。
  2. 测量时冻结 Merge,或单独统计 Merge 影响,避免把物理布局正在变化的两轮当成纯缓存 A/B。
  3. 在同一 image 上比较两个与三个有效 IVF CN,并记录每个 CN 的 decoded bytes/cache occupancy,而不只记录 entry 次数。
  4. 固定拓扑和物理布局后,再比较候选 MatrixOne SHA。
  5. 确认 benchmark 执行的是真实 literal-vector SQL;使用子查询向量的诊断 EXPLAIN 会形成不同计划,不能据此声称每条压测 SQL 都 full scan 29GiB。
  6. 将建索引后的首轮 warm-up 与稳定态查询分别报告,并始终同时保留 recall 和 QPS,避免把候选工作量明显不同的运行视为等价。

Duplicate search

已搜索近期 open/closed Issue:34307530968、IVF Wiki 10M、IVF slow、cache performance,未发现同时覆盖这三次运行现象和该热点路径的重复 Issue。

已有 Issue 可能覆盖单点向量或内存优化;本 Issue 专门记录在有界 Memory Cache 下持续的 ObjectIO/FileService 列读取/解压放大及其对 CN 拓扑高度敏感的性能断崖。

Activity

  1. added
    severity/s0
    and removed on Sep 10, 2026
  2. LeftHandCold commented on Sep 11, 2026

    @LeftHandCold
    CollaboratorAuthor

    tn的内存也可能是瓶颈,可能会因为停止merge导致读的数据过多从而性能下降

  3. LeftHandCold commented on Sep 14, 2026

    @LeftHandCold
    CollaboratorAuthor

    Additional evidence: Main Daily Run 34764591964

    This is an update to the existing issue, not a duplicate report. I re-checked the older Main Daily job requested for comparison:

    What the reported 22 minutes contains

    The reported ~22 minutes is not one query and not an overlap of all vector modes. The workflow runs the six IVF modes serially. For l2_only/pre:

    • Round 1 process: 22:25:44-22:37:03 UTC, 678.12s, QPS 14.45
    • Round 2 process: 22:37:04-22:48:30 UTC, 685.69s, QPS 14.58
    • The two rounds together take about 22m46s.

    Thus this older job does not show the newer pattern of a fast first round followed by a much slower second round. Both rounds are already on the slow path at approximately the same throughput.

    FileService evidence

    Prometheus range data for the two windows, aggregated across the three CNs, shows that the older job did have substantial concurrent local DiskCache reads:

    Window mo_fs_read_total{type=read-disk} read-disk-cache duration sum S3 reads S3 read duration sum
    Round 1 ~706,967 ~61,100s ~15,982 ~14,013s
    Round 2 ~938,844 ~70,967s ~1,443 ~1,243s

    read_write_duration_sum is an aggregate over concurrent operations, so its value is not wall-clock time. It is useful here as a contention/work amount signal. The DiskCache eviction counter did not increase in either window; there is no evidence that cache eviction or cache capacity exhaustion caused the 22-minute result.

    The first window contains mixed S3/cache-fill activity, while the second is overwhelmingly local-cache read activity. The fact that the second round is not faster in wall clock does not mean DiskCache was unused; it means the workload remained dominated by a large number of independent local reads and subsequent column materialization/decompression.

    Interpretation

    This comparison supports the issue's performance diagnosis:

    1. The old Daily did exercise high-concurrency DiskCache reads. It is incorrect to use it as evidence that this workload had no local-disk pressure.
    2. The vector modes themselves were serial, so there was no overlap between l2_only/pre and the other IVF modes inside this job.
    3. However, this was a single homogeneous three-CN pool with no TP/AP isolation. It is not a controlled DiskCache A/B: the three CNs had independent memory caches, the test followed the earlier Daily workload, and the physical IVF object layout/cache state was not frozen.
    4. It is therefore not valid to compare its 14.45/14.58 QPS directly with the later two-AP runs as a pure code or storage comparison. The later two-AP runs crossed a different effective-cache/topology threshold, but the older job confirms that the underlying high-concurrency local-read path already exists in the standard Daily.

    The evidence currently proves a real performance defect/limitation in the FileService/ObjectIO path under this workload. It does not prove DiskCache data corruption, eviction failure, PVC failure, or a specific introducing PR. The next controlled experiment should keep the same image, physical IVF objects, CN count, cache sizes, and routing, then compare S3-only/cold, DiskCache-warm, and repeated DiskCache-warm runs while recording per-CN read-disk, read-disk-cache, S3, CPU, and decoded-column allocation metrics.

  4. LeftHandCold commented on Oct 5, 2026

    @LeftHandCold
    CollaboratorAuthor

    Main Daily follow-up: physical Merge rewrites are visible during measured second rounds

    This updates the existing read/decompression-amplification issue; it is not a new introducing-PR claim.

    • Previous Wiki job: MO c1c8ea97477dd12a79cb1991d283905ca9ebf3a5.
    • Current Wiki job: MO 21f711a7b852238394417e547282e14dce8660d9.
    • Both use 1 TP + 2 AP, 14 CPU / 55Gi per CN, 16Gi Memory Cache, 100 query workers, 10,000 queries per round and probe=5. The current measured rounds completed without query/connection errors; related recall values are close.
    Second-round QPS Previous Current
    only/pre 328.19 191.82
    only/post 313.14 157.66
    filter/pre 76.38 81.27
    filter/post 323.59 208.59
    threshold/pre 85.47 88.82
    threshold/post 347.07 333.35

    Newly established object-level timeline

    All times below are Oct 4 UTC, not Beijing time. Current namespace is mo-main-family-37215929355-1.

    The IVF entries read path accesses hidden table 273175, __mo_index_secondary_01a10856-6998-7a72-b656-0dd46c5ffbea. Its TN Merge records and AP FileService slow-event records can be joined by object ID:

    Measured window TN Merge completion New objects Subsequent AP evidence
    only/pre second round, about 20:08:03-20:08:56 20:08:17.619647 01a10887-9f18-78a4-ac3f-9c0573b5abf0_00000/00001, 296MiB total 20:08:18.534 onward: reads of these exact objects miss memory and wait for disk-cache fill; leader falls through to object storage
    only/post second round, about 20:09:52-20:10:55 20:10:31.018874 objects ending 0d8f9039c2c5_0/1, 296MiB total 20:10:32.304 onward: reads of these exact new objects
    filter/post second round, about 20:17:16-20:18:05 20:17:56.222238 20 objects ending 8d18fb12fa28_0..19, 2.891GiB total 20:17:57.462 onward: reads of the newly merged object generation

    One only/pre read requested a 25,305,920-byte entry. Its trace contains about 201ms waiting for disk-cache update completion, then IOMerger waiting, an object-storage read, and cache-data construction; it returns after about 671ms. Followers subsequently hit the filled memory cache. This is not evidence that every follower independently downloaded the whole object or that #28918 stopped working.

    The table was not physically quiescent after CREATE INDEX: at 20:03:55, TN reported 198 L1 + 6 L2 objects and started a 12-object merge, with pointDepth 198 >= 3; merges continued throughout the six modes. Sixteen Merge completions for this table were observed from 19:58 to 20:23. Equal object counts in two EXPLAIN outputs do not imply equal physical objects or stable ranges.

    The previous fast night also had merges. In particular, there was no observed entries Merge completion inside its only/pre second round, but there were completions during other modes. Therefore the mere existence of Merge is not sufficient to explain the entire inter-night QPS difference. What is established here is an actual new-object -> cache-miss/refill chain inside all three affected second-round windows.

    CPU and cache evidence

    • Current only/pre: on AP 4sn27, a profile over 20:08:05-20:08:55 attributes about 39.46% cumulative CPU to DiskCache.Read and 17.81% to runtime.memmove. AP zmmqf has no sampled DiskCache.Read frame in the same window.
    • Previous only/pre: the busier-cache AP's profile over 20:03:37-20:04:08 shows 12.38% cumulative DiskCache.Read; the other AP again has no sampled frame.
    • Current filter/post AP 4sn27: about 23.99% DiskCache.Read, 13.35% decompression, 14.08% memmove over 20:17:20-20:18:00. These are nested percentages, not additive.
    • Both AP memory caches are near their 16Gi capacities. The RSS-pressure trigger/eviction/admission-skip counters remain zero in the inspected windows. This rules out the specific RSS-pressure eviction mechanism, not ordinary capacity eviction.
    • The Pyroscope windows use 10-second buckets and may overlap neighboring work at their boundaries. They identify sampled CPU hotspots, not exact per-request wall-time attribution.
    • The later diagnostic query 0 for only modes selects 263 versus 323 blocks and reports about 2.60GB versus 3.10GB logical decoded bytes. This does not support a blanket claim that the current only query necessarily reads more blocks than the previous one. These late diagnostics are not the formal-round cache state or a physical-I/O measurement.

    Conclusion and remaining boundary

    The decline is real, but this comparison is not a frozen-layout, frozen-cache code A/B. Ongoing physical rewrites force valid cache misses, while decoded-column residency and cache work are asymmetric across APs. This is consistent with the existing issue's bounded-cache/layout sensitivity.

    No new vector-algorithm correctness bug, FIFO correctness failure, or specific introducing PR is established. FileService, vectorindex, readutil and blockio sources did not change between the two measured main SHAs; other indirect effects are not excluded. Do not reattribute the whole decline to #29531/#29578.

    The next useful acceptance test should preserve the same physical objects, record a bounded Merge-settling check and per-CN cache/decoded-byte counters, and compare the two images with identical bindings/routing. Merely labeling the second round as warm, or adding a fixed sleep without checking object changes, is insufficient.

  5. slyunnn commented on Oct 10, 2026

    @slyunnn

    BF16 小样本诊断补充:读取放大与原表过滤开销(2026-10-09)

    关联本 Issue 的读取放大方向;尚未证明本轮 BF16 与历史运行完全同因,也不把本次诊断当作完整性能验收。

    运行身份

    • MatrixOne main@908166384d32e378a72cc3b5ef9e7075603c4e81。
    • 测试脚本 2032c464d62f02c454f1f50c5152dbb2bf8c3ec9。
    • Run / 原始 Job,原始 artifact。
    • 3 CN + 1 TN,Wiki 10M × 768 维,源向量 F32、IVFFLAT BF16,lists=3162、K=10、probe_limit=5、ivf_preload_entries=0。
    • 取源表 id=1,2,3,分别执行普通 file_id pre、附加 L2≤2.5 的 pre/post;同一样本在三个变体中使用同一向量和 file_id。单并发,各一次 EXPLAIN ANALYZE。

    实际执行结果

    样本 普通 pre 阈值 pre 阈值 post
    id=1 60.259s,限时取消 60.362s,限时取消 48.914s,完成
    id=2 41.653s,完成 31.258s,完成 14.969s,完成
    id=3 5.011s,完成 20.975s,完成 11.516s,完成

    9 条静态 EXPLAIN 全部完成;实际执行 7 条完成、2 条取消、0 条阻塞。60 秒是诊断保护上限,不是约定的产品 SLA。两次 KILL QUERY 均 acknowledged,原连接恢复并继续后续样本,最终整体标记失败。1105 context canceled 是主动取消后的返回,不能据此认定自发崩溃或 #27757 复发。

    证据 A:普通 pre 的 entries 读取粒度

    id=2/filter-pre/analyze:

    readers=3
    entry_blocks_read=314
    storage_filter_rows=2572288:309
    vector_rows_scored=309
    vector_chunks=175 vector_chunk_cache_hits=145
    vector_compressed_bytes=1213963174
    vector_decoded_bytes=1224127730
    entry_time_ns=42448957768
    

    309 行距离计分涉及约 1.22 GB 解码列范围计数。byte counters 不是块设备物理流量,不证明全部范围被重新解压;entry_time 是多个 reader 的累计值,不是独立墙钟时间。该证据支持继续调查读取粒度/缓存工作放大。

    证据 B:BF16 距离阈值 pre 的源表过滤

    id=2/threshold-pre/analyze 出现两处 [ForceOneCN] 原表扫描:各 inputBlocks=1225、inputRows=200000、outputRows=1679。两处 ReadSize 分别为:

    28.85 GiB | 0 bytes    | 26.28 GiB
    28.85 GiB | 145.13 MiB | 26.15 GiB
    

    精确被测源码 定义该顺序为 total|s3|disk。这是 FileService/算子统计,不能无条件相加为物理磁盘读取量,也不足以证明整表物理读取两遍。

    同一查询 entries 阶段累计约 0.482s,104 个 vector chunk 均记录 cache hit,但总墙钟 31.258s。原表扫描/距离过滤及相关等待值得单独定位,不能把全部时间归入 ANN entries 计分。

    BF16 有损量化的正确性约束 要求距离条件保留在原向量上;不能为提速直接以量化分数替换精确谓词。希望确认两处过滤工作是否可安全共享或减少。

    边界与建议

    • 本次 main 已包含 fix(vector): restore safe distributed filtered PRE scans #29538(修复 [Bug]: Main IVF filtered PRE is 4-7x slower than 4.2 at comparable recall (Wiki 10M) #29531);不能称为遗漏该修复。readers=3 也不能独立证明实际跨 CN 路由分配。
    • 样本不同,执行顺序固定,物理对象、Merge 与缓存状态没有冻结;不能将后续变快认定为严格冷/热缓存对照,也不能外推稳定 QPS。
    • 当前缺同期 CPU profile、逐查询完整 FileService 分阶段指标和对象变化时间线,不能确定 S3、解压、缓存或调度哪项独占主要耗时。
    • 下一步建议先由研发确认最小对照与所需采样:固定相同向量、谓词和对象,记录路由、Merge/预热变化,分别解释 entries 读取与源表过滤成本;不要原样重复完整 10M 性能矩阵或只延长超时。

    证据位于 artifact 的 wiki_threshold_diagnostic/evidence.json(精确 SQL/参数/计划/取消状态)、query.log、resources.log 及 CN 日志。另有 system.statement_info TEXT 长度异常,独立跟踪,不把它作为本次查询超时根因。

  6. LeftHandCold commented on Oct 11, 2026

    @LeftHandCold
    CollaboratorAuthor

    Main Wiki follow-up: Oct 9-11 throughput decline with changing physical layout and second-round cache refills

    The measured decline is real and should not be dismissed as a small random fluctuation. However, these runs are not a same-physical-data, same-cache-state image A/B, and an introducing PR has not been established. This is additional evidence for this open issue, not a claim that #28898 has recurred or that a new independent vector defect has been proven.

    1. Frozen executions

    Dates in the following tables are Beijing report dates (UTC+8). The MO SHA is taken from the deployed Pod image, not the regression workflow SHA.

    Date Main run / Wiki job Actual MO commit Regression workflow commit
    Oct 9 37874777871 / 113746044720 83d82b8ee0cd694e0c6a7146902d74ae4dfb415a 41bea3ae54a215e0d3652a882988ac1b1775d0fe
    Oct 10 37959361150 / 114001182737 72d4a49db7d750520e1a1654cb6091fc7169882b c5033b21c2477f8d6b3c6c5e3d4b871a7bf6b1e3
    Oct 11 38064357583 / 114292239222 8cc9167cb0a04479cd4c2f083aece5130f8c1946 a6a539de9baadd3518221df99cdcaf6509fb9f91

    All three are workflow_dispatch executions. Their workflow branches differ, so calling them identical scheduled runs would be inaccurate. The inspected differences do not change the formal six-mode Wiki SQL or its declared resource settings.

    Verified common conditions:

    • 1 TP + 2 AP CNs; 14 CPU / 55Gi per CN; 16Gi Memory Cache; GOMEMLIMIT=25000MiB.
    • Requests use the Proxy with the AP workload binding. The routing checks pass; the only-mode diagnostics report two readers on all three runs.
    • Wiki 10M, 768-dimensional float32; 10,000 queries per round; 100 workers; K=10; probe=5; ivf_preload_entries=0.
    • IVF index: lists=3162, float32 quantization, L2, training percent=2, max iterations=20.
    • Vector benchmark commit: 0bae04528673d7756c4ee2478ac8e4e41f54df1b.
    • Load tool pin: ba1e1977ee5d9ea657631cceb656e5fe3f9ef7bf.
    • The inspected query/GT/mapping identities are unchanged. This checks input identity, not independent GT provenance.

    2. Raw performance observations

    All figures below are the formal second-round reported QPS, not the best round or a cross-round average.

    Mode Oct 9 Oct 10 Oct 11 Oct 11 vs Oct 10
    only/PRE 978.77 not executed 171.41 not comparable
    only/POST 970.41 432.52 160.37 -62.9%
    filter/PRE 142.77 104.92 64.98 -38.1%
    filter/POST 662.96 385.54 210.38 -45.4%
    threshold/PRE 142.52 103.31 101.84 -1.4%
    threshold/POST 632.31 396.15 366.85 -7.4%

    only/POST declined 83.5% from Oct 9 to Oct 11. Its first/second-round QPS pairs are 927.76/970.41, 434.14/432.52, and 159.88/160.37. Both current rounds therefore remain slow; this is not just a slow first round.

    Second-round only/POST P99 increased from 237.03ms to 806.02ms to 2578.40ms. Both only/POST rounds on all three runs completed 10,000 requests with zero query/connection errors. Recall is close: 0.7567, 0.7526, 0.7553.

    The Oct 10 only/PRE first round had one query error and its second round was skipped. Consequently, the preceding warm-up sequence is also not identical across runs. Do not label the whole Oct 10 suite error-free.

    The same-branch 4.2 control does not show the same only/POST decline: run 37948959228 reports 475.93 QPS, and run 38062137649 reports 538.06 QPS. This is useful context, not a controlled Main-versus-4.2 comparison; the physical objects, nodes and some filtered-mode recall values differ.

    3. Important execution-condition difference: prepare-to-query gap and actual overlap

    Times in this section are UTC.

    Run IVF prepare job completed IVF query job started Gap
    Oct 9 fast run Oct 9 05:35:16 Oct 9 08:56:04 3h 20m 48s
    Oct 10 Oct 9 19:32:11 Oct 9 19:59:54 27m 43s
    Oct 11 Oct 10 18:54:01 Oct 10 19:16:33 22m 32s

    CREATE INDEX itself succeeded in about 1269, 1275 and 1203 seconds, respectively. Completion of CREATE INDEX does not mean subsequent physical Merge has finished.

    • In the fast run, TP special structures finished at 07:27:42, before IVF began. MOTR and TP ANLI later overlap IVF.
    • On Oct 10, TP special structures run 19:32:26-21:21:18, overlapping IVF.
    • On Oct 11, TP special structures run 18:54:15-20:43:06, also overlapping IVF.
    • The AP SSB/TPCH family finishes before IVF in all three runs.

    Thus unchanged workflow resource declarations do not establish identical background work or time available for Merge to settle. The longer gap is a plausible reason for the fast run's more favorable layout, but the gap alone is not a counterfactual proof of the full QPS difference.

    4. Same diagnostic query has very different storage work

    For the same only-mode query 0, late suite diagnostics show two readers and probe=5 in all three runs:

    Run Entries blocks read Storage-filter rows before -> after Logical decoded vector bytes
    Oct 9 17 139,264 -> 18,642 431,161,990
    Oct 10 258 2,113,536 -> 17,484 2,579,266,378
    Oct 11 146 1,196,032 -> 16,223 1,513,098,604

    Scored candidate counts remain of the same order, while visited blocks and logical decoded column bytes differ greatly. The runs are not physically equivalent just because lists, probe and row count match.

    These are post-suite diagnostic measurements, not per-query physical disk bytes during the timed rounds. In particular, Oct 11 has fewer diagnostic blocks than Oct 10 yet worse throughput: block count alone cannot explain the entire inter-night decline.

    5. Runtime evidence inside the current only/POST second round

    Current namespace: mo-main-family-38064357583-1. The second round runs Oct 10 19:21:40.14-19:22:43.44 UTC, or Oct 11 03:21:40.14-03:22:43.44 Beijing time.

    Both the entries table and base table are being rewritten

    • IVF entries table 273275, __mo_index_secondary_01a12717-4c7a-7398-84f0-13e9fcb5b8b6: Merge ends at 19:22:10.492551 (296MiB) and 19:22:13.677797 (426.1MiB), followed by prepare-commit records. Both are inside the measured second round.
    • Base table 273266, historical_file_blocks_wiki_ivfflat10m: Merge ends at 19:21:43.288969, producing objects ending 628d323c1fd4_0/1/2, 494.7MiB total.
    • Another base-table Merge ends at 19:21:49.969552, producing objects ending ae260d1eed8e_0..4, 773.2MiB total.

    Exact new object -> CN cache miss/refill chain

    At 19:21:44.384819, AP nightly-regression-dis-ap-cn-vhkct reads newly produced object 01a12743-42eb-7719-a410-628d323c1fd4_00000, offset 98611, requested size 32,842 bytes. Its FileService slow event records:

    1. Memory-cache lookup and unsuccessful disk-cache lookup.
    2. IOMerger ownership election.
    3. Disk-cache SetFile and object-storage reader creation.
    4. Reader close and publication of the full-object cache fill.
    5. Cache-data conversion and Memory Cache update.
    6. Read returns after 811.674ms.

    The sibling objects _00002 and _00001 also have slow initial reads, about 662ms and 672ms. This establishes real fresh-object reads during the supposed warm round; it is not just a speculation about arbitrary eviction of an unchanged key.

    The exact-version source matches the observation:

    • MemCache.Read keys cached data by file path, offset and size. A newly merged object has a different file path and cannot reuse the old object's entry by identity.
    • Full-object cache fill opens the object-storage reader at offset zero with no end bound when it owns the fill. A 32KiB requested entry can therefore wait for a much larger full-object fill.

    This does not prove that every request downloaded a full object, or that sharing/coalescing fixes stopped working.

    CPU and per-CN cache evidence

    • Pyroscope over 19:20:40-19:22:40, covering most of both only/POST rounds: AP vhkct has 50.99% cumulative DiskCache.Read, 25.22% LZ4 decode, 24.72% memmove, and 7.28% L2 distance CPU. AP cd6gl has only 1.23% cumulative DiskCache.Read. The percentages overlap and must not be added.
    • In the 60-second Prometheus query window 19:21:40-19:22:40, mo_fs_read_total{type="hit-disk"} increases by 33,798 on vhkct versus 373 on cd6gl. These count cache entries, not SQL requests or physical PVC bytes; scrape alignment is coarser than the query step.
    • Both AP Memory Caches are near 16Gi capacity. Inspected RSS/cache-pressure counters are zero. This does not exclude ordinary capacity eviction.
    • Resource artifacts show no CN restarts for these measured deployments. Disk-cache occupancy is well below its configured capacity; a full DiskCache is not established as the cause.

    The current bottleneck is therefore supported by actual column-read/cache/decode CPU work, not merely a client-side QPS calculation. How much each cause contributes to the total decline remains unquantified. The AP Pods are on different nodes across runs; the available entry counters are not sufficient to establish a physical PVC bandwidth/IOPS saturation limit or exclude node-local I/O interference.

    6. PR attribution boundaries

    The fast-to-current interval contains 49 commits. Complete, non-truncated Git tree inventories were compared, not just the Compare API's first 300 changed files.

    Current classification: confirmed performance decline; observed Merge/new-object/cache-refill and read/decode amplification; suspected layout/background/residency sensitivity; specific new code regression unproven.

    7. Why the performance publisher did not report REGRESSION

    The three performance series carry different overall tool fingerprints (73011728b90e, 226ea12cae74, 628bbfd23ab2), although the inspected Vector/Load pins are unchanged. Publisher output is BASELINE_BUILDING, with history 0/3 and performance_verified=false.

    This is not a performance PASS. Resetting the series prevents an automatic comparable-history decision here; it does not invalidate the raw measurements above. This is a separate measurement-policy concern, not proof of an MO execution defect.

    Next discriminating validation

    Use a short only/POST and filter/PRE comparison on the same physical objects and query set, recording a bounded Merge-settling condition for both the base and entries tables. Then compare images on the same topology and nodes, with matched warm-up and actual background-load timing, while recording per-CN cache, read/decode and latency measurements. Report a separate active-Merge phase if that workload is part of the intended contract.

    Do not assume a fixed sleep or the label "second round" creates a stable warm-cache baseline. Do not revert or modify a particular PR solely from these cross-night numbers.

    This follow-up extends the Oct 5 object-level Merge investigation. No new duplicate issue, production modification, test rerun, or load injection was performed.

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions