Repository navigation
Description
Summary
After an interrupted in-place upgrade from 4.2-dev to current main, restarting with the same data directory can leave the CN SQL endpoint listening but not usable. The startup admission check repeatedly queries for mo_catalog.mo_view_refresh, gets no such table, and client handshakes time out. Recreating the data directory avoids the symptom.
This is a distinct observed failure mode from the missing-mo_view_dependencies startup panic described in #28004 and tracked with the broader upgrade failure in #27967. A common root cause is possible but has not been established; this issue records the missing-mo_view_refresh retry/stall case so it can be reproduced and checked independently.
Environment
- MatrixOne current main:
9c6fcb5b501d040ab1bcb5ada139939770468638 - Linux, one LOG + one TN + one CN
- Existing 4.2-dev data directory, reused in place for the upgrade
Reproduction
- Start a 4.2-dev cluster with one LOG, one TN, and one CN. Wait until SQL is ready, then stop the cluster.
- Keep the same data directory and start the cluster with a current-main binary. Do not initialize or replace the directory.
- Interrupt this main startup while the v4.0.6 cluster-catalog upgrade is incomplete. To target the observed window, watch the CN log and terminate the bootstrap/CN process immediately after the first
no such table mo_catalog.mo_view_refresherror and before the correspondingcreate cluster table mo_catalog.mo_view_refresh/ successful-bootstrap log. Preserve the directory as-is. - Start current main again with the same configuration and exact same data directory.
- Attempt a SQL connection to the configured CN port (for example,
mysql --connect-timeout=10 -h127.0.0.1 -P6001 -u<user> -p<password> -e 'select 1').
The interruption is important: the symptom is on retrying the partially upgraded directory, not on a clean bootstrap. In the captured run, the upgrade had started but had not created mo_view_refresh; preserving that directory and starting main again reproduced the retry loop. The retained data directory is about 1.6 GB, so a fixture or failpoint would make this reproduction easier to run deterministically.
Actual result
The retry log reports mo already bootstrapped, then start bootstrap upgrade and an upgrade target of 4.0.8. The CN starts listening on port 6001, but the view-metadata admission check repeatedly executes a query against mo_catalog.mo_tables for mo_view_refresh and logs:
no such table mo_catalog.mo_view_refresh
The SQL client handshake times out, and restarting with the same directory repeats the failure. No CN panic was observed in this run.
Expected result
Retrying the upgrade should converge idempotently: create/repair the required cluster catalog tables and admit SQL connections, or fail startup visibly instead of leaving a listening endpoint whose SQL handshakes time out.
Control and evidence
A fresh data directory on the same main binary created mo_catalog.mo_view_refresh, logged successful bootstrap, and became SQL-ready. The retry behavior was captured on the preserved interrupted-upgrade directory in two startup logs. The relevant log excerpts and data directory are retained in the QA environment; the service logs show mo already bootstrapped, start bootstrap upgrade, then repeated missing-table errors.
Activity
fix(cnservice): preserve bootstrap ownership through admission handoff (
slyunnn commentedon Sep 29, 2026
Regression and extended verification for #29396 (2026-09-29)
Verification Environment
origin/mainatd8152cb08d7e73316034c33aaf0e7bc01c176f91—docs: approve the on-demand View metadata contract (#29456).mainand commitd8152cb08d; services were restarted from that image before validation.2 CN / 1 TN / 1 Log service / Proxy. The MySQL text protocol was used through Proxy6001, CN116001, and CN216002; each endpoint was reachable and observed both view-metadata catalog tables.1 Log / 1 TN / 1 CNcluster with a fresh data directory initialized by historical4.2-devsource1a44f3db3056e32975fde86ca0ab69a094996a3f, then retried with the actuald8152cb08dmain image on a dedicated local port. The historical source had nomo_view_*catalog tables before the upgrade.3fe37b311df718eb7b369513cd6d615b10b04092—fix(cnservice): preserve bootstrap ownership through admission handoff (#29450). It is contained in the verifiedmaincommit. Related test-only PR test(bootstrap): cover interrupted view metadata upgrade recovery #29435 was closed without merge and was not treated as main coverage.What Was Covered
v4.0.8recovery handler reached entry1and was terminated immediately before entry2, themo_view_refreshcreation operation. This is the compatibility repair path because4.2already recordsv4.0.6while lacking these tables.d8152cb08dmain image.mo_catalog.mo_view_dependenciesandmo_catalog.mo_view_refreshboth existed; the preserved old user row andSELECT 1succeeded. CN logs contained nono such table,panic, orfatalmatch during the retry window.4.2-devto main upgrade completed with both catalog tables present and preserved user data readable.TestCNViewMetadataAdmissionCancelledOwnerCannotPublishIngresspassed under-race -count=100; a cancelled bootstrap owner cannot publish ingress while completion is unresolved.TestCNViewMetadataAdmissionOwnerAfterCatalogCommitandTestCNViewMetadataAdmissionDiscoveryRemainsBoundedpassed under-race -count=100, covering catalog visibility after commit and the bounded discovery deadline.6001, CN116001, and CN216002each returned2matching entries formo_view_dependenciesandmo_view_refreshvia the MySQL text protocol.1.6 GB, multi-CN interruption during upgrade, and client protocols other than the MySQL text protocol. The isolated reproduction used the minimum stable old-version data needed to exercise the persisted upgrade state.Findings
The issue is fixed in
main. The controlled interruption beforemo_view_refreshleft a retryable persisted upgrade state, and the next start with the verified main binary converged the catalog and admitted SQL successfully. The #29450 ownership handoff fix prevents a cancelled or expired bootstrap owner from publishing ingress while catalog repair is still resolving.Large-data regression is not required. The defect is a bootstrap/admission and catalog-state recovery path; its relevant boundary is the interrupted metadata operation, not row count, block/batch boundaries, spill, skew, network transfer volume, or concurrency scale. Increasing data volume would add unrelated CI cost without increasing coverage of that state transition.
MOTR / BVT Coverage
No MOTR change, branch, recording, replay, or commit was needed. Existing current-main core coverage directly exercises the affected behavior:
pkg/tests/upgrade/TestV406UpgradeCreatesViewMetadataCatalogTablespassed, including missing-table combinations, injectedmo_view_refreshfailure, rollback, and retry.pkg/cnservice/TestCNViewMetadataAdmissionOwnerAfterCatalogCommit,TestCNViewMetadataAdmissionDiscoveryRemainsBounded, andTestCNViewMetadataAdmissionCancelledOwnerCannotPublishIngresspassed; each was also run with-race -count=100.Final Conclusion
Fixed. The original cross-version interrupted-upgrade state was reproduced in an isolated real runtime, retried using the verified latestmainbinary, and converged without the reported catalog error or stalled client admission. No large-data regression is needed for the reasons above.