Skip to content

[Bug]: multi-CN HNSW query CN serves stale model after async generation update #27632

Not planned

Description

@XuPeng-SH

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

5bc051a

Other Environment Information

  • Hardware parameters: GitHub Actions hosted Ubuntu x64 runner
  • OS type: Ubuntu 22.04.5 LTS
  • Deployment: multi-CN Docker Compose with Proxy
  • Index: asynchronous HNSW, VECF32

Summary

After an HNSW generation is updated through asynchronous CDC on one CN, another CN that has already loaded the previous generation can continue serving the stale in-memory model. The metadata checksum changes and the CDC consumer processes the complete delta, but the query CN does not converge to the new generation within the BVT deadline.

Actual Behavior

In test/distributed/cases/pessimistic_transaction/vector/vector_hnsw_async.sql:

  1. The first 10,000-row f32 generation is built.
  2. A query on the query CN loads the first generation into the HNSW model cache.
  3. A second 10,000-row CDC load is processed asynchronously. The consumer processes the 8,192-row and 1,808-row fragments and publishes a changed metadata checksum.
  4. The query CN continues returning an old-generation nearest neighbor, for example 2638, instead of the delta endpoint 19999 for the full 120-second wait window.

Evidence:

The old test implementation explicitly documented the multi-CN limitation: the model is cached in memory and may not be refreshed after CDC synchronization if a query has already loaded it.

Expected Behavior

When a newer HNSW generation becomes visible through the shared metadata/index storage, every CN must either:

  • invalidate or replace its cached older generation before serving the next indexed query; or
  • reject/defer the stale cache and load the published generation within a bounded convergence interval.

A query issued after generation publication must be able to return rows introduced by that generation, including 19999 in the reproduction above.

Impact

This is a correctness issue for distributed ANN queries, not only a performance or recall fluctuation. A CN can return results from an older data snapshot after the index update has been published, causing newly inserted rows to be invisible and nearest-neighbor results to be wrong until cache refresh or CN restart.

Current Workaround

  • Do not issue the first f32 HNSW query until the asynchronous delta generation is complete; this is the BVT-side workaround in test: avoid stale HNSW cache in multi-CN BVT #27631.
  • For exact-result checks, force a full scan with BY RANK WITH OPTION mode=force where supported.
  • Restarting or routing to a CN without the old cache may clear the symptom, but is not an acceptable production workaround.

Suggested Investigation

  • Make the HNSW cache key include the published metadata generation/checksum and compare it on every indexed query.
  • Trace cache ownership and invalidation across CN-local consumers, model loaders, and query execution.
  • Ensure old model handles cannot remain reachable after a newer generation is published.
  • Add a native multi-CN integration test that warms the query CN cache, publishes CDC on another CN, and verifies the query CN observes the new generation.

Acceptance Criteria

  • A warmed query CN observes the new HNSW generation after CDC publication on a different CN.
  • The test passes repeatedly with two or more CNs and with parallel 8,192/1,808-row delta fragments.
  • No stale result is returned after the bounded convergence/readiness signal.
  • Cache replacement is generation-safe: no stale handle, double-close, leak, or unbounded model retention.
  • Existing f32/f64 async HNSW BVT coverage remains green.

