Skip to content

[4.2.1-hotfix] fix catalog upgrades blocked by lineage checks - #32701

Merged
XuPeng-SH merged 1 commit into
matrixorigin:v4.2.1-hotfixfrom
aptend:fix/4.2.1-hotfix-catalog-upgrade-lineage
Nov 14, 2026
Merged

XuPeng-SH merged 1 commit into
matrixorigin:v4.2.1-hotfixfrom
aptend:fix/4.2.1-hotfix-catalog-upgrade-lineage

Conversation

@aptend

@aptend aptend commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #25077.

What this PR does / why we need it:

Upgrading a 3.0.4 catalog can fail inside the v4.0.0 migrations: COPY ALTER's lineage hooks query mo_feature_registry and mo_snapshots.kind before those migrations have installed them. Reordering the registry creation alone cannot fix ALTER of mo_snapshots itself.

Mark statements issued by UpgradeEntry with a statement-scoped internal option. COPY ALTER skips its lineage preparation and preservation hooks only when the option is present and the resolved database is mo_catalog. Ordinary ALTER retains its lineage behavior, and the existing statement-context defer clears the marker on success/error. Migration SQL, ordering, versions and offsets are unchanged.

This PR targets v4.2.1-hotfix independently of #32699; the combined tree is also validated.

Validation (Linux/amd64, Go 1.26.4, CGO enabled):

  • Full owning-package suites: .agents/skills/mo-dev/scripts/mo-cgo-test -json -p=1 -count=1 -timeout=240s ./pkg/defines ./pkg/util/executor ./pkg/bootstrap/versions ./pkg/sql/compile ./pkg/tests/upgrade.
  • Regression coverage includes explicit/default catalog resolution, marked user-database and unmarked catalog controls, context restoration after parse failure, upgrade rollback/retry/idempotency, and preservation of an existing snapshot row.
  • Persisted official v3.0.4 data with two accounts, snapshot and PITRs: direct upgrade, restart, resume after original failure, resume after manual table creation, and fresh installation. Business ALTER, historical snapshot reads and data-branch ALTER are checked.
  • pkg/sql/compile and pkg/tests/upgrade also pass atop [4.2.1-hotfix] consolidate missing fixes from dated releases #32699.
  • make thirdparties, make cgo, release make build, and full go vet -mod=readonly -p=4 ./....
  • Pinned golangci-lint 2.6.2, unchanged repository configuration, tests and affected reverse dependencies covered: golangci-lint run --new-from-rev=origin/v4.2.1-hotfix ./... and the same check against freshly fetched origin/main.
  • Full molint has no new findings; its three unchanged checkrecover findings reproduce on clean base 115c227239. gofmt and git diff --check pass.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Nov 13, 2026
@mergify

mergify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH
XuPeng-SH merged commit 4711b18 into matrixorigin:v4.2.1-hotfix Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants