Skip to content

[Bug]: mixed IVF pre-filter 首次访问 FULLTEXT 复制表时查询超过 100s 并断连 #28843

Closed

Description

@Ariznawlll

Description

Main TKE nightly 的 ANLI mixed(pre) 混合查询在首次访问 FULLTEXT 复制表时出现超过 100 秒的长尾,客户端触发读超时并断开。相同运行中的单项 qvec、qft、nqft 均成功,混合阶段最终因两条 nqft 查询失败退出。

Environment

  • Branch: main
  • MatrixOne commit: a68a200c0bfb0c18f1b7f49d26b20b8d0d9b017f
  • Namespace: mo-main-commit-a68a200c0b-20260913
  • Deployment: TKE,3 CN + 1 DN + 3 LogService + 2 Proxy
  • CN resources: 14 CPU / 55 GiB memory limit
  • Test time: 2026-09-14 00:23:04–00:33:08 UTC

Steps to reproduce

  1. 准备 ca_comprehensive_dataset 及三张复制表,并为各表创建 IVF 与 FULLTEXT 索引。
  2. 使用 nightly 当前参数先执行单项查询,再执行 pre-filter 混合查询:
ANLI_QUERY_DURATION=300 \
ANLI_MIX_DURATION=600 \
ANLI_QUERY_CONCURRENCY=10 \
ANLI_TYPE_CONCURRENCY=5 \
./run_all_anli_tests.sh <proxy-host> report_pre pre
  1. 混合阶段同时运行 5 个 qvec 和 5 个 nqft worker,并轮询以下 4 张表:
ca_comprehensive_dataset
ca_comprehensive_dataset_copy
ca_comprehensive_dataset_copy01
ca_comprehensive_dataset_copy02

Actual behavior

混合阶段于 00:23:04 UTC 启动。两条首批 nqft 候选查询在约 100 秒后同时超时:

OperationalError: (2013, 'Lost connection to MySQL server during query (timed out)')

对应表和查询词为:

-- ca_comprehensive_dataset_copy01
SELECT md5_id,
       MATCH (question) AGAINST ('红包 在' IN BOOLEAN MODE) AS vec_dist
FROM ca_comprehensive_dataset_copy01
WHERE MATCH (question) AGAINST ('红包 在' IN BOOLEAN MODE)
  AND delete_flag IS NULL
ORDER BY vec_dist DESC
LIMIT 200;

-- ca_comprehensive_dataset_copy
SELECT md5_id,
       MATCH (question) AGAINST ('年度 有' IN BOOLEAN MODE) AS vec_dist
FROM ca_comprehensive_dataset_copy
WHERE MATCH (question) AGAINST ('年度 有' IN BOOLEAN MODE)
  AND delete_flag IS NULL
ORDER BY vec_dist DESC
LIMIT 200;

服务端 nightly-regression-dis-tp-cn-7k9h2 分别在约 100.07s 和 100.11s 后记录 context canceled。其中一条同时停在 FULLTEXT 隐藏索引的 __DocLen 查询:

SELECT COUNT(*)
FROM anli_test.__mo_index_secondary_...
WHERE word = '__DocLen'

同一阶段 qvec 的最大延迟达到 98.14s。客户端重建连接后测试继续运行,之后没有新增失败,但累计失败数保持为 2:

nqft: total=2469, success=2467, failure=2, cumulative_failure=2
Valid results: 3/4

Expected behavior

在没有 OOM、Pod 重启或资源打满的情况下,首次访问已建好的 FULLTEXT/IVF 索引不应阻塞超过 100 秒并导致客户端连接超时。混合查询应完成且查询失败数保持为 0。

