Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Searches for owner_generation upgrade, pending_source_table_id upgrade, and mo_cdc_watermark 4.2.5 in this repository returned no matching issues on 2026-10-14.
Branch Name
main, upgrading an official v4.2.5 store
Commit ID
Target actually built and executed: b1a6da4e16d87d64ab922b3acb537cd851b3f5c3.
Source official release: 1a44f3db3056e32975fde86ca0ab69a094996a3f (v4.2.5).
Other Environment Information
- Ubuntu 24.04.3 LTS, Linux x86_64; local single-process
mo-service -launchwith one LogService, TN, and CN. - Container memory limit 8 GiB, CPU quota 8 cores; server
GOMAXPROCS=4,GOMEMLIMIT=6GiB. - Official release archive SHA256:
a0e0aad81a914d6cd7081f68bbfb7695cba20544ca4c8f37358f4005067b8da1. - Official release executable SHA256:
5d136df6fab5e7a5bdf4ba3e678470d898c8d681f3fdae99095ecd9c4205d2ed. - Target executable SHA256:
6f7170a28a706a38d415b1bc49d1721b540a35634d94c8e62a24945ac220e7a4; built using the officialbuild-with-prebuilt-nativetarget. Production source files were not modified. - Each repetition starts with a new, nonexistent data directory under the official release. No CDC task, fault injection, column alteration, or downgrade is involved.
Actual Behavior
A freshly initialized official v4.2.5 database with one user table and one row cannot become SQL-ready after a clean stop and one-way upgrade to the tested main. The main catalog upgrade repeatedly executes:
alter table mo_catalog.mo_cdc_watermark
add column pending_source_table_id bigint unsigned null after owner_generation;It fails with Unknown column 'owner_generation' in 'Columns Set'. Authentication remains blocked by tenant-upgrade checks, and clients receive read timeouts instead of completing SELECT VERSION(), git_version() or reading the persisted row.
Two independent fresh-store repetitions reproduced this on main b1a6da4:
| Repetition | Release SQL ready | Release clean exit | Main observation | Authenticated SQL ready | Missing-column errors |
|---|---|---|---|---|---|
| 0 | 15.235 s | 0 | 77.235 s | No | 27 |
| 1 | 16.195 s | 0 | 76.331 s | No | 27 |
The target processes were stopped by the harness with SIGINT after the bounded failed-readiness observation; their eventual exit code 0 is not upgrade success. Observations do not establish an infinite hang.
Before upgrade, actual v4.2.5 SQL returned 8.0.30-MatrixOne-v4.2.5, git version 1a44f3d, catalog version 4.0.6, offset 5, state 2. Its mo_cdc_watermark columns were:
account_id, task_id, db_name, table_name, watermark, err_msg, __mo_cpkey_col
Neither source_table_id nor owner_generation exists. The single business row (1,42) was verified before the release clean stop.
Expected Behavior
A supported forward upgrade should apply every catalog prerequisite required by later migration entries, finish authentication, and preserve the row. No manual CDC catalog surgery should be needed for a fresh official release database that has never used CDC.
Steps to Reproduce
-
Obtain the official
mo-v4.2.5-linux-x86_64package and initialize a fresh directory using local LogService/TN/CN launch configuration. Ensure all data, WAL, raft, and object-store paths point into this new directory; do not reuse any main-opened store. Launch the official release executable:/path/to/mo-v4.2.5-linux-x86_64/mo-service -launch /absolute/path/to/launch.toml
-
Wait for SQL login, then execute:
SELECT VERSION(), git_version(); CREATE DATABASE upgrade_min; CREATE TABLE upgrade_min.t(id BIGINT PRIMARY KEY, n INT); INSERT INTO upgrade_min.t VALUES (1,42); SELECT * FROM upgrade_min.t; SHOW CREATE TABLE mo_catalog.mo_cdc_watermark; SELECT * FROM mo_catalog.mo_version;
-
Send SIGINT to this release process and wait for exit 0. Keep the complete store and launch configuration. No release process may still be using it.
-
Build main at the target SHA above and launch that executable using the same configuration and store, with its matching native libraries. This is the first main opening of the directory.
-
Attempt SQL login and the version/row checks for at least 75 seconds. Observe the missing-column migration errors and authentication timeouts in
main-server.log. Stop main after recording the failure. Do not open this now main-owned directory with v4.2.5. -
Repeat from step 1 in a second completely fresh directory. Both executions above followed this procedure.
Additional information
Actual target log excerpt:
execute upgrade entry sql error
error: Unknown column 'owner_generation' in 'Columns Set'
UpgradeEntry type:0 schema: mo_catalog.mo_cdc_watermark,
upgrade sql: alter table mo_catalog.mo_cdc_watermark add column pending_source_table_id bigint unsigned null after owner_generation
failed to handle version upgrade: 4th: 4.0.10 -> 4.0.11, state 0, final 4.0.14
authenticate user failed: context deadline exceeded
internal error: checkTenantUpgrade
Source localization, not a proven complete root cause: pkg/bootstrap/versions/v4_0_6/cluster_upgrade_list.go registers the prerequisite source_table_id and owner_generation additions; pkg/bootstrap/versions/v4_0_11/cluster_upgrade_list.go adds pending_source_table_id AFTER owner_generation. The tested release catalog is missing both prerequisites, while main demonstrably reaches the later entry. The version/protocol selection that skips those prerequisites still needs investigation.
A larger healthy release store also failed upgrading to earlier main a33dcfb2e54196e17abe21de4346200a18009d83 with this same specific missing-column error, but the fresh one-row b1a6da4 reproductions are the primary evidence. Separate historical recovery failures with LogService/TN readiness timeouts are not being attributed to this CDC migration error.
Full reproducer minimal_upgrade.py, both configurations, build provenance, SQL receipts, server logs, and post-main stores are preserved in the campaign evidence. Both fresh stores are permanently marked main-owned, including these failed starts; no main-to-release execution was performed.
Activity
XuPeng-SH commentedon Oct 15, 2026
Reproduced twice again on latest main
17a6200f59e764729e5544908fffd5480ae88279on 2026-10-15 (Asia/Shanghai). The opening and closing GitHub main tip matched this SHA. Actual target binary SHA256:778bf2982bd0e5a7637d8dddfb2d2e60d5dfd82d09154d11a1d95dfb9147e9f0; unchanged production sources, same verified binary also SQL-version-checked in separate healthy main fixtures.Each independent minimal fixture was first initialized by official v4.2.5 (
1a44f3d), containing onlyupgrade_min.t(1,42). Both then passed an actual same-v4.2.5 normal restart and row verification before upgrading:For each, the complete stopped release source was hash-verified and copied into a separate, permanently main-owned target. No original release store was opened by main; no target was opened by release afterward. The downgrade guard was checked without launching a release process. Source manifests stayed unchanged.
Both main targets failed authenticated SQL readiness, with 36 occurrences each of:
Actual bounded observations were 92.106381 s and 91.093306 s (the 90 s deadline includes a bounded connection-attempt overshoot). Both were then stopped by the harness with SIGINT and exit 0; that is cleanup, not successful upgrade.
Before upgrade, both release catalogs reported version
4.0.6, offset 5, state 2;mo_cdc_watermarkhad neithersource_table_idnorowner_generation. There was no CDC task, fault injection, manual catalog alteration, or downgrade. This confirms the same prerequisite-column upgrade failure on current tested main, but does not add a proven explanation of why prerequisite migration selection is skipped. Exact configurations, byte manifests, SQL receipts and both post-main stores are retained in the campaign evidence.XuPeng-SH commentedon Oct 15, 2026
Further localization of the skipped prerequisites on main
17a6200f59e764729e5544908fffd5480ae88279:This is analysis of the two real clean-release forward-upgrade executions in the preceding comment, not two additional SQL executions or a patched-build validation.
The actual selected route is now extracted from both server logs:
4.0.6 -> 4.0.7 -> 4.0.8 -> 4.0.9 -> 4.0.10 -> 4.0.11 -> ... -> 4.0.14.Both log the starting catalog as
4.0.6, offset5. The route contains no same-version4.0.6 -> 4.0.6step. Neither log contains execution of theADD COLUMN source_table_idorADD COLUMN owner_generationprerequisite SQL. Each contains 12execute upgrade entry sql errorevents for the later missing-owner failure (36 matching missing-column log occurrences when all reporting layers are counted).The source explains this selection:
service_upgrade.goloads the latest ready version string and queues only handlers withCompare(v.Metadata().Version, from) > 0when constructing the route to a newer final version. An already-ready4.0.6release therefore starts with the4.0.7handler, even though main has appended more entries to its4.0.6handler.v4_0_6/cluster_upgrade_list.goregistersaddCdcWatermarkSourceTableIDandaddCdcWatermarkOwnerGenerationonly in that skipped handler. Their protocol-48 gate cannot help a step that was not queued.v4_0_11/cluster_upgrade_list.gothen addspending_source_table_id ... AFTER owner_generation, exactly where both actual runs fail.This localizes the standard-route prerequisite omission; it is not evidence that a proposed fix has been tested. The existing
v4_0_7/upgrade.gocomment already documents the same strict-newer-handler constraint for another migration. A repair should put the idempotent prerequisites in a reachable newer migration path while preserving mixed-version writer/protocol safety. Rewindingmo_version, downgrading main-opened storage, or asking users to edit CDC catalog columns is not a validated workaround.No production source, catalog, or preserved database bytes were modified for this analysis. The separate historical LogService recovery/EOF findings remain unrelated.
test(bootstrap): preallocate upgrade-list name slice for SCA (matrixo…
fix(bootstrap): recheck CDC watermark prerequisites in the 4.0.11 upg…
Ariznawlll commentedon Oct 26, 2026
测试版本
mainf4450f23b8d5347678936b81515bdc04b21c6a08;本地二进制go version -m的vcs.revision与之相同,SHA25648e8521786124436a569ecd86074b5e65c22b20a10bb1cfdd62f1934a65d30ed,受隔离目录中的未跟踪 QA 文件影响vcs.modified=true,已核对受跟踪源文件无修改。e9590abbf4305469233c5bdee8c83eabb72a2124经补齐浅克隆历史后确认是上述mainSHA 的祖先。v4.2.5tag 源码1a44f3db3056e32975fde86ca0ab69a094996a3f,原生构建;固定的 ONNX 原生依赖经 SHA25630afadcfc3c704f7671f8430d6252956651c1972373901d2be629da2e6a4d8ee校验,旧版二进制 SHA2562d2aae938d072b1586b17bc1bf681b58943036d71e98ddd36237ef4f240f1574。mo-service -launch,1 LogService / 1 TN / 1 CN,SQL 端口 48001;每次从未被 main 打开过的旧版种子目录复制完整数据,独立升级,保留各次结果。未使用共享 TKE、128/129 或昂贵 CI。原问题验证
旧版实际目录为
mo_version=('4.0.6',5,2),mo_cdc_watermark缺少source_table_id、owner_generation,用户表qa30215.t有原行(1,42)。先在同一旧版完成一次正常重启、重新登录与原行读取,随后干净退出;保留旧版种子不动。将三份独立副本分别交由当前main首次打开。3/3 均走完目录迁移并达到('4.0.17',1,2),SQL 登录可用;未出现原问题中的Unknown column 'owner_generation'阻断。每次服务均正常停止,退出码 0。升级启动阶段目录尚未完成时的短暂 SQL 超时不计作就绪;仅在最终state=2后执行验收 SQL。Happy Path 覆盖
(1,42)保持不变。main的三份独立升级:3/3 完成登录,目录4.0.17/offset=1/state=2;历史4.0.6/offset=5/state=2保留。SHOW COLUMNS FROM mo_catalog.mo_cdc_watermark均包含source_table_id、owner_generation、pending_source_table_id、target_identity;原业务行均为(1,42)。Unhappy Path 覆盖
source_table_id和owner_generation;当前修复会幂等补齐,不再因pending_source_table_id AFTER owner_generation中断。BEGIN; UPDATE ... SET v=43;,事务内实读为 43,再ROLLBACK,事务外实读仍为(1,42),3/3。未对系统目录手工补列、回退版本号或做降级打开。白盒验证
在同一
mainSHA 上执行go test ./pkg/bootstrap ./pkg/bootstrap/versions/v4_0_11 -run 'TestDoCheckUpgradeRetainsHistoricalCDCWatermarkTarget|TestCDCWatermarkUpgradeAdmission|TestCDCWatermarkColumnsUpgradeMetadata' -count=3,两个包均通过。这里验证历史版本目标保留、缺列迁移的准入及列元数据;不以单元测试代替上述实际跨版本启动。回归测试
service_upgrade_recovery_test.go与v4_0_11/upgrade_test.go的定向回归。跨版本系统目录迁移需要两版二进制和持久化旧版目录,无法由静态公共 SQL 单独表达;因此本次未向 MOTR temporary table can be visible in show tables and other sessions #278 添加无效的 SQL golden,也未新提 MO PR。测试证据
go version -m记录及git merge-base --is-ancestor检查结果;三次各自保留的隔离数据目录为/private/tmp/mo-six-qa-20261026/qa-30215/native/run4-data、run5-data、run6-data,旧版只读种子为同目录seed-data。catalog_versions=(('4.0.6',5,2),('4.0.17',1,2));CDC 列包括四个新增列;preserved_row=(1,42), transactional_write_rollback=ok。定向 Go 测试两个包均ok。测试结论
测试通过。