Repository navigation
Description
现象
在两个 CN 的集群中,向表插入数据并成功创建 FULLTEXT2 索引后,立即执行 DROP INDEX、DROP TABLE 或 DROP DATABASE,语句可能报错;DROP INDEX 的同 CN 和跨 CN 路径均能触发:
Error 20101 (HY000): internal error: ISCP executor on task runner <CN> did not become ready within 10s for tableID=<id> jobName=index_ft jobID=1
已在当前官方 main commit dce60631f8c857ae730a4d2f328df5962e4f2a8d 的本地双 CN embedded cluster 中复现。跨 CN 最初三次冷启动均失败;后续运行有成功也有失败,目前总计 5/8 次报错。相同 CN 创建和删除的独立进程中 2/3 次报相同错误,任务执行者正是本地 CN。这是概率性就绪竞态,并非每次必现。报错后源表数据仍在,但这次 DROP INDEX 没有完成。若等待该索引的 cdc_tail 消费者确实取得进度,再删除,则相同环境中的对照场景成功。
最小复现
分别连接两个 CN,在两条连接上执行 SET experimental_fulltext2_index=1。在 CN1 执行:
CREATE DATABASE ft_drop_repro;
CREATE TABLE ft_drop_repro.docs (id BIGINT PRIMARY KEY, body TEXT);
INSERT INTO ft_drop_repro.docs VALUES (1, 'amber atlas');
CREATE FULLTEXT2 INDEX ft ON ft_drop_repro.docs (body);CREATE FULLTEXT2 INDEX 返回成功后,立即在 CN1 或 CN2 执行:
DROP INDEX ft ON ft_drop_repro.docs;失败发生在 DROP INDEX 等待 ISCP executor 的阶段;这个过程不涉及 PreparedStatement、强制同步或高数据量。完整双 CN 测试代码保留在 evidence/index_build/fulltext2_immediate_drop_test.go(探索代码,尚未提交为正式回归)。
预期行为
成功创建的 FULLTEXT2 索引应允许随后的合法 DROP INDEX 完成。若索引消费者尚未就绪,应在安全、有限的等待与重试之后处理,不能仅因创建后短暂的就绪窗口向客户端暴露内部错误;同时不能在尚未确认消费者静止时直接删除索引。
定位线索
pkg/sql/compile/ddl.go 中 DropIndex 先调用 DropIndexCdcTask、DrainIndexCdcTaskConsumer,之后才更新约束和删除索引子表。pkg/sql/compile/iscp_util.go 的 drain 在 10 秒内不能确认 executor 就绪时返回上述错误。对照场景等待 cdc_tail 有进度后可成功,表明这更像创建后 ISCP 就绪窗口问题,而非 SQL 语法或表数据问题。
相关但并非同一复现场景:已关闭的 #26181 是集群启动后 clone 异步索引时 ISCP task runner 先于 executor 就绪;本问题是在当前 main 上成功创建 FULLTEXT2 索引后立即跨 CN 删除。
同路径索引变体(2026-10-08 补充)
在同一官方 main、相同双 CN 拓扑中,把上述 CREATE FULLTEXT2 INDEX 换成异步向量索引,随后立即跨 CN 执行 DROP INDEX ix:
CREATE TABLE vectors (id BIGINT PRIMARY KEY, v VECF32(3));
INSERT INTO vectors VALUES (1,'[1,2,3]'),(2,'[2,3,4]');
-- 分别在独立测试进程中运行其中一种,并启用对应 experimental_*_index 开关:
CREATE INDEX ix USING IVFFLAT ON vectors(v) OP_TYPE 'vector_l2_ops' LISTS=1 ASYNC;
CREATE INDEX ix USING HNSW ON vectors(v) OP_TYPE 'vector_l2_ops';
-- 另一 CN:
DROP INDEX ix ON vectors;- IVFFLAT:六个独立进程均返回与 FULLTEXT2 相同的
ISCP executor ... did not become ready within 10s(6/6);先执行ALTER TABLE vectors ALTER REINDEX ix IVFFLAT FORCE_SYNC再删除的对照成功(1/1)。 - HNSW:三个独立进程中两次返回相同错误、一次成功(2/3);先执行
ALTER TABLE vectors ALTER REINDEX ix HNSW FORCE_SYNC再删除的对照成功(1/1)。 - 失败时两种向量表的源数据均保留两行。这些变体共同经过
DropIndexCdcTask/DrainIndexCdcTaskConsumer,错误字符串、阶段、时序一致;目前按同一问题追踪,不重复创建 issue。
已核对 MatrixOne MySQL 兼容性契约:其中 FULLTEXT2-001/002 仅限定异步搜索结果和跨 CN 缓存的立即一致性,HNSW-001/VECTOR-002 则限定特定向量值和查询计划;均未把合法 DROP INDEX 的 ISCP executor 就绪错误列为支持边界。
失败后的状态与恢复
- FULLTEXT2:两次触发错误后的扩展检查均显示索引定义、未标记删除的 ISCP 任务仍存在;新增文档后,隐藏索引表的
cdc_tail前进,新增文档可通过MATCH找到,重试DROP INDEX成功。 - IVFFLAT:三次触发错误后的扩展检查均显示索引定义、未标记删除的 ISCP 任务仍存在;新增向量行、
FORCE_SYNC重建、Top-K 检索与重试DROP INDEX成功。 - 对“失败后无需重建即可继续异步维护 IVF_FLAT”的检查尚无有效结论:在本地 embedded 夹具里,不执行 DROP 的对照在 2 行和 10 行种子数据下,90 秒内活动 entries 同样保持 0。不能把该观察归因于失败的 DROP,也不能据此声称生产集群发生持续同步停滞。
DROP TABLE / DROP DATABASE 影响面(2026-10-08 补充)
用上述 FULLTEXT2 表和索引,成功 CREATE FULLTEXT2 INDEX 后立即从另一 CN 执行:
DROP TABLE ft_drop_repro.docs;
-- 或在独立测试中:
DROP DATABASE ft_drop_repro;DROP DATABASE:三个独立冷启动测试进程均返回相同的ISCP executor ... did not become ready within 10s(3/3);失败时数据库、表、索引目录记录、活跃 ISCP 任务及源行都仍存在。重试成功后,数据库、表、隐藏索引表、索引记录和活跃任务均为 0。DROP TABLE:三个独立冷启动测试进程中一次返回该错误、两次成功(1/3);失败后的数据库、表、索引任务和源行仍完整,重试后仅数据库保留,表、隐藏索引表、索引记录及活跃任务均为 0。另在一个已启动的测试进程内连续执行三次,均成功(3/3),说明概率依赖就绪时序。- 源码调用链:
DropTable→DropAllIndexCdcTasks→drainIndexCdcTaskConsumer;DROP DATABASE会逐表调用相同清理路径。它们与DROP INDEX共用产生错误的 drain,因此作为本 issue 的影响范围,不拆成重复 issue。
ALTER TABLE DROP INDEX 语法路径
CREATE FULLTEXT2 INDEX 成功后,从另一 CN 立即执行 ALTER TABLE ft_drop_repro.docs DROP INDEX ft。三个独立冷启动测试进程中一次返回同样的 ISCP executor 就绪错误、两次成功(1/3)。失败时索引定义和活跃 ISCP 任务完整;新增文档仍能经 CDC 同步并被检索到,重试 ALTER TABLE ... DROP INDEX 成功。该语法经 pkg/sql/compile/ddl.go 的 ALTER DROP INDEX 分支调用同一 drain,也属于本 issue,不另提单。
Activity
[-][Bug]: DROP FULLTEXT2 INDEX immediately after CREATE fails while ISCP executor is not ready[/-][+][Bug]: DROP recently created asynchronous indexes can fail while ISCP executor is not ready[/+][-][Bug]: DROP recently created asynchronous indexes can fail while ISCP executor is not ready[/-][+][Bug]: DROP INDEX/TABLE/DATABASE can fail soon after async index creation while ISCP executor starts[/+]iamlinjunhong commentedon Oct 16, 2026
Related CI occurrence of the HNSW index drain readiness failure during final database cleanup, now in
TestV407UpgradeAddsIndexMetadataProvenanceColumns.The test creates a HNSW index, exercises legacy index-metadata upgrades, and passes its RelKindAtCreate/AfterDropColumn/AfterUpgrade assertions before final DROP DATABASE fails. This reaches the DROP DATABASE -> index-task cleanup -> ISCP consumer drain owner already described here. It is a new test occurrence of that readiness class, not proof that every prior occurrence has the same root cause.
PR/head: PR #30297,
725de6bfc3012c3b48ad50871b7ace0fcc85841d.Run 38857263820, attempt 1.
Ubuntu/x86 UT job 116831474304, failed step
Unit Testing.CI Required job 116875115946 propagates
matrixone-ci: failure.CI command:
make ut UT_CONFIGURED=1 UT_PARALLEL=6 UT_TIMEOUT=40 UT_SHARD=all; Go 1.27.1 Linux/amd64, CGo, short/race,matrixone_test.pr root durations: 9.68s, 9.67s, 9.68s.
main root durations: 0.84s, 0.83s, 0.83s.
Four bounded flaky-candidate checks were completed for this occurrence:
15c304e174f5b3b6bc3a30ca65dbc133090c1d59bd9f9a973011579c1cd349ad). They report exactly three failing roots: the V406 catalog overlap fence, V407 index-metadata cleanup, and view-description subscription cleanup. No compilation/type/static/security failure, race-detector report or timeout panic appears. The additional V406 subcase and residual-account assertion belong to these roots.-count=1; package durations were 25.198s, 25.088s and 28.198s. The original assertions and cleanup deadlines were retained.6b081a1fcfe60150a3bf61566352b58ed97e2f5cpassed the identical complete selection in three independent processes, package durations 16.464s, 17.469s and 16.363s. Because this managed lane prohibits new worktrees and branch switching, this is a main-source-equivalent Go-overlay control, not a separate main checkout. All 334 two-point differing paths, including additions/deletions and generated Go, are covered and Git-blob verified. All 5,502 repository compiler/source/embed/native inputs selected with race and tags match exact-main blobs; source-manifest SHA-256a3a40315843523d9bc9404b73650bf54675af36f857b869bb2ba966936b9cfae. Modules, tracked native sources, Makefile and wrapper are identical; 45 actual native input/artifact hashes remain unchanged. The three tested source files are unchanged. Newer main fixture code is included in its overlay.Both sides used the repository wrapper with identical flags:
Each command ran three times. The common test-only overlay adds a TestMain that closes the shared fixture after
m.Run, preserves failures and fails on cleanup errors. It changes no production source, assertion, timeout, retry or skip. All six logs contain final service-close, admission-release and port-lease-release receipts. Normal Go tests consume generated parser/protobuf Go (included), not the differing grammar/proto sources; other non-Go changes are tooling, documentation and distributed test assets, not these inline SQL/generated TOML fixture inputs.Local controls use Go 1.27.1 Darwin/arm64 with verified platform-native CGo libraries. They establish non-reproduction on both revisions, not Linux/full-suite stability, equivalent CI fixture history/load, a pre-existing defect, or a proven runner/storage cause. Independent gpt-6-astra medium evidence review passed. This is the fresh four-check non-PR flaky-candidate path, not the known-open-defect shortcut.
After recording all three signatures on their existing tracking issues, request exactly one failed-jobs rerun of run 38857263820 and verify the next attempt is accepted. A repeated signature requires renewed attribution. No unrelated code or test contract is changed.
fix: acknowledge ISCP drain before executor runtime starts (#31167)
jiangxinmeng1 commentedon Oct 26, 2026
fixed by #31167
fix(iscp): preserve fresh init jobs and shorten embedded test waits (#…
Ariznawlll commentedon Oct 26, 2026
测试版本
main28e8760905a7f39dba2ce436357ea75492f30512,隔离 worktree 的 Go 测试从该源码编译运行。b466f4ae9b74813a4ff93eaf43a6c81e6cbb8b0b已确认在该 main 祖先链上。原问题验证
TestIssue29699DropImmediatelyAfterAsyncIndexCreate在当前 main 使用-race -count=10通过。每轮新建双 CN 集群,在 CN1 创建索引、等待另一 CN 追上提交水位后,CN2 立即执行四种合法删除:FULLTEXT2DROP INDEX、FULLTEXT2ALTER TABLE DROP INDEX、IVFFLATDROP TABLE、HNSWDROP DATABASE。合计 40 个子场景均未再返回原问题的ISCP executor ... did not become ready within 10s错误。Happy Path 覆盖
DROP TABLE和 HNSWDROP DATABASE均成功完成,并在每轮测试清理中关闭新建集群;10/10 轮。Unhappy Path 覆盖
-race -count=10通过。-race -count=10通过。-race -count=10通过。TestDropAccountDuringAsyncIndexInit失败;本轮在同一最新 main 上单独用-race -count=3重跑该实际双 CN/账户清理集成路径,3/3 通过。该本地结果不冒称旧 CI 已变绿。白盒验证
上述四个
Test_service_handleISCPDrainConsumer*handler 根各运行 10 次 race;原始双 CN SQL 集成根运行 10 次 race,额外账户/异步初始化根运行 3 次 race。生产就绪阈值未改;handler 单测自身使用缩短的等待来确定性制造时序,不能把它当成部署态等待验证。测试保留原断言与异常边界。回归测试
TestCrossTargetUpgradeRecovery。本轮仅做了本机定向 race 复核,没有重跑整条 Linux CI,也不声称旧 CI 全绿。测试证据
修复 PR 中可定位的集成/handler 测试是可复跑证据;本轮命令在隔离 worktree 以
-race -count=10和-race -count=3退出 0。原 issue 正文保留修复前的 5/8、6/6、2/3 等概率性失败记录;本轮每次重建双 CN 集群而不是仅在一个已热身服务上循环 SQL。测试结论
测试通过。