Activity

  1. added
    severity/s0
    on Aug 26, 2026
  2. iamlinjunhong commented on Aug 26, 2026

    @iamlinjunhong
    Contributor

    Additional CI evidence from PR #27623 (head 5f01b702e4963fd2bd311137bb9ac6e5bce70639):

    This records the failed attempt before a single failed-jobs rerun of run 32945352378.

  3. cpegeric commented on Aug 27, 2026

    @cpegeric
    Contributor

    It is by design, and the design says so out loud

    pkg/vectorindex/cache/cache.go:33-36:

    // stalenessCheckEveryNTicks runs the IsStale freshness sweep every Nth HouseKeeping tick.
    // The ticker is VectorIndexCacheTTL/2 (2.5m), so N=4 ≈ a 10-minute cross-CN freshness
    // cadence — the bound on how long a remote CN can serve a stale index before it ages out.
    const stalenessCheckEveryNTicks = 4

    So the constant you're thinking of is VectorIndexCacheTTL = 5 * time.Minute, but the cross-CN convergence bound is ~10 minutes,
    not 5: ticker = TTL/2 = 2.5 min, sweep every 4th tick. The comment names the exact behaviour the issue reports as a bug, and
    calls it the bound.

    The BVT waits 120 seconds. That's ~5× under the designed bound.

    Two reasons even a 5-minute wait wouldn't have helped

    The TTL can never fire for this test. extendLocked sets ExpireAt = now + TTL on every Search. The BVT polls in a loop for the
    whole window, so it actively renews the entry it's waiting to expire. TTL eviction is unreachable while you're querying; the only
    convergence path is the 10-minute IsStale sweep.

    Cross-CN is pull-only, deliberately. Cache.Remove is documented as "LOCAL to this process — a prompt local optimization only;
    cross-CN coherence is handled by the pull-based freshness check (StaleChecker/IsStale via HouseKeeping)". The writer CN evicts
    immediately; the reader CN converges at its own sweep. That is precisely the topology in the report.

    The detection itself is correct — worth saying, so this doesn't get "fixed" twice

    IsStale does catch a CDC delta. The generation is a content fingerprint — the multiset of per-model-file MD5 checksums plus the
    model-row count — and generation.go spells out that "a CDC append/delete rewrites a model file → new checksum → the fingerprint
    changes". It's clock-independent on purpose, so it survives an (X,N)→(0,0)→(X,N) rebuild that a timestamp couldn't.

    So nothing is broken in the mechanism. It converges — at the sweep.

    Conclusion: #27629 is a test-expectation mismatch. #27631 (don't issue the first query before the delta completes) is the correct
    fix, not a cache change.

    Why we don't checksum on every search

    Not a stupid question, but the suggestion in "Suggested Investigation" — compare the checksum on every indexed query — is a
    design change from pull to inline, and it's the wrong trade for four separate reasons:

    1. It's a SQL round-trip, not a memory compare. The freshness generation is:

    SELECT checksum FROM .<metadata_table>

    IsStale runs that through queryHnswGeneration on a background auto-commit txn with a 60-second timeout. Putting it inline means
    every ANN query first does a metadata table scan, opens a txn, and waits on it. An HNSW search over a warm in-memory model is
    sub-millisecond; the freshness query is a distributed read. You'd add one to two orders of magnitude to the fast path to detect
    an event that happens once per CDC batch.

    1. It puts a hot metadata table in front of every vector query. Every CN, every indexed query, all tenants — the metadata table
      becomes a per-query hotspot, and its own read latency becomes vector-search latency. That's a scalability cliff you can't tune
      your way out of.

    2. The failure mode gets worse, not better. IsStale currently returns (true, err) on a query error so the entry is reclaimed and
      reloaded — safe, because it's a background sweep and a reload is cheap. Inline, a metadata hiccup would have to either fail the
      user's query or be ignored, and "ignored" is exactly the staleness you were trying to remove.

    3. It doesn't even buy exactness. The check would race the CDC commit anyway — you'd verify freshness, then search a model that
      went stale a microsecond later. You'd pay per-query cost for a bound that's still only "fresh as of a moment ago", not a
      consistency guarantee.

    The design already handles the case where this matters: the writer's own CN evicts synchronously, so read-your-writes on one CN
    is immediate. Only the remote warm CN lags, and that's what the sweep is for.

    If shorter convergence is genuinely wanted, the lever already exists and costs nothing: lower stalenessCheckEveryNTicks (4 → 2
    gives ~5 min, → 1 gives ~2.5 min) or VectorIndexCacheTTL. That's a tuning decision about how much background SQL you want, not
    new machinery. Each sweep is one short query per cached index, single-flighted off the housekeeping goroutine.

    One thing worth confirming before closing

    I'd want a single run that waits past 10 minutes and shows convergence. If the entry still serves stale data after two sweeps,
    that would be a real bug — and the code even anticipates it: genValid == false → IsStale returns (true, nil) → evict and reload,
    precisely so a hot entry "whose TTL keeps sliding on every search" can't be pinned "serving pre-CDC/rebuild data forever".
    Confirming that empirically turns this from an argument into evidence, and closes the issue cleanly rather than by assertion.

  4. iamlinjunhong commented on Sep 2, 2026

    @iamlinjunhong
    Contributor

    Additional exact CI occurrence from PR #27901, head 701060891904ca23e18320a6fab5b85b1ef852e7:

    This records attempt 1 before one failed-jobs rerun of run 33576541781.

  5. Ariznawlll commented on Sep 16, 2026

    @Ariznawlll
    Collaborator

    补充最新官方 main 的真实跨进程复现:commit d5c4e8b832ad0275766f6d8f8f0be7ec4c0fb544,本地 1 Log + 1 TN + 2 CN,四个独立 mo-service 进程;CN SQL 端口分别为 16001/16002。

    在三个独立数据库中各创建 100 行 VECF32(3) 表及 HNSW(M=64, EF_CONSTRUCTION=200, EF_SEARCH=200),同步构建后,先在两个 CN 查询 [999,0,0] 以预热旧 generation。两个 CN 都返回旧近邻 100。随后只通过 CN1 插入新的绝对最近邻:

    INSERT INTO docs VALUES (999, '[999,0,0]');

    基表已为 101 行、MAX(id)=999,两个 CN 的计划也都包含 Table Function on hnsw_search,但三个数据库均形成同一分叉:

    • CN1 持续返回旧近邻 100;
    • CN2 返回新近邻 999。

    数据库 1 连续读取 20 次均为 100/999;数据库 2、3 各补查 5 次也全部为 100/999。因此最新 main 上仍可观察到“一个进程已加载新 generation,另一个进程继续服务旧缓存”的现象。

    对照:使用 launch-multi-cn 在单个 mo-service 进程内承载两个 CN 时,三个同型数据库都立即得到 999/999。该拓扑共享进程级向量缓存,不能覆盖本 issue;必须使用独立 CN 进程才能复现。

    本轮未等待设计注释所述约 10–12.5 分钟后台 freshness sweep,因此这里只确认短窗口内的跨进程旧 generation 行为仍存在,不对 sweep 后的最终收敛作结论。

  6. Ariznawlll commented on Sep 16, 2026

    @Ariznawlll
    Collaborator

    在 main commit 01d60e1c4ded1b0f3fc1a4ecd75ce54e95e23b90 的 1 Log / 1 TN / 2 CN 独立进程环境补充了“在线重建与双 CN 并发 DML”路径,现象仍落在本 issue 描述的 CN 本地 HNSW 模型刷新问题内。

    测试表有 20,001 行,同时包含 FULLTEXT2(body) 和 HNSW(vecf32(8))。两个 CN 并发提交 40 个互不冲突的 UPDATE,把 id 1000..1039 的向量改为全零,并在更新期间执行:

    ALTER TABLE docs ALTER REINDEX hvec hnsw
      M=30 EF_CONSTRUCTION=120 EF_SEARCH=120 FORCE_SYNC;
    
    ALTER TABLE docs ALTER REINDEX ft fulltext2 FORCE_SYNC;

    更新、两个重建 DDL,以及重建期间两 CN 共 80 轮读查询均成功;基表精确扫描的 Top42 为 106,108,1000..1039,FULLTEXT2 在两个 CN 也都命中全部 40 个新文本。

    HNSW 查询出现 CN 间可见性分裂:

    • 执行更新/重建的 CN1 已返回 106,108,1000..1039,与 mode=force 一致;
    • CN2 的普通 HNSW 查询仍返回重建前候选,但同一 CN 上 mode=force 已返回 106,108,1000..1039;
    • 只重启 CN2 后,普通 HNSW 查询立即返回 106,108,1000..1039,与精确扫描一致。

    因此在线重建没有丢失这些更新,持久化的新 HNSW 版本也是正确的;问题是远端 CN 在索引 generation 更新后继续使用旧的进程内模型,冷加载才切换到新版本。这个交叉场景不另开 issue。

  7. Ariznawlll commented on Sep 18, 2026

    @Ariznawlll
    Collaborator

    在固定的 main commit 01d60e1c4ded1b0f3fc1a4ecd75ce54e95e23b90 上补充了 HNSW 小容量多 generation 路径;环境为 1 Log / 1 TN / 2 CN 独立进程,测试日期 2026-09-18。

    分别使用 VECF32(3)、VECF64(3) 建立 MAX_INDEX_CAPACITY=3 的 HNSW。11 个非 NULL 向量会生成 4 个 metadata model row,证明查询实际跨多个 HNSW 文件合并,而不是单 model 控制。初始状态下,两 CN 的普通 HNSW 查询与 mode=force 在以下分页均完全一致:LIMIT 1、LIMIT 3、LIMIT 5 OFFSET 2、全量 11 行以及越界分页。

    随后通过 CN2 完成 UPDATE、DELETE、INSERT,并执行:

    ALTER TABLE t ALTER REINDEX hx HNSW FORCE_SYNC;

    新持久化索引包含更新后的 id=11、新增的 id=12,并排除了已删除的 id=5/6。CN2 的普通 HNSW 查询立即与精确扫描一致;此前已预热旧 model 的 CN1 继续返回旧候选:

    VECF32 / VECF64, CN1, LIMIT 1: indexed=(7), exact=(11)
    VECF32 / VECF64, CN1, LIMIT 4: indexed=(7,8,4,9), exact=(11,12,7,8)
    

    两种向量类型各覆盖 4 组 LIMIT/OFFSET,整套测试重复 3 次,均稳定形成“执行重建的 CN 已读取新 generation、远端已预热 CN 继续使用旧 generation”的分裂;基表精确结果、持久化索引内容和 writer CN 查询一致,排除了重建丢数据及容量 rollover 错误。

    该现象与本 issue 的跨 CN 本地模型刷新范围相同,不另开 issue;新增覆盖说明问题同样发生在 F64、MAX_INDEX_CAPACITY 触发的多 model 文件,以及 UPDATE/DELETE/INSERT 混合变更后的同步重建路径。

  8. 7 remaining items

  9. Ariznawlll commented on Nov 4, 2026

    @Ariznawlll
    Collaborator

    结论

    测试不通过。原始双 CN 热缓存场景在最新 main 连续 3 次复现:新增 HNSW 代已发布且包含 20,000 行,查询 CN 在随后 120 秒内始终返回旧邻居 2638,而不是新增数据中的精确目标 19999。

    关键证据

    • 测试版本:main@b27f3869e6f2552311fbbdda2f62b0ca31ec3a67;本地独立 1 Log / 1 TN / 2 CN,SHARED 使用真实 MinIO,两条 MySQL 连接直连不同 CN,运行时 git_version() 均为 b27f3869e6。三次使用独立库与新索引。
    • 每轮使用仓库的 SIFT128 基础数据 和 增量数据:先写 10,000 行并创建异步 HNSW;在 CN2 查询并加载旧模型,随后从 CN1 写入另外 10,000 行,等待隐藏元数据 checksum 改变且 nrow=20000 后,持续执行 SELECT id FROM t ORDER BY l2_distance(v, <id=19999 的向量>) LIMIT 1。
    • 3/3 轮均在已发布代之后持续 120 秒返回 2638,采样次数分别为 118、119、119;预热旧代的基础数据查询返回 0。EXPLAIN 显示查询命中 Vector Index Scan on hv;服务端日志显示 CN2 加载 10,000 行模型、CN1 消费 8,192 和 1,808 行增量。第三轮在仍复现时另用普通表扫描(ORDER BY l2_distance(v, ...) + 0,EXPLAIN 确认为 Table Scan)返回 19999,且主键点查确认该行存在。IGNORE INDEX 在此查询上仍生成向量索引扫描,未将其作为精确扫描依据。
    • 本轮采用分批 INSERT 驱动 CDC,未运行原 SQL 文件中的并行 LOAD 或完整 HNSW BVT;没有观察 120 秒之后是否最终收敛,也没有测试生产网络、内存泄漏或所有 CN 拓扑。

    待解决点

    • 请研发核查已发布 generation 与远端热模型的失效/刷新策略,并明确原 issue 的 120 秒收敛验收条件;不得仅因查询能在未预热 CN 上正确返回而认定已修复。
    • 修复后补跑原始并行 10,000 行增量、预热 CN 和多轮发布、正常查询及异常恢复;该原始大数据规模和跨 CN 场景需要单独加入 big-data 回归并实际运行验证。
  10. cpegeric commented on Nov 4, 2026

    @cpegeric
    Contributor

    Closing as working as designed.

    A vector index is eventually consistent across CNs. Every CN keeps its own in-memory copy of the loaded model. When a new generation is published, the CN that wrote it drops its local copy right away. Any other CN that already has the old model loaded picks up the new one on its next periodic freshness sweep. Queries never check freshness. This is the documented contract:

    • docs/design/vector_index_cache_ctl.md §1: "A warm per-CN index-cache entry is refreshed across CNs only by a periodic freshness sweep, so its default cross-CN convergence window is coarse (minutes)… Neither should change the default behaviour or move freshness onto the query path."
    • §3: "Freshness stays a pull. … it never validates freshness on the query path."
    • §4: "Cross-CN freshness of a warm entry remains the eventual periodic-sweep contract."
    • §8: "Read-your-writes across CNs remains a separate, opt-in concern that this feature does not promise."
    • pkg/vectorindex/cache/cache.go: the sweep runs every 4th housekeeping tick (TTL/2 = 2.5 min), so a remote CN converges in about 10 minutes by default.

    Every reproduction in this thread has the same shape: one CN loads the old model, a second CN publishes the new generation, and the test then expects the old CN to change its answer within 120 s or less. That deadline is about 5× shorter than the designed bound. The reproductions do show that the writer CN is correct, that a cold CN is correct, that mode=force is correct, and that a restart fixes it. That is what an eventual-consistency contract looks like, not lost or corrupted index data. The 2026-11-04 rerun also says it did not watch past 120 s.

    A test or operator that needs a CN to converge quickly can use the sys-admin knobs from the same design doc instead of the default cadence:

    -- shorten the cross-CN sweep for the duration of the test (0 restores the default)
    select mo_ctl('cn', 'SetVectorIndexFreshnessInterval', '1s');
    -- or drop one exact cache key on every CN synchronously; the next query reloads
    select mo_ctl('cn', 'GetVectorIndexCacheKeys', '');
    select mo_ctl('cn', 'EvictVectorIndexCache', '<exact key>');

    fulltext2_async.sql and branch_multi_index_restore_init.sql already use these. A multi-CN BVT that asserts a delta right after warming the cache on another CN should do the same, or should not warm the reader CN first (#27631). Fixing that is test work and belongs in #27629.

  11. removed their assignment
    on Nov 4, 2026
  12. Ariznawlll commented on Nov 6, 2026

    @Ariznawlll
    Collaborator

    测试版本

    MatrixOne 官方 main 65b721e1b93c6b9e05db2063b220e0c35916b335;隔离本地 2 CN / 1 TN / LogService。CDC 执行者位于 CN1,查询者固定 CN2。默认周期实验期间后半段同时有 #25590 事务压力测试,采样间隔约 5 秒。

    原问题验证

    先插入旧向量并创建异步 HNSW,等待非空模型文件;CN2 执行查询且 EXPLAIN 确认 Vector Index Scan,加载旧代并返回 id=0。随后插入离目标更近的 id=1,创建快照作为写入水位,在最新成功 CDC 任务的 watermark 超过该水位后持续查询 CN2。

    默认配置下,发布后采样约 665.9 秒仍为旧结果 0,约 670.9 秒首次返回新结果 1;这是一次观测和 5 秒采样精度,不是所有情况下的最大收敛保证。该结果说明先前只观察 120 秒不足以证明永不刷新,也说明这次实际收敛耗时明显长于 120 秒。

    进一步使用 10,000 条初始向量,先在 CN2 预热旧模型并与精确扫描核对,再由两个并发连接写入共 10,000 条增量;CDC 日志实际记录 8,192 与 1,808 条批次。确认成功任务 watermark 超过最后提交的快照后,CN2 精确表扫描返回新行 19999,预热的 HNSW 路径先返回旧行 0,三轮分别约 165、747、588 秒首次返回 19999。采样间隔 5 秒;同第一次小规模结果一起体现默认周期存在较大波动。后两轮期间存在其他本地测试及构建负载,这些数值不是隔离性能基准。

    Happy Path 覆盖

    将隔离实例的刷新基础周期临时设为 1s,重新创建独立数据和索引并重复完整的旧代预热、跨 CN 提交及 watermark 门控,共 3/3 次在新代发布后首次 5 秒采样返回新结果。测试结束已对两个 CN 恢复 0 默认配置;控制接口返回两个 CN 均已应用。另在独立双 CN 实例、1 秒基础周期下对同一索引连续更新 5 代及另一轮 25 代;每代先确认 CDC 水位再比较远端索引与精确扫描,5/5 和 25/25 均收敛到对应新行。25 代中每次广播查询缓存键均为一个键、一个 CN 持有;读取 CN RSS 首次约 323.5 MiB、最后约 180.0 MiB,观测范围约 164.5~326.8 MiB,未见该有限测试内持续增长。RSS 是整进程采样而非原生句柄精确计数,25 代、26 行不能证明长期无泄漏。实验结束恢复两个 CN 默认周期并停止实例。

    Unhappy Path 覆盖

    默认和缩短周期的实验在新代提交成功且 watermark 越过快照后都实际观察到旧结果,验证了旧缓存可能存在的窗口;旧/新两条向量为可区分的最近邻。多代实验中插入错误维度向量返回 20301,表仍保留预期 6 行。本轮未注入 CDC 故障、节点重启、并发 cache handle 释放或模型加载失败。

    白盒验证

    检查 pkg/vectorindex/cache/cache.go:默认以 TTL/2 为基础节拍,每四个节拍触发一次 freshness 检查;检查到过期模型后由后续 housekeeping 回收,查询路径不逐次强制检查。代码和本轮结果支持周期性最终收敛的解释,但这些实际时间不能当作严格 SLA 或证明缓存没有资源泄漏。对当前 main pkg/vectorindex/cache 和 pkg/vectorindex/hnsw 的 10 个刷新周期、过期淘汰、错误处理及 HNSW 状态检查定向 Go 测试各运行 3 次,30/30 顶层测试通过;本轮并发缓存 race 构建因本机磁盘余量降至约 2.7 GiB 而中止,未执行出结果;也未完成长期内存泄漏测试。

    回归测试

    本轮执行隔离脚本 test_27632_default_convergence.py、run_27632_short_interval.py;未新增 MatrixOne 主库 PR。此前现有 vector_hnsw_async.sql 在本次 main 两个 CN 和 Proxy 上的标准 MOTR 10/10 次、各 82/82 语句通过,但该用例本身不等同于本 issue 要求的预热远端缓存并验证新代的全规模专项。另手动开启 MOTR main bcad6bbdb2f0efd0e565c73611b270ccabf2daf3 中当前隔离的 05_vector_index.issue_27632_hnsw_insert_visibility,通过 Proxy 运行 3 次均通过,用时分别约 4.2、485.9、599.5 秒;最后一次接近该用例约 600 秒轮询上限,说明通过时间差异很大。该用例使用单连接,不能代替显式跨 CN 预热与发布的全规模验证。

    测试证据

    日志 test_27632_default_convergence.log 和 test_27632_short_interval.log 记录 CDC 执行者、读取 CN、frontier/watermark、每次结果与设置恢复。另有 test_27632_20k_parallel.log、CN1 mo.log 记录 10,000 + 10,000 场景、两个并发写入及 CDC 的 8,192/1,808 批次。早期两次预热使用大量重复向量时最近邻基线不符合断言,已改为可区分向量并加入精确表扫描对照,早期运行不作为通过或产品失败证据。20,000 行并发场景共三轮;test_27632_multi_generation.log、test_27632_retention25.log 记录缩短周期的连续五代/25 代实验、缓存键、RSS 和错误维度拒绝。未进行长期内存/句柄泄漏或故障恢复检查。

    测试结论

    默认设置下观察到约 671 秒后收敛;缩短周期控制 3/3 收敛。原始规模并发写入与分批在本地复测三轮通过;多代默认周期、跨 CN 故障恢复、长期资源安全及对应独立 big-data 回归仍未完成,保持 Open,不将本次局部测试作为完整验收通过。

    补充:独立专项回归已提交 nightly-regression #1911,不涉及 MatrixOne 主库 PR。固定最新 main a86c130cc09c5859e1651d49746a35bc79c2c07a 的隔离 TKE run 42171498216 已针对修正后的专项提交执行:产品 git_version() 返回 a86c130,3/3 轮均通过,水位高于最终提交快照,查询 CN 不同于 CDC 执行 CN;三轮分别约 740.829 / 580.651 / 580.660 秒从预热旧结果 0 收敛至精确扫描结果 19999。每轮完整轮询、水位和拓扑见产物 issue-27632-cross-cn-hnsw-42171498216-1;专项 job 和清理 job 均成功;清理日志记录 MatrixOneCluster 已删除、该命名空间无资源且 namespace 已删除。该 TKE 运行 workflow head 为 e2b1588c04235b568e96e3b6b1aa6545f7e5208b,PR 后续提交仅增加 test-control 角色声明及生成物,专项 workflow 和驱动未改变;PR 当前必需 CI 已通过。此前 run 42171136171 在排队、资源创建前取消;该 SHA 比本地二进制 SHA 仅多一个 Go 测试文件。故障恢复和长期资源安全仍未验收,因此仍保持 Open。

  13. Ariznawlll commented on Nov 24, 2026

    @Ariznawlll
    Collaborator

    结论

    按 working as designed 关闭本 Issue。这里不是“代码已修复后才收敛”,而是原 Issue 把跨 CN 周期刷新窗口内服务旧 HNSW generation 当成了永久不刷新;后续本机和独立 TKE 均证明新代会按既有最终一致性合同收敛。120 秒轮询窗口不足以判定该产品行为违约。

    默认周期下的原场景复核

    测试版本:MatrixOne 官方 main@65b721e1b93c6b9e05db2063b220e0c35916b335,隔离 2 CN / 1 TN / LogService,CDC 执行 CN 与查询 CN 分离。

    • 小规模旧代预热后,CN2 在约 670.9 秒首次返回新最近邻,证明此前 120 秒内的旧结果不是永久 stale。
    • 原始 10,000 基础向量 + 两个并发连接写入 10,000 增量,CDC 实际分为 8,192 和 1,808 条批次;三轮分别在约 165 / 747 / 588 秒从预热旧结果 0 收敛到精确扫描结果 19999。
    • 查询前均以成功 CDC watermark 越过最终提交快照为门控,并确认基表已经可见新行,因此比较的是索引刷新时序,而不是源数据未提交。
    • 代码检查与研发说明一致:默认以 TTL/2 为基础节拍,每四个节拍执行 freshness 检查;查询不逐次强制刷新,旧模型可在周期窗口内继续服务。

    控制实验与回归

    • 将刷新基础周期临时缩至 1 秒后,完整跨 CN 场景 3/3 在首次 5 秒采样返回新结果;连续 5/5 代、25/25 代均收敛。
    • pkg/vectorindex/cache 与 pkg/vectorindex/hnsw 的 10 个刷新、淘汰、错误处理定向 Go 测试各执行 3 次,30/30 通过。
    • 标准 vector_hnsw_async.sql 在两个 CN 和 Proxy 上 10/10 次、各 82/82 语句通过。
    • 独立 TKE run 42171498216 使用产品 main@a86c130cc09c5859e1651d49746a35bc79c2c07a,git_version() 一致;原 20,000 行、不同 CDC/查询 CN 场景 3/3 通过,分别在约 740.829 / 580.651 / 580.660 秒收敛。专项与清理 job 均成功。
    • 专项回归已交付到 mo-nightly-regression#1911;上述证据固定于 workflow head e2b1588c04235b568e96e3b6b1aa6545f7e5208b,不拿未执行的新 head 冒充通过。

    边界

    本轮没有证明长期内存/句柄无泄漏,也没有覆盖节点重启、CDC 故障或并发 cache handle 释放;这些属于另外的资源安全与故障恢复测试,不改变本 Issue 所报告的“跨 CN 旧 generation 是否按设计最终刷新”的结论。若后续出现超过已文档化刷新合同仍不收敛、句柄持续增长或重启后异常,应以对应证据单独跟踪。

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

Metadata

Metadata

Assignees

Labels

Bug fixseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions