Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main (upgrade from released 4.1 and 4.2 deployments)
Commit ID
Target examined: 7e0c9d94fce444a2930c335135a3fc5860e1fe6a; 4.2-dev examined: 86a45d39df3d1f23490fcdd7328b46c5520efada.
Other Environment Information
- Local reproduction: macOS arm64, single CN, stopped upgrade from MatrixOne v4.2.6.
- Source catalog:
4.0.6, offset5.
Actual Behavior
main's catalog upgrade handlers have grown through 4.0.17 while 4.2-dev's latest handler is 4.0.6. Some migrations were subsequently appended to main's 4.0.6 handler. A cluster already at 4.0.6 does not execute that handler when upgrading to a later version, so these effects can be skipped even when the upgrade reports completion.
In the local v4.2.6 to main reproduction, upgrade reached 4.0.17 and existing rows, FK enforcement, an existing SQL function, historical snapshot reads and account snapshot restore worked. However, mo_catalog.mo_user_defined_function lacked arg_types; creating a new SQL function failed with column arg_types does not exist. mo_catalog.mo_foreign_keys also lacked referenced_index_name; the full functional impact of that missing column is not yet established.
Expected Behavior
Consolidate main's catalog upgrade relative to the published 4.1/4.2 boundary so that the final catalog version is 4.0.7, greater than 4.2-dev's 4.0.6. A stopped 4.1 or 4.2 deployment must reach the complete current catalog and preserve its user data, metadata, snapshots and behavior. New installations must initialize consistently with upgraded installations.
Audit every required effect added after the released catalog state, including changes appended to already-consumed handlers and the intermediate 4.0.7–4.0.17 handlers. Incorporate necessary cluster and tenant migrations, backfills and current view definitions in dependency order; eliminate superseded intermediate handlers and redundant migration paths. Keep published version identities and retry/recovery ownership coherent. Avoid adding special cases for this reproduction.
Scope: stopped upgrades from 4.1 and 4.2. Direct 3.x upgrades and clusters that ran unpublished main intermediate catalogs are out of scope. Existing older snapshots may nevertheless be present: when snapshot ownership cannot be established reliably, stop and request administrator confirmation by snapshot UUID instead of guessing.
Steps to Reproduce
- Start released v4.2.6 on a clean data directory; create a database with indexed parent/child tables and a foreign key, a SQL function, and account snapshots. Verify rows, the function, and snapshot contents.
- Stop all services and retain a copy of the 4.2.6 data directory.
- Start main at the target commit on the same data and wait for catalog upgrade to finish.
- Inspect
mo_catalog.mo_user_defined_functionandmo_catalog.mo_foreign_keysviainformation_schema.columns. Create another SQL function. - Observe the recorded
4.0.17ready state but missing columns and the SQL function creation error above.
Additional information
Acceptance criteria:
- Verify real 4.1 and 4.2.6 stopped upgrades to the consolidated
4.0.7on current main; also compare fresh initialization with upgraded catalog schema. - Verify both existing and newly created functions, FK metadata and enforcement, indexes, tenant and cluster catalogs, views, CDC metadata and user data.
- Verify existing user and branch snapshots, historical reads and account restore; ambiguous inherited snapshot ownership must follow explicit UUID-based administrator confirmation.
- Exercise restart/retry after interrupted migration and representative failure paths, including tenant/cluster progress, without silently skipping work or exposing an incomplete catalog.
- Cover large catalogs and resource bounds, relevant concurrency and multi-CN behavior, and avoid regressions in normal startup; include meaningful targeted tests and document operational constraints.
- Ensure clean migration ownership and ordering. Do not retain 4.0.8–4.0.17 solely as compatibility paths for unpublished intermediate main versions.
The local WIP 6818c728ae1e is unreviewed and not pushed; it is not evidence that the fix is complete.
Activity
fix: consolidate safe 4.1 and 4.2 catalog upgrades into 4.0.7 (#31497)
XuPeng-SH commentedon Oct 28, 2026
QA status for merged main
23488e1eb2c50f4d3638dee1d50715bbc1eb1f67(#31497): this environment has not run a current-head service or the catalog upgrade tests. Resource headroom under the existing guard is insufficient for a safe large link and isolated upgrade deployment. The PR's reported stopped 4.1/4.2 upgrade and restart runs are author evidence, not tests performed here.Fresh initialization, stopped old-version data upgrade, interruption/retry, historical snapshot/PITR behavior and multi-tenant same-directory recovery remain unverified locally. Current-format data must not be handed back to the old binary; preserve the pre-upgrade backup for any rollback. Handing off to QA for acceptance.
Ariznawlll commentedon Oct 28, 2026
结论
测试不通过。实际停止升级和原始缺列场景已通过,但 4.1.4 升级后的
mo_catalog.mo_indexes与同一 main 全新初始化的目录仍有可观察的列差异,未满足本 issue 对完整当前目录以及升级前后目录比较的验收要求。当前尚未证明普通索引功能损坏;请研发确认这个差异是否为明确允许的分阶段兼容行为。关键证据
ea47345ff8db8a2234f029b06bd1cdee0d6fc8bf在测试时官方 main9e29011e7313a57962adc00963baa659d1e81e37祖先链;实测新服务git_version()为9e29011e73。旧服务分别为真实 v4.1.4 taga185c23b375956afe098320baf8df39000a43936、v4.2.6 tag71498157cc21f833b8e717f45d50d1f926be3134。环境为 macOS arm64 隔离单 CN/TN/Log;旧版本各构造一套持久化数据并停止,再各复制三份独立执行升级,不等同三套独立部署。旧版构建复用了本机已有 native 库,未声称官方发布镜像验证。mo_user_defined_function.arg_types和mo_foreign_keys.referenced_index_name均存在,旧/新 SQL UDF 返回 5/6,父子数据保持;非法外键插入 1452、数据不变;数据库旧快照读到 11、当前读到 12;独立租户账号快照可从当前 200 恢复至 100,分别 3/3。4.1 升级启动阶段曾有锁冲突自动重试,随后三个副本均完成。information_schema.columns中 sys 租户mo_catalog的表名、列名、类型、nullable、序号:同 SHA 全新初始化 682 列,4.2.6 升级后 682 列且两集合相同;4.1.4 升级后 681 列,唯一差异为全新库存在mo_indexes.included_columns(text,nullable,ordinal 16),4.1 升级库不存在。三个 4.1 升级副本重启复核均查不到该列,直接执行SELECT included_columns FROM mo_catalog.mo_indexes LIMIT 1均报 1054column included_columns does not exist,3/3。pkg/bootstrap/versions/v4_0_0/upgrade_test.go的TestUpgradeDefersMoIndexesIncludeColumn提到目录变更需待写入方显式列清单后分阶段发布;这可能解释为什么未迁移,但不足以单独证明上述 4.1 升级差异符合本 issue 的交付契约。待解决点
请 @XuPeng-SH 确认 4.1 升级库缺少
included_columns是否为有意且受支持的例外、该列的查询及相关功能契约,以及本 issue 的新旧目录一致性验收应如何处理;若要求完整一致,请补充迁移后再复验。中断、规模和多 CN 场景仍待覆盖。