Repository navigation
fix: consolidate safe 4.1 and 4.2 catalog upgrades into 4.0.7 - #31497
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 11ba7240c4ae1125d2adcd8a5b2c92223647a770
Assessment: request_changes
The consolidation and recovery ownership design is reasonable, and focused checks pass. Approval remains blocked by the explicit released-version upgrade validation requirement. This is a validation gap, not a demonstrated production defect.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
docs/design/20261028-catalog-upgrade-407.md:65: Accepting the consolidated 4.0.7 migrations without the required stopped-upgrade validation from released 4.1.0 and 4.2.6.
Impact: Compatibility with both persisted catalog layouts and equivalence to fresh initialization remain unverified. Issue #31490 demonstrates that reaching StateReady can still leave required columns absent. Provide or recover matching candidate results for both released-source upgrades, covering routines, FK/index behavior, user data, snapshots, supported historical restore and fresh-catalog equivalence. Existing qualifying runs can be reused; no committed proof artifact is required.
Evidence: Issue #31490 and this design line explicitly require these upgrades. evidence.json.local_validation is empty. The PR reports a 4.2-dev run at 86a45d3, but no 4.1.0 result or qualified released-source/fresh-catalog comparison. TestCrossTargetUpgradeRecovery creates catalogs with the current binary and substitutes version handlers (pkg/embed/upgrade_recovery_test.go:109-150). Its successful receipt, attempt-2/checks/1793158585020286346-3.json, establishes recovery behavior, not released-catalog compatibility.
Validation:
-
Verified the frozen head/base, unchanged tracked source, identical prior-attempt patch and native provenance with 193 matching input hashes. Receipt/log reconciliation is retained in attempt-2/validation-audit.json; audit receipt checks/1793159159961120107-3.json exited 0.
-
Reused exact-head bootstrap/version suites: 187 top-level passes, no failures or skips. attempt-1/bootstrap-tests.log matches checks/1793157817871347695-4.json and its retained command script.
-
Executed 24 additional top-level tests through the supplied isolated executor, covering two-CN recovery/restart, migration paging, allocator restore, restore preflight, startup cancellation, local execution and result-limit rollback. All passed. Receipts 1793158484831360266-3, 1793158585020286346-3, 1793158692449419573-3 and 1793158776886133385-3 are mapped to retained logs in validation-audit.json.
-
Read the complete frozen discussion and linked issue. discussion-assessment.json covers both informational items; no substantive prior findings or rebuttals exist. Frozen CI supplies no completed released-upgrade validation.
Limitations:
-
No released-binary upgrade was executed during this review. Current-binary recovery fixtures do not close that requirement.
-
Full implementation acceptance remains open beyond this material gate: exhaustive removed-test oracle reconciliation, larger-page concurrent/unknown-commit fault coverage and independently qualified race/static checks are incomplete.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: aa97850419faaac21332b2025294d9be31fe68c3
Assessment: approve
The four prior test regressions and counter-owner documentation concern are resolved. The author’s specific released-upgrade results supersede the earlier absence-of-results finding. Review of the follow-up and unchanged migration closures found no actionable unresolved defect.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Eight focused tests passed, including all four prior failures and historical SQL/template controls.
-
Five complete owning-package suites passed: 227 top-level tests, no failures or skips.
-
Verified native provenance against 193 inputs; isolation preflight, formatting, diff and source-cleanliness checks passed.
-
Reconciled all 10 nonempty discussion items and removed-test coverage. Receipts and logs are recorded in /home/xupeng/.local/state/mo-bot/jobs/551d00c97ed982ae5cac9ac7/attempt-1/validation-audit.json.
Limitations:
-
Released-binary upgrades, broad race/static checks and benchmarks remain attributed author evidence; they were not independently rerun here.
-
Local execution used Linux/amd64 with Go 1.27.1. Frozen required CI was still pending.
-
Documented CDC/Iceberg restore prerequisites and FK scan-cost limitations remain applicable.
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class).
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). Repair the license-eye SCA findings from CI run 40773355581: correct the Apache URL typo (LICENSE-2.2 -> LICENSE-2.0) in engine_orphan_gc.go and add the standard Matrix Origin header to pk_move_pin_charge_test.go, pk_move_rollback_index_test.go, and pk_move_shrink_boundary_test.go; license-eye -c .licenserc.yml header check on all four files is 4/4 valid.
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). Repair the license-eye SCA findings from CI run 40773355581: correct the Apache URL typo (LICENSE-2.2 -> LICENSE-2.0) in engine_orphan_gc.go and add the standard Matrix Origin header to pk_move_pin_charge_test.go, pk_move_rollback_index_test.go, and pk_move_shrink_boundary_test.go; license-eye -c .licenserc.yml header check on all four files is 4/4 valid. Repair the Makefile err-check SCA finding from CI run 40776611402: the gate rejects fmt.Errorf/errors.New text in non-test pkg code, and this branch's new pk-move files carried 25 fmt.Errorf sites and one errors.New sentinel. Convert them to moerr constructors; the three per-account reap wraps keep inner-error identity for the fail-atomic ErrorIs assertions through a typed dataBranchReapAccountError with Unwrap (message text unchanged). Also clear the fourteen golangci-lint findings the same job reaches once err-check passes: a govet nilness dead error branch in the logtailreplay change-handle Next method, three ineffassign writes (two pk-move link walk fixtures, one tombstone normalization-charge probe), two prealloc slice hints (reap rows, link table-def columns), an SA6001 non-pointer map-key copy in the link receiver, an SA9003 empty condition in the same-key replacement emission, and six unused symbols (pkMoveLinkID, pkMoveLinkTxnIDUnknown, the stage-stub commitTS field and isClosed method, the boundary fixture armWrites and writePaths helpers).
…T, and full generated-column expressions Consolidates the catalog metadata corrections for matrixorigin#30936, matrixorigin#30935 and matrixorigin#30937 and rebases the stored-view repair onto upstream's consolidated upgrade ladder (matrixorigin#31497). Defect corrections (unchanged in substance from the reviewed rounds): - information_schema.COLUMNS binds the label-aware metadata helpers: ENUM/SET character/octet lengths follow the declared labels (multibyte included) and leave numeric metadata SQL NULL for ENUM/SET, keeping ordinary types byte-stable. - STATISTICS.SUB_PART and SHOW INDEX Sub_part return the numeric prefix length from mo_indexes.algo_params (mo_index_sub_part) and actual SQL NULL for non-prefix indexes. - information_schema.COLUMNS.GENERATION_EXPRESSION returns the full expression; the varchar(500) view cast is removed. - Fresh publication (bootstrap init, CREATE ACCOUNT, subscriptions) serves the corrected identities unconditionally; historical snapshot readers keep recognizing their recorded definitions. Delivery vehicle, per approved design revision 12 (docs/design/20261026-declared-catalog-metadata-publication-and-repair.md, sha256 47ebfe15a45940221c3d2d5ad6955e11a5c89a1a909fa9d4e382e1ac9db0a599): - pkg/bootstrap/versions/v4_0_8 is the successor hop of the frozen 4.0.7 stage: two idempotent legs on the upstream shared builder (COLUMNS gate 109; prefix-aware STATISTICS gate 41), protocol floor 118, offset len(tenantUpgEntries), a plain per-entry HandleTenantUpgrade (no paging), no cluster entries; registered after v4_0_7.Handler. The revision-9 v4_0_18 carrier is deleted. - The four 4.0.7-literal admission guards in checkUpgrade are re-keyed onto the consolidated-line comparison and the registered frozen handle's identity (D11-1/D11-2): legacy CDC admission at route creation, recheck and recovery; the ready frozen-source validation; the interrupted offset-only route rejection - upstream's message texts, error types and pre-mutation ordering are unchanged. - The on-demand tenant walks continue past the paged 4.0.7 stage to the final version before caching completion (D12-1/D12-2): MaybeUpgradeTenant resumes the register walk in one bounded service-owned transaction after the stage commits, UpgradeOneTenant no longer terminates at the frozen branch for accounts already at 4.0.7, and both walks keep mo_account.create_version as the sole progress marker: a failure leaves the cache unset and resumes from the committed stamp. - Oracles: the admission suite (CDC admission/rejection at the successor registration including the recovery path and direct succession, frozen-source and offset-only rejections at both the pre-mutation check and recovery validation), and the continuation suite at the real v4_0_7 plus v4_0_8 registration (late-login convergence with second-login idempotence, manual chaining, manual upgrade from an already-stamped 4.0.7 account, successor failure/ retry without premature caching, and the no-successor-SQL-before- stage-completion ordering), plus the re-derived route/hop tests on the consolidated ladder.
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). Repair the license-eye SCA findings from CI run 40773355581: correct the Apache URL typo (LICENSE-2.2 -> LICENSE-2.0) in engine_orphan_gc.go and add the standard Matrix Origin header to pk_move_pin_charge_test.go, pk_move_rollback_index_test.go, and pk_move_shrink_boundary_test.go; license-eye -c .licenserc.yml header check on all four files is 4/4 valid. Repair the Makefile err-check SCA finding from CI run 40776611402: the gate rejects fmt.Errorf/errors.New text in non-test pkg code, and this branch's new pk-move files carried 25 fmt.Errorf sites and one errors.New sentinel. Convert them to moerr constructors; the three per-account reap wraps keep inner-error identity for the fail-atomic ErrorIs assertions through a typed dataBranchReapAccountError with Unwrap (message text unchanged). Also clear the fourteen golangci-lint findings the same job reaches once err-check passes: a govet nilness dead error branch in the logtailreplay change-handle Next method, three ineffassign writes (two pk-move link walk fixtures, one tombstone normalization-charge probe), two prealloc slice hints (reap rows, link table-def columns), an SA6001 non-pointer map-key copy in the link receiver, an SA9003 empty condition in the same-key replacement emission, and six unused symbols (pkMoveLinkID, pkMoveLinkTxnIDUnknown, the stage-stub commitTS field and isClosed method, the boundary fixture armWrites and writePaths helpers). Repair the molint checkrecover SCA finding from CI run 40788517465 (SCA Test on Linux/arm64): the analyzer admits recover() only inside its whitelisted functions, and the pk-move compaction wave collected worker panics through an explicit recover() in Transaction.compactDeletionOnObjsLocked (txn.go:3349). Move that collection onto the ants pool's PanicHandler in a new unexported runCompactWave helper: finishSlot runs exactly once per submitted slot and appends the abort BEFORE Done releases the parent wait on every completion path, and ants invokes the handler synchronously in the aborted worker's goroutine while it recovers the panic (v2.12.0 worker.go), so the r26 review F1 contract — a panicking or unsubmittable worker fails the boundary atomically before any provenance carry or object reclaim — keeps its error-before-release ordering and identical "compaction worker aborted/submit failed" messages without editing the external linter whitelist. The compaction slot type moves to package scope for the helper's signature. New txn_compact_wave_test.go pins the mechanism: worker panics are collected exactly once, mixed success/panic waves collect only the panics while slot-local errors stay on their slots, closed-pool submissions fail instead of hanging the boundary, and empty waves return cleanly; race battery, the r26 shadow-failure boundary suite, and the full pk-move boundary regression stay green, and the CI-pinned molint (go1.27.1 build) reports zero diagnostics on ./....
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). Repair the license-eye SCA findings from CI run 40773355581: correct the Apache URL typo (LICENSE-2.2 -> LICENSE-2.0) in engine_orphan_gc.go and add the standard Matrix Origin header to pk_move_pin_charge_test.go, pk_move_rollback_index_test.go, and pk_move_shrink_boundary_test.go; license-eye -c .licenserc.yml header check on all four files is 4/4 valid. Repair the Makefile err-check SCA finding from CI run 40776611402: the gate rejects fmt.Errorf/errors.New text in non-test pkg code, and this branch's new pk-move files carried 25 fmt.Errorf sites and one errors.New sentinel. Convert them to moerr constructors; the three per-account reap wraps keep inner-error identity for the fail-atomic ErrorIs assertions through a typed dataBranchReapAccountError with Unwrap (message text unchanged). Also clear the fourteen golangci-lint findings the same job reaches once err-check passes: a govet nilness dead error branch in the logtailreplay change-handle Next method, three ineffassign writes (two pk-move link walk fixtures, one tombstone normalization-charge probe), two prealloc slice hints (reap rows, link table-def columns), an SA6001 non-pointer map-key copy in the link receiver, an SA9003 empty condition in the same-key replacement emission, and six unused symbols (pkMoveLinkID, pkMoveLinkTxnIDUnknown, the stage-stub commitTS field and isClosed method, the boundary fixture armWrites and writePaths helpers). Repair the molint checkrecover SCA finding from CI run 40788517465 (SCA Test on Linux/arm64): the analyzer admits recover() only inside its whitelisted functions, and the pk-move compaction wave collected worker panics through an explicit recover() in Transaction.compactDeletionOnObjsLocked (txn.go:3349). Move that collection onto the ants pool's PanicHandler in a new unexported runCompactWave helper: finishSlot runs exactly once per submitted slot and appends the abort BEFORE Done releases the parent wait on every completion path, and ants invokes the handler synchronously in the aborted worker's goroutine while it recovers the panic (v2.12.0 worker.go), so the r26 review F1 contract — a panicking or unsubmittable worker fails the boundary atomically before any provenance carry or object reclaim — keeps its error-before-release ordering and identical "compaction worker aborted/submit failed" messages without editing the external linter whitelist. The compaction slot type moves to package scope for the helper's signature. New txn_compact_wave_test.go pins the mechanism: worker panics are collected exactly once, mixed success/panic waves collect only the panics while slot-local errors stay on their slots, closed-pool submissions fail instead of hanging the boundary, and empty waves return cleanly; race battery, the r26 shadow-failure boundary suite, and the full pk-move boundary regression stay green, and the CI-pinned molint (go1.27.1 build) reports zero diagnostics on ./.... Repair the six terminal failures of CI run 40797678570 (attempt 1), triaged per failed-job terminal log into five PR-caused classes (design r99): (A) the UT cascade (UT Test / UT Coverage on Ubuntu/x86) from the on-demand tenant upgrade walk hard-breaking at the frozen v4_0_7 handle in every case, so a 4.0.7-born tenant never planned the remaining chain and the bootstrap stall starved mo_task.sys_cron_task into the nil-deref cascade (pkg/bootstrap/custom_upgrade.go, service_upgrade_tenant.go: the frozen 4.0_7 hop now commits OUTSIDE the planning transaction through at most one on-demand pass, and the chain re-plans from the advanced create_version; the v4_0_8 embed fixture expectation follows); (B) the multi-cn PROXY fulltext 300s watchdog hang from fencing-retirement witness rounds firing for commits that never wrote staged state, compounding into lockservice starvation (new D219 pre-round gate in RunDataBranchFencingRetirementCS: exclusive ledger-row-key grant first, then locked-view committed-link and row_kind=0 retention-identity probes; neither present skips the witness round, watermark fold and certification entirely); (C) the 61->63 mo_catalog table-count diffs in the sp_table, show, database_statistics, information_schema, create_user_default_role, restore_cluster_table, cluster_level_snapshot_restore_cluster and clone_sys_db_table_to_new_db_table .result oracles from the two new catalog tables; and (D) the TestGCFiles round-two false PASS from the D121 live-reference guard filtering a re-used fixed object-name set (round 2 now writes fresh names whose distinguishing byte lands inside the ObjectName.String() key window the guard compares). The merge/pick provenance aborts on the pess compose job are PR-caused but did NOT reproduce in sustained local replays - both suites run 100% green (2008/2008 merge, 1721/1721 pick) on a local two-CN pessimistic-RC cluster under DISK-V2 and MINIO storage shapes; the leading hypothesis is CI-runner evidence starvation from the class-B retirement storm, whose gate is the direct remedy, and the post-push CI run owns the verdict.
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). Repair the license-eye SCA findings from CI run 40773355581: correct the Apache URL typo (LICENSE-2.2 -> LICENSE-2.0) in engine_orphan_gc.go and add the standard Matrix Origin header to pk_move_pin_charge_test.go, pk_move_rollback_index_test.go, and pk_move_shrink_boundary_test.go; license-eye -c .licenserc.yml header check on all four files is 4/4 valid. Repair the Makefile err-check SCA finding from CI run 40776611402: the gate rejects fmt.Errorf/errors.New text in non-test pkg code, and this branch's new pk-move files carried 25 fmt.Errorf sites and one errors.New sentinel. Convert them to moerr constructors; the three per-account reap wraps keep inner-error identity for the fail-atomic ErrorIs assertions through a typed dataBranchReapAccountError with Unwrap (message text unchanged). Also clear the fourteen golangci-lint findings the same job reaches once err-check passes: a govet nilness dead error branch in the logtailreplay change-handle Next method, three ineffassign writes (two pk-move link walk fixtures, one tombstone normalization-charge probe), two prealloc slice hints (reap rows, link table-def columns), an SA6001 non-pointer map-key copy in the link receiver, an SA9003 empty condition in the same-key replacement emission, and six unused symbols (pkMoveLinkID, pkMoveLinkTxnIDUnknown, the stage-stub commitTS field and isClosed method, the boundary fixture armWrites and writePaths helpers). Repair the molint checkrecover SCA finding from CI run 40788517465 (SCA Test on Linux/arm64): the analyzer admits recover() only inside its whitelisted functions, and the pk-move compaction wave collected worker panics through an explicit recover() in Transaction.compactDeletionOnObjsLocked (txn.go:3349). Move that collection onto the ants pool's PanicHandler in a new unexported runCompactWave helper: finishSlot runs exactly once per submitted slot and appends the abort BEFORE Done releases the parent wait on every completion path, and ants invokes the handler synchronously in the aborted worker's goroutine while it recovers the panic (v2.12.0 worker.go), so the r26 review F1 contract — a panicking or unsubmittable worker fails the boundary atomically before any provenance carry or object reclaim — keeps its error-before-release ordering and identical "compaction worker aborted/submit failed" messages without editing the external linter whitelist. The compaction slot type moves to package scope for the helper's signature. New txn_compact_wave_test.go pins the mechanism: worker panics are collected exactly once, mixed success/panic waves collect only the panics while slot-local errors stay on their slots, closed-pool submissions fail instead of hanging the boundary, and empty waves return cleanly; race battery, the r26 shadow-failure boundary suite, and the full pk-move boundary regression stay green, and the CI-pinned molint (go1.27.1 build) reports zero diagnostics on ./.... Repair the six terminal failures of CI run 40797678570 (attempt 1), triaged per failed-job terminal log into five PR-caused classes (design r99): (A) the UT cascade (UT Test / UT Coverage on Ubuntu/x86) from the on-demand tenant upgrade walk hard-breaking at the frozen v4_0_7 handle in every case, so a 4.0.7-born tenant never planned the remaining chain and the bootstrap stall starved mo_task.sys_cron_task into the nil-deref cascade (pkg/bootstrap/custom_upgrade.go, service_upgrade_tenant.go: the frozen 4.0_7 hop now commits OUTSIDE the planning transaction through at most one on-demand pass, and the chain re-plans from the advanced create_version; the v4_0_8 embed fixture expectation follows); (B) the multi-cn PROXY fulltext 300s watchdog hang from fencing-retirement witness rounds firing for commits that never wrote staged state, compounding into lockservice starvation (new D219 pre-round gate in RunDataBranchFencingRetirementCS: exclusive ledger-row-key grant first, then locked-view committed-link and row_kind=0 retention-identity probes; neither present skips the witness round, watermark fold and certification entirely); (C) the 61->63 mo_catalog table-count diffs in the sp_table, show, database_statistics, information_schema, create_user_default_role, restore_cluster_table, cluster_level_snapshot_restore_cluster and clone_sys_db_table_to_new_db_table .result oracles from the two new catalog tables; and (D) the TestGCFiles round-two false PASS from the D121 live-reference guard filtering a re-used fixed object-name set (round 2 now writes fresh names whose distinguishing byte lands inside the ObjectName.String() key window the guard compares). The merge/pick provenance aborts on the pess compose job are PR-caused but did NOT reproduce in sustained local replays - both suites run 100% green (2008/2008 merge, 1721/1721 pick) on a local two-CN pessimistic-RC cluster under DISK-V2 and MINIO storage shapes; the leading hypothesis is CI-runner evidence starvation from the class-B retirement storm, whose gate is the direct remedy, and the post-push CI run owns the verdict. Close the PROXY-compose SIGSEGV class from run 40842554758: cn-1 died in maphash.WriteString inside fifocache eviction (enqueueGhost/evict1/ deleteItem) hashing a 42-byte object-name cache key that pointed into freed off-heap vector memory. The pk-move link spill ferry decodes block infos with objectio.DecodeBlockInfo — an unsafe reinterpret over the ferried batch's vector storage — and handed the aliasing blk.MetaLocation() into LoadOneBlockWithSpecialLayout / ConstructObjStatsByLoadObjMeta; the meta extent read then retained and re-hashed cache keys derived from memory its owning batch had already released (49152-row spill groups, ~7.3MB objects, ~2KB meta extents — matching every crash key; fulltext.sql's big-index build supplied the eviction pressure). Both producers now decode from or copy into owned locations. Regression UTs assert every FilePath the fileservice serves during read-back/repair stays disjoint from the transient batch's vector storage (fails pre-fix, passes post-fix).
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). CI repairs on the same head: DROP ACCOUNT now also retires the per-account mo_data_branch_update_link and mo_data_branch_link_retention catalogs after the tenant databases are gone, because every general tenant owns both tables (new tenants via createSqls, existing tenants via the v4.0.8 upgrade), so their mo_catalog.mo_tables rows outlived a dropped account and broke the async-drop leftover accounting in TestDropAccountDuringAsyncIndexInit. The synthetic pk-move link ctx now declares NotLockMeta: its cross-database ObjRef otherwise flipped ordinary single-table UPDATEs from the sole mo_tables name pin they retain on main into LockMeta.doLock's multi-database branch (extra Shared mo_database pins on the user database and mo_catalog plus a mo_tables pin on the link row), which let a competing DROP DATABASE queue on the database pin before ever reaching the retained mo_tables pin and broke the issue-29400 shared-gate choreography. zz_accesscontrol/ create_account and mo_cloud/mo_cloud BVT expectations list the two new per-account catalog tables. New focused regressions: TestUpdatePkMoveLinkCtxSkipsMetaNameLocks (plan), TestDropAccountRetiresDataBranchCatalogs and TestDropAccountDataBranchCatalogDropFailureAborts (frontend drop account).
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). CI repairs on the same head: DROP ACCOUNT now also retires the per-account mo_data_branch_update_link and mo_data_branch_link_retention catalogs after the tenant databases are gone, because every general tenant owns both tables (new tenants via createSqls, existing tenants via the v4.0.8 upgrade), so their mo_catalog.mo_tables rows outlived a dropped account and broke the async-drop leftover accounting in TestDropAccountDuringAsyncIndexInit. The synthetic pk-move link ctx now declares NotLockMeta: its cross-database ObjRef otherwise flipped ordinary single-table UPDATEs from the sole mo_tables name pin they retain on main into LockMeta.doLock's multi-database branch (extra Shared mo_database pins on the user database and mo_catalog plus a mo_tables pin on the link row), which let a competing DROP DATABASE queue on the database pin before ever reaching the retained mo_tables pin and broke the issue-29400 shared-gate choreography. zz_accesscontrol/ create_account and mo_cloud/mo_cloud BVT expectations list the two new per-account catalog tables. New focused regressions: TestUpdatePkMoveLinkCtxSkipsMetaNameLocks (plan), TestDropAccountRetiresDataBranchCatalogs and TestDropAccountDataBranchCatalogDropFailureAborts (frontend drop account).
…T, and full generated-column expressions Consolidates the catalog metadata corrections for matrixorigin#30936, matrixorigin#30935 and upgrade ladder (matrixorigin#31497). Defect corrections (unchanged in substance from the reviewed rounds): - information_schema.COLUMNS binds the label-aware metadata helpers: ENUM/SET character/octet lengths follow the declared labels (multibyte included) and leave numeric metadata SQL NULL for ENUM/SET, keeping ordinary types byte-stable. - STATISTICS.SUB_PART and SHOW INDEX Sub_part return the numeric prefix length from mo_indexes.algo_params (mo_index_sub_part) and actual SQL NULL for non-prefix indexes. - information_schema.COLUMNS.GENERATION_EXPRESSION returns the full expression; the varchar(500) view cast is removed. - Fresh publication (bootstrap init, CREATE ACCOUNT, subscriptions) serves the corrected identities unconditionally; historical snapshot readers keep recognizing their recorded definitions. Delivery vehicle, per approved design revision 12 (docs/design/20261026-declared-catalog-metadata-publication-and-repair.md, sha256 47ebfe15a45940221c3d2d5ad6955e11a5c89a1a909fa9d4e382e1ac9db0a599): - pkg/bootstrap/versions/v4_0_8 is the successor hop of the frozen 4.0.7 stage: two idempotent legs on the upstream shared builder (COLUMNS gate 109; prefix-aware STATISTICS gate 41), protocol floor 118, offset len(tenantUpgEntries), a plain per-entry HandleTenantUpgrade (no paging), no cluster entries; registered after v4_0_7.Handler. The revision-9 v4_0_18 carrier is deleted. - The four 4.0.7-literal admission guards in checkUpgrade are re-keyed onto the consolidated-line comparison and the registered frozen handle's identity (D11-1/D11-2): legacy CDC admission at route creation, recheck and recovery; the ready frozen-source validation; the interrupted offset-only route rejection - upstream's message texts, error types and pre-mutation ordering are unchanged. - The on-demand tenant walks continue past the paged 4.0.7 stage to the final version before caching completion (D12-1/D12-2): MaybeUpgradeTenant resumes the register walk in one bounded service-owned transaction after the stage commits, UpgradeOneTenant no longer terminates at the frozen branch for accounts already at 4.0.7, and both walks keep mo_account.create_version as the sole progress marker: a failure leaves the cache unset and resumes from the committed stamp. - Oracles: the admission suite (CDC admission/rejection at the successor registration including the recovery path and direct succession, frozen-source and offset-only rejections at both the pre-mutation check and recovery validation), and the continuation suite at the real v4_0_7 plus v4_0_8 registration (late-login convergence with second-login idempotence, manual chaining, manual upgrade from an already-stamped 4.0.7 account, successor failure/ retry without premature caching, and the no-successor-SQL-before- stage-completion ordering), plus the re-derived route/hop tests on the consolidated ladder. Rebase onto current main 1c80f16 (2026-10-30 round; the head was 30 commits behind and the merge state DIRTY): - pkg/frontend/authenticate_test.go: upstream matrixorigin#31662 removed the CREATE ACCOUNT protocol ladder and its dedicated suite around our publication oracle; the retargeted TestCreateTablesInformationSchemaPublishesDeclaredMetadataUnconditionally now proves on the complete-current-set creation contract that the corrected declared-label COLUMNS identity and the prefix-aware STATISTICS identity publish and that no predecessor identity is ever authored. Consistent with upstream, account creation installs the complete current set or aborts. - pkg/embed/catalog_view_identity_test.go: a caller-owned 4.0.6 tenant walk now ends at the registered 4.0.8 successor, so the final-version assertions move off the frozen 4.0.7 (the UT Test / UT Coverage / Coverage / CI Required failures of run 40792282505 failed exactly this assertion at the previous head). - Upstream matrixorigin#31662's recurring columns/tables maintenance-scan removal and matrixorigin#31420's literal-prefix SHOW TABLES filter merge alongside this change without edits on this side beyond the conflict resolution above.
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). CI repairs on the same head: DROP ACCOUNT now also retires the per-account mo_data_branch_update_link and mo_data_branch_link_retention catalogs after the tenant databases are gone, because every general tenant owns both tables (new tenants via createSqls, existing tenants via the v4.0.8 upgrade), so their mo_catalog.mo_tables rows outlived a dropped account and broke the async-drop leftover accounting in TestDropAccountDuringAsyncIndexInit. The synthetic pk-move link ctx now declares NotLockMeta: its cross-database ObjRef otherwise flipped ordinary single-table UPDATEs from the sole mo_tables name pin they retain on main into LockMeta.doLock's multi-database branch (extra Shared mo_database pins on the user database and mo_catalog plus a mo_tables pin on the link row), which let a competing DROP DATABASE queue on the database pin before ever reaching the retained mo_tables pin and broke the issue-29400 shared-gate choreography. zz_accesscontrol/ create_account and mo_cloud/mo_cloud BVT expectations list the two new per-account catalog tables. New focused regressions: TestUpdatePkMoveLinkCtxSkipsMetaNameLocks (plan), TestDropAccountRetiresDataBranchCatalogs and TestDropAccountDataBranchCatalogDropFailureAborts (frontend drop account).
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). CI repairs on the same head: DROP ACCOUNT now also retires the per-account mo_data_branch_update_link and mo_data_branch_link_retention catalogs after the tenant databases are gone, because every general tenant owns both tables (new tenants via createSqls, existing tenants via the v4.0.8 upgrade), so their mo_catalog.mo_tables rows outlived a dropped account and broke the async-drop leftover accounting in TestDropAccountDuringAsyncIndexInit. The synthetic pk-move link ctx now declares NotLockMeta: its cross-database ObjRef otherwise flipped ordinary single-table UPDATEs from the sole mo_tables name pin they retain on main into LockMeta.doLock's multi-database branch (extra Shared mo_database pins on the user database and mo_catalog plus a mo_tables pin on the link row), which let a competing DROP DATABASE queue on the database pin before ever reaching the retained mo_tables pin and broke the issue-29400 shared-gate choreography. zz_accesscontrol/ create_account and mo_cloud/mo_cloud BVT expectations list the two new per-account catalog tables. New focused regressions: TestUpdatePkMoveLinkCtxSkipsMetaNameLocks (plan), TestDropAccountRetiresDataBranchCatalogs and TestDropAccountDataBranchCatalogDropFailureAborts (frontend drop account).
…RANCH apply A branch-side primary-key change was emitted as an independent delete of the old key plus an insert of the new key, so DATA BRANCH MERGE and DATA BRANCH PICK replayed it as DELETE/INSERT: the parent-row delete failed with a foreign-key constraint error whenever the destination declared ON UPDATE CASCADE/RESTRICT actions, while an ordinary UPDATE on the same parent key succeeded and cascaded to the child. Record durable old-to-new update provenance for primary-key moves: the multi_update producer registers a genesis-locked link into the mo_data_branch_update_link catalog (keyed first-writer claim, genesis presence probes bounded by the link_id primary-key prefix range), the change stream re-associates the delete/insert pair through that link, and MERGE/PICK apply the move as one native destination UPDATE so declared ON UPDATE actions run. Provenance retention is owned by a certified funnel with snapshot/PITR/account coverage rules, fail-atomic owner-removal reaping, and genesis-lock conflict fencing; ambiguous or unresolved stream evidence aborts the apply fail-closed instead of emitting unsafe DELETE semantics. Related to matrixorigin#28026. Rebased onto main 3cf3888 after matrixorigin#31497 consolidated the unpublished 4.0.8-4.0.17 catalog steps into the frozen 4.0.7 handler: the tenant-upgrade package relocates to v4_0_8 (Version 4.0.8, MinUpgradeVersion 4.0.7) and registers after v4_0_7; the frozen-4.0.7 gates in checkUpgrade now key on the recorded cluster version and the registered frozen handler so a newer final version keeps the offset-only, offset-mismatch, and legacy-CDC rejections; the manual-upgrade no-replay coverage splits into behind-cluster rejection (4.0.7 account) and generic final-version no-replay (4.0.8 account); TestPublishedCatalogUpgradeRoutes gains the 4.0.7 -> 4.0.8 hop including a ready-4.0.7 fixture; lifecycle_branch_reclaim.go merges matrixorigin#31484's variadic waitPolicy with the admission-time reclaim identity capture. Also harden the watermark-fold error classification: awaitLedgerWatermark maps any error observed at or after the one entry-minted absolute fold deadline to the named fold-timeout class by wall clock, closing the window where a stall-delayed inner wait error crossed the deadline before the derived fold context's deadline flag became visible (observed live during a host-wide scheduler stall as a 20710 lock-wait surface instead of the fold-timeout class). CI repairs on the same head: DROP ACCOUNT now also retires the per-account mo_data_branch_update_link and mo_data_branch_link_retention catalogs after the tenant databases are gone, because every general tenant owns both tables (new tenants via createSqls, existing tenants via the v4.0.8 upgrade), so their mo_catalog.mo_tables rows outlived a dropped account and broke the async-drop leftover accounting in TestDropAccountDuringAsyncIndexInit. The synthetic pk-move link ctx now declares NotLockMeta: its cross-database ObjRef otherwise flipped ordinary single-table UPDATEs from the sole mo_tables name pin they retain on main into LockMeta.doLock's multi-database branch (extra Shared mo_database pins on the user database and mo_catalog plus a mo_tables pin on the link row), which let a competing DROP DATABASE queue on the database pin before ever reaching the retained mo_tables pin and broke the issue-29400 shared-gate choreography. zz_accesscontrol/ create_account and mo_cloud/mo_cloud BVT expectations list the two new per-account catalog tables. New focused regressions: TestUpdatePkMoveLinkCtxSkipsMetaNameLocks (plan), TestDropAccountRetiresDataBranchCatalogs and TestDropAccountDataBranchCatalogDropFailureAborts (frontend drop account).
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #31490
What this PR does / why we need it:
Consolidates the unpublished main catalog steps into 4.0.7. Stopped released 4.1 and 4.2 deployments now execute the required catalog changes, including effects previously appended to an already consumed handler. Superseded intermediate handlers are removed; version, account and tenant-task tables remain the only durable progress owners.
Information-schema reconciliation now preserves logical identity and exact-object grants across upgrade, retry and recurring maintenance. Background, manual and login upgrades share one bounded tenant walker; caller-owned transactions retain rollback/commit ownership, and already-current accounts avoid replaying DDL. Column-only unsigned-flag backfills retain their raw catalog updates while the existing cache accepts only proven unchanged column projections, eliminating the upgrade's misleading missing-version errors without creating table versions or changing the protocol.
Upgrade prerequisites (4.1 / 4.2 to main)
mo_catalog.mo_cdc_task. Export any required CDC configuration and watermarks, then drop every existing CDC task in its own tenant using the source-version binary. Old tasks do not record the target identity required for safe resume, including paused or failed tasks. Verify the system-wide query returns no rows.kindisuser. If ownership is ambiguous, determine it independently by snapshot UUID and supply the decision file described in the upgrade guide. Do not guess or delete snapshots. When there are no matching candidates, no decision file is needed.cn.upgrade-catalog-object-limiton all upgrading CNs before retrying.The new CN also rejects remaining legacy CDC tasks, but this is a last check after the logservice may already have started and does not replace pre-upgrade inspection. See
docs/guides/upgrade-4.2-to-main.mdfor the SQL, decision format and operational details. FK reconciliation currently issues catalog queries per child table and may repeatedly scan the FK catalog; large FK counts can materially extend downtime, and bounded result pages do not bound scan work. The local 256- and 1,024-child fixtures do not establish a production time bound.Historical restore limitations
Validation
err-checkpassed. Tools match the local Go 1.27.1 / macOS arm64 build. CI for the new commit remains separate.Scope limits
Direct 3.x upgrades, unpublished main intermediate catalogs, downgrade and mixed-version operation are excluded. Existing older snapshots still require the ownership checks above. The existing 4.1-to-4.2 SQL semantic difference is preserved (for example,
'1'||'2'=12differs between those releases); catalog migration does not introduce a historical SQL execution mode. FK reconciliation retains its measured repeated-scan cost and can require substantial downtime. These tests are sampled compatibility/recovery evidence, not a guarantee for every production configuration.