Skip to content

refactor(view): add metadata regeneration foundation - #27267

Merged
mergify[bot] merged 13 commits into
matrixorigin:mainfrom
ck89119:issue-26227-foundation-main
Aug 19, 2026
Merged

mergify[bot] merged 13 commits into
matrixorigin:mainfrom
ck89119:issue-26227-foundation-main

Conversation

@ck89119

@ck89119 ck89119 commented Aug 18, 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:

issue #26227

What this PR does / why we need it:

This is stack 1/3 for #26227.

It adds the inactive foundation for persisted View metadata regeneration:

  • catalog definitions for View dependencies and refresh state;
  • the authoritative View schema regeneration model;
  • guarded, identity-preserving TableDef replacement, including ownership and created-time preservation;
  • planner ownership fixes required for concurrent regeneration.

This PR does not activate lifecycle tracking, background recovery, or public fail-closed behavior.

Stack:

  1. this PR
  2. issue-26227-lifecycle-main
  3. issue-26227-activation-main

Validation:

  • focused planner/catalog/bootstrap CGo tests;
  • generated protobuf verification;
  • go list, go vet, make build, and git diff --check on the complete stack.

@aptend aptend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the exact current head and the complete review history. The latest change closes the outstanding physical-owner issue by making the frontend catalog resolver the source of truth for snapshot, subscription-publisher, cluster-table, and forced-system-account namespace selection, and the regeneration wrapper now forwards that optional resolver. I also rechecked the surrounding dependency capture/regeneration, upgrade sequencing, guarded replace-definition, ownership preservation, and metadata compatibility paths. No remaining blocking issue found. (Focused local Go tests could not run because the installed Go 1.26.4 toolchain is incomplete/corrupted—standard-library packages are missing; third-party and CGo artifacts themselves built successfully.)

# Conflicts:
#	pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go
#	pkg/bootstrap/versions/v4_0_6/upgrade_test.go

@aunjgr aunjgr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head 3d5528e. The metadata tables, guarded replacement protocol, upgrade pre-SQL sequencing, lower-case binding propagation, and physical dependency-owner resolution are covered by focused tests and passing CI. The prior migration, binding, and ownership findings are addressed; no additional blocking issue found.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep re-review completed on exact head 3d5528e9a39dee990510209b35a24c01ce29e7cb, including the complete prior finding history and the latest main merge. No blocking issue remains.

The legacy KEY_COLUMN_USAGE migration now handles both object kinds through independently executed, ordered Pre/Upg/Post statements in one upgrade transaction. Persisted lower_case_table_names governs parsing, the nested BindContext, unaliased binding keys, and regeneration. Physical dependency ownership is now resolved by the frontend along the same snapshot/subscription/system-account paths used by relation resolution, and viewRegenerationContext forwards that resolver instead of falling back to the logical tenant.

I also rechecked direct/nested dependency capture, snapshot and subscription identity, deterministic dependency ordering, unknown ViewData preservation, guarded version replacement, rollback restoration, and creator/owner/created-time preservation. Focused bootstrap/planner/frontend/disttae race tests pass; complete diff is git diff --check clean.

@mergify

mergify Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-19 12:19 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-19 15:44 UTC · at 3a8356df1436f2f5089c0ef2e7e391cc0c4a5d2e · squash

This pull request spent 3 hours 24 minutes 5 seconds in the queue, including 55 minutes 59 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor Code refactor size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants