Repository navigation
Description
Description
After an interrupted 4.2-dev to main catalog upgrade, retrying current main against the same persisted directory can panic before the v4.0.6 View-metadata catalog migration completes. This is a retry-convergence failure, distinct from the initial generic catalog-DDL hook tracked in #27967.
Environment
- Branch:
main - Commit:
804976d2ed85c15790b710db1141e06066284327 - Baseline:
4.2-dev @ b2a873419200b3685fe4dd89401857440a0e145c - Deployment: local standalone
1 LogService + 1 TN + 1 CN; services were stopped between version switches and reused the same persistent data directory.
Steps to reproduce
- Start 4.2-dev and create ordinary user tables (the fixture included both a single-column and a composite foreign key).
- Stop 4.2-dev and start main using the same directory. Preserve the directory if this first main start exits while the v4.0.6 lifecycle catalog tables are still absent.
- Create three independent copy-on-write copies of that preserved directory.
- Start
main @ 804976d2once on each copy.
Actual behavior
All three current-main retries exit with code 2 in about six seconds:
panic: SQL parser error: table "mo_view_dependencies" does not exist
main.startCNService.func1
cmd/mo-service/main.go:362
Before each panic, the admission fence locks mo_view_refresh and invokes View metadata revalidation. mo_view_dependencies does not yet exist, so the asynchronous bootstrap-upgrade transaction is cancelled and the error propagates through CN Start to the process panic path.
Expected behavior
An upgrade attempt that stopped before the lifecycle catalog migration completed must converge on the next main startup, or fail without panicking and leave a retryable state. CN admission must not depend on mo_view_dependencies before the cluster migration has created it.
Stability and controls
- Retry reproducer on
main @ 804976d2:3/3panics, using three independent copies of the preserved failed-start directory. - Normal control: an independent 4.2-dev directory completed the same v4.0.6 chain; the target version row became
4.0.6:42:2, both lifecycle catalog tables existed, and the three task-metadata index definitions existed. - Data check on the completed control after current-main restart: historical rows and foreign-key catalog rows remained readable; cascade, SET NULL, and composite-key update semantics were preserved.
Evidence
The three process runs each returned exit code 2 with the stack above. The full latest-main reproduction detail is recorded in the related issue comment: #27967 (comment)
Code analysis
pkg/cnservice/server.go starts BootstrapUpgrade as an asynchronous stopper task. Before that task completes, waitForViewMetadataAdmission can enter fenceViewMetadataCatalog, which calls compile.RequireViewMetadataRevalidation. That revalidation accesses mo_view_dependencies; with the v4.0.6 catalog closure still incomplete, the error returns from CN Start and reaches the panic wrapper in cmd/mo-service/main.go.
Regression coverage
Add a process/embedded-upgrade regression that persists a pre-lifecycle failed-start state, restarts main, and verifies retry convergence for none/only-dependencies/only-refresh/both lifecycle-table states. This is lifecycle/process coverage, not a big-data or chaos case.
Related
- Related but different entry point: [Bug]: 4.2→main switch breaks catalog upgrade and rollback fails on unknown HAKeeper command #27967
- Previous focused fix: fix: unblock 4.2 View metadata catalog upgrade #27976
Activity
Ariznawlll commentedon Sep 2, 2026
Additional topology evidence on
804976d2ed85c15790b710db1141e06066284327:mainbinary caused each CN to reach the View metadata admission fence before the asynchronous upgrade could create the two v4.0.6 catalog tables. The second CN reached the path first; the first CN reached it about one second later.mo_catalog.mo_view_dependencieswas absent. The process terminated from the CN startup wrapper with the same panic recorded in the issue.This shows the failure is not specific to a single-CN topology. More CNs do not serialize the catalog closure ahead of admission; they independently encounter the pre-upgrade fence. The regression test should therefore exercise the real startup ordering with at least two CNs and a 4.2 catalog lacking both lifecycle tables, and assert that the catalog closure finishes before either CN becomes admitted.
Ariznawlll commentedon Sep 2, 2026
最新 main 复验补充:
f4214a008c29c1aa9ca3a0ec84138296dde613584.2-dev,1 Log + 1 TN + 1 CN;数据目录来自一次已中断的前向升级,mo_view_dependencies与mo_view_refresh均尚未创建。SQL parser error: table "mo_view_dependencies" does not exist,调用栈入口为main.startCNService.func1。804976d2ed85c15790b710db1141e06066284327,pkg/cnservice、pkg/hakeeper、pkg/logservice、pkg/bootstrap以及pkg/sql/compile/view_metadata_recovery.go在两者之间无差异。因此该问题在当前最新 main 仍可稳定复现;问题范围仍是“中断后的升级重试未收敛”,不是新的多 CN 独立问题。
Ariznawlll commentedon Sep 2, 2026
已将该 issue 的中断后重试 3/3 复现、双 CN 拓扑证据和回归范围完整同步至 #27967。该现象属于 #27967 的同一 4.2-dev → main catalog 升级时序问题,后续请在 #27967 统一跟踪。
XuPeng-SH commentedon Sep 27, 2026
QA follow-up on current main
9c6fcb5b501d040ab1bcb5ada139939770468638.A second retry shape in the same upgrade-recovery family was observed: after a bootstrap attempt is interrupted before
mo_catalog.mo_view_refreshis created, restarting main logsmo already bootstrapped, then repeatedly queriesmo_tablesformo_view_refreshand receivesno such table mo_catalog.mo_view_refresh. The CN remains listening but SQL handshakes time out and shutdown stays incndrain; no panic was observed in this run.Evidence retained locally:
/home/xupeng/mo-validation/main-qa/logs/matrix-followup-service.log/home/xupeng/mo-validation/main-qa/mo-data-reuse-hang-20260927T014303ZControl: a fresh directory on the same binary creates
mo_view_refreshduring bootstrap and remains SQL-ready while the vector/fulltext extension matrix runs (12 rounds, 11 scenarios each, all pass). This looks like the interrupted bootstrap retry-convergence boundary already covered by this issue/#27967, rather than a new independent query defect. The missing-table/no-panic variant may be useful for the retry matrix.