Stability and controls

  • Reproducer: 当前 main nightly 观察到 1 次;属于间歇性问题,最近检查的 3 次相同步骤均成功。
  • Same-run controls: 单项 qvec 95,338/95,338、qft 1,323/1,323、nqft 3,283/3,283,均无失败。
  • Previous-run controls:
    • Run 34701219177 / Job 103637982220: success
    • Run 34614210743 / Job 103455378390: success
    • Run 34493586679 / Job 103091246781: success
  • Pod restart count: all 0 during the event window.
  • OOM events: all 0 during the event window.
  • Affected CN memory: approximately 27–31 GiB / 55 GiB limit.
  • Affected CN CPU peak: approximately 4.27 / 14 cores.
  • Read-only workload; no data modification or corruption was observed.

Evidence

Code analysis

The test uses PyMySQL read_timeout=100s. The two backend statements started with the mixed workload and were canceled only after the client hit that exact timeout; the validator correctly reported the real query failures.

The standalone tests warm only the default table, while the mixed stage immediately distributes work across all four tables. The failed statements were the first accesses to two copied tables. Loki also shows slow FileService reads during the startup window. This is correlated with cold index/cache loading, but the exact MatrixOne blocking path still needs confirmation from FULLTEXT/FileService profiles.

The failure is not explained by OOM, process restart, CPU saturation, memory exhaustion, fixture generation, JSON extraction, or expected-result comparison.

Regression coverage

After the product behavior is understood or fixed, add a focused distributed regression that:

  1. creates multiple tables with equivalent FULLTEXT/IVF indexes;
  2. begins mixed qvec+nqft queries without pre-warming the copied tables;
  3. records first-query latency separately from steady-state latency;
  4. asserts no connection loss, timeout, panic, OOM, or restart.

Related

Activity

  1. added this to the MO-202609 milestone on Sep 14, 2026
  2. added theissue type on Sep 14, 2026
  3. VioletQwQ-0 commented on Sep 15, 2026

    @VioletQwQ-0
    Collaborator

    QA handoff(合并后验证):

    • 关联 PR fileservice: avoid full-object rereads during pending cache publication #28888 已合并,merge commit 9089d7c3e34f06ecb06479816cbb53d6be1178b2,当前 main 为 9d5cc76db1ef1b7572235455667bc3703a1e12db。
    • 已确认的证据:FileService pending-publication fallback 机制在 Linux 与 TKE paired acceptance run 34947682163 通过,实际原始场景的 mixed FULLTEXT/IVF 冷启动超时是否完全消失仍未证实。
    • QA 剩余步骤:在包含 merge commit 的当前 main 上复现 issue 原始多表冷启动 mixed(pre) 场景,覆盖 copied FULLTEXT/IVF 表首次访问,确认无 100s client timeout、connection loss、server context cancellation、panic/OOM/restart,并记录 qvec/qft/nqft 失败计数与首查/稳态延迟。
    • 预期:PASS 为原始场景完成且失败数为 0;FAIL 为仍出现超时/断连或服务端取消,并保留 run/job/namespace 与日志证据。机制 acceptance PASS 不等同于原 issue scope QA PASS。

    QA required=yes;issue 保持 OPEN,等待部署验证。

  4. Ariznawlll commented on Sep 16, 2026

    @Ariznawlll
    CollaboratorAuthor

    今晚跑了回归明天更新

  5. Ariznawlll commented on Sep 17, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试通过。

    验证环境:

    原问题场景验证结果:

    • 使用 ca_comprehensive_dataset 及 3 张复制表
    • mixed pre-filter,5 个 qvec + 5 个 nqft worker,总并发 10
    • 持续运行 600 秒
    • qvec:729/729 成功,failure=0,cumulative_failure=0,最大延迟 20.87 秒
    • nqft:1262/1262 成功,failure=0,cumulative_failure=0,最大延迟 14.31 秒
    • ANLI normal/pre 结果均为 4/4 通过
    • 未出现 Lost connection、100 秒查询超时或 context canceled
    • 测试期间 Pod 重启增量为 0,未发现 OOMKilled

    原问题中复制表首次访问约 100 秒后断连、nqft 累计失败 2 次的现象未再出现,问题已修复。

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s-1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions