Repository navigation
Description
Summary
A table-level CDC task created with NoFull=true can skip source changes committed immediately after CREATE CDC returns, while the task remains running with no error. The same behavior is reproducible on the current main and on PR #27939; this issue is reported as a pre-existing CDC capture-window gap, not as a regression introduced by #27939.
Environment
- MatrixOne commit:
9add8e46c19b40a1a6488ba5d2969d0b380e2083(PR fix(cdc): accelerate bounded initial snapshots #27939 latest head) - Control code path: current
mainhas the sameNoFullstartup watermark initialization - Host: MatrixOne test machine
10.222.1.55 - Deployment: single-process quickstart, MySQL frontend
127.0.0.1:6001
Reproduction
-
Create matching source and target tables and the required source PITR.
-
Create a table-level task:
CREATE CDC life55 'mysql://sys#root:[email protected]:6001' 'mysql' 'mysql://sys#root:[email protected]:6001' 'bb27939_55.src:bb27939_55.dst' {'Level'='table','NoFull'='true','Frequency'='1m'} internal;
-
Immediately after
CREATE CDCreturns (within about 1 second), insert 1000 rows using a recursive CTE. -
Wait longer than one polling interval (75 seconds in the reproduction).
-
Query the target and task metadata.
Actual result
- Target row count remains
0. - Task state remains
running. err_msgremains empty.- The watermark advances/heartbeats, but the 1000 committed rows are not delivered.
The same task synchronizes rows inserted after the pipeline has initialized (the control insert reached the target after the next 1-minute poll), so this is a startup capture window rather than a general replication failure.
Expected result
For NoFull=true (documented as “skip initial snapshot, sync incremental changes only”), changes committed after successful CREATE CDC should not be silently omitted. The implementation should either:
- durably define the incremental start watermark as part of task creation and capture all later commits; or
- document and expose the actual activation boundary, with a state/acknowledgement that tells clients when writes are safe to rely on.
Root-cause direction
The asynchronous pipeline currently initializes the no-full watermark from txnOp.SnapshotTS() when addExecPipelineForTable starts. If a source commit lands after task creation but before that pipeline snapshot is taken, the commit is older than the newly installed watermark and is skipped.
Related / distinction
- [Bug]: CDC 大表首次全量同步长期等待 initial snapshot batch slot #27863 covers large initial-snapshot batch-slot starvation and is a different path.
- fix(cdc): accelerate bounded initial snapshots #27939 addresses snapshot scheduling and ownership fencing; it does not introduce this behavior.
Activity
fix(cdc): persist no-full creation watermark (#28506)
jiangxinmeng1 commentedon Oct 21, 2026
fixed by #28506
Ariznawlll commentedon Oct 21, 2026
测试版本
main838cc78aa1efe46693876a48c05c202979047b7ba61e7710e26c7d7613e2aa19913460ff9b7e2606;GitHub compare 证实该提交是上述 main 的祖先(ahead 535 / behind 0)。原问题验证
在每轮新建源表、目标表及 PITR 后,创建 table-level
NoFull=true、Frequency=1m的 CDC,CREATE CDC返回后立即一次写入 1000 行(id 2–1001,v=2×id),不等待异步管道启动;建任务前预置 id=1,随后再写入 id=1002 作已启动管道对照。每轮都检查全部(id,v)明细、行数、去重数、和值、上下界、任务状态及错误字段,结束时删除 CDC/PITR/库。COUNT(DISTINCT id)=1000、SUM(v)=1003000、MIN/MAX(id)=2/1001,两个 CN 读到相同的完整行集;预置 id=1 为 0 行。随后 id=1002/v=2004 到达,最终 1001 行,任务保持running且err_msg为空。running且错误为空。原报告 SQL 把同一个 MO 端口声明为
mysqlsink。直接照抄此不匹配的 sink 类型,在当前 main 上会因查询 MySQL 专有information_schema.INNODB_TABLES而使任务失败;这不能用来判断 NoFull 捕获窗口。为保持目标后端与类型一致,上述验证分别使用matrixone→MO 和mysql→真实 MySQL sink;除 sink 配置修正外,保留了报告的 table-level/NoFull/Frequency/立即 1000 行时序。没有声称原报告这条类型不匹配的字面 SQL 通过。Happy Path 覆盖
Unhappy Path 覆盖
NoFull错误地复制;目标行集没有额外行或错值。mysqlsink→MO 的不匹配配置导致目标元数据查询失败,未将其算作修复失败或成功;Go 回归还覆盖旧协议缺少无损起点时拒绝、过期读取不推进持久起点和任务重启/跨 CN 接管边界。白盒验证
pkg/tests/sqlintegration的TestCDCNoFullPublicLifecycle:-count=3PASS,覆盖公共 SQL 创建、立即写入、持久起点及 CN 关闭/重启。TestCDCNoFullPublicTakeoverLifecycle:-count=3PASS,覆盖跨 CN claim/takeover。pkg/cdc中 lossless start、协议边界、NoFull admission 生命周期、stale read 和 watermark tuple 定向测试:-count=3PASS。回归测试
现有主仓 Go 公共 SQL 生命周期和跨 CN 接管回归直接覆盖原始时序及内部持久化边界;按当前 QA 约定不重复新增较难稳定控制异步 admission 时点的 MOTR 用例。未运行完整 MOTR suite,也未新触发共享/昂贵 CI。修复 PR 当时的多 CN Compose、SCA、覆盖率等检查通过,但历史 TKE BVT、Ubuntu UT 与 CI Required 为 FAILURE;本次独立验收不将这些历史失败记为通过,也不声称已完成 TKE 集成验收。
测试证据
测试结论
测试通过。