Skip to content

fix(view): align historical authorization and metadata compatibility - #32328

Merged
mergify[bot] merged 14 commits into
matrixorigin:mainfrom
ck89119:issue-32259-main
Nov 8, 2026
Merged

mergify[bot] merged 14 commits into
matrixorigin:mainfrom
ck89119:issue-32259-main

Conversation

@ck89119

@ck89119 ck89119 commented Nov 6, 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:

Fixes #32259

What this PR does / why we need it:

  • Check subscription publication membership, table scope, and routing at the current statement authorization point, independently of historical data/schema reads. Cached EXECUTE resolves the captured historical alias directly, not an unrelated current same-named replacement. Keep metadata, SELECT, prepared statements, and old transactions consistent after withdrawal or remapping. Resolve physical source ownership at current admission separately from publisher identity, including authorized foreign sources and same-named historical publisher decoys.
  • Resolve qualified published Views without requiring a subscriber-local shadow database. Preserve bounded pagination, transaction ownership, cancellation, error-after-output propagation, and cleanup.
  • Let an authorized explicit account snapshot select its metadata namespace for both tables and Views without changing the caller's identity or weakening tenant isolation. Recognize both frozen and current index-filtered CTEs while retaining physical-index listing filters.
  • Define per-column SHOW/DESC wire metadata consistently for text and binary-prepared paths, including cached metadata. Update 54 existing result files only for those headers and add focused regressions.

Validation:

  • Test-only follow-ups retain field-specific quoted/temporary SHOW/DESC types and independent historical cached-alias sources. Borrowed MERGE transactions now receive their own unchanged one-minute phase budget after fixture preparation, with per-iteration rollback cleanup. Independent database teardown calls also retain separate 30-second budgets rather than sharing one deadline. Normal/coverage, five shuffled repetitions with neighboring controls, targeted race, and the full owning issues suite pass.
  • Changed-package owning normal/coverage suites, public SQL/privilege/subscription tests, targeted lifecycle race ×10 and public-path race, and incremental vet/lint. The foreign-source follow-up has 100% executable changed-line coverage (32/32). Independent sys-publisher and owner-only foreign-source fixtures verify current/historical table/View metadata, binary-prepared reads, and current withdrawal.
  • Strict JDBC text/server-side-prepared checks and public binary/SQL cached-EXECUTE regressions. Ordinary-service evidence at 6544a37a0b covers all four metadata/authorization/header BVT cases: 204/204 × 2, including the extended subscription case 125/125 × 2, with zero residual test resources. All original 84 subscription checks and their golden output remain unchanged. Indexed-snapshot tests separately prove physical children exist but stay absent from I_S.
  • Supported-release compatibility evidence collected before the cache-validation follow-up: official v4.2.7 shutdown upgrade 19/19, persistent restart 12/12, and independent restoration of old SQL dumps 11/11.

The source-selection contract remains: historical alias → currently admitted source → that source's historical schema/data. This does not implement the separate historical-physical-source redesign or production activation. The full strict-metadata suite is not claimed green; unrelated existing golden discrepancies are not rewritten here.

Resolve subscription withdrawal and source-coherence defects, preserve qualified publisher View routing, separate snapshot metadata namespaces from caller authorization, and define consistent SHOW/DESC wire metadata for query and prepared paths.

Refs matrixorigin#32259
…hots

Resolve prepared historical dependencies directly at captured T, then retain the resolver current-publication authorization at A. Do not probe an unrelated current same-named alias before historical resolution.

Cover current-alias replacement, denied replacement publications, historical withdrawal and regrant, binary and SQL cached EXECUTE, and fresh PREPARE controls. Refs matrixorigin#32259.
Assert SHOW/DESC client types per field while retaining quoted identifier and temporary table coverage. Initialize and own the cached subscription historical source so filtering out sibling subtests cannot change its data or schema.

Validate normal and instrumented runs, standalone cached subtest repetition, the full public parent group with shuffle, and targeted race. Refs matrixorigin#32259.
@matrix-meow matrix-meow added size/XXL Denotes a PR that changes 2000+ lines and removed size/XL Denotes a PR that changes [1000, 1999] lines labels Nov 7, 2026
@ck89119
ck89119 requested a review from XuPeng-SH November 7, 2026 16:20
@XuPeng-SH

XuPeng-SH commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 6544a37a0b79a8947bf4a586decb3fa2efa03a4e

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: 6544a37a0b79a8947bf4a586decb3fa2efa03a4e

Assessment: approve

The prior F2 finding is resolved: historical metadata now uses the canonically admitted physical source owner. Shared admission and protocol owners preserve authorization and metadata consistency without new persistent state. No actionable findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed all 91 changed paths, four discussion entries and linked issue 32259; source unchanged.

  • Verified 29 Go files parse and are gofmt-clean; all 54 existing golden files change only 369 metadata headers.

  • Isolation preflight and six extracted-SQL SQLite source-resolution controls passed. Receipts and logs are reconciled in validation-evidence.json.

  • Frozen-head CI build, UT, coverage, SCA and enabled multi-CN BVT succeeded: 14 successful, 14 skipped and two neutral checks.

  • Assessed author-reported public SQL, JDBC, race, BVT and scoped release-compatibility results.

Limitations:

  • Local focused Go testing stopped before compilation because compatible native prerequisites were missing.

  • The relational probe is not a MatrixOne runtime reproduction; author execution logs were unavailable, and local JDBC/cluster/BVT checks were not repeated.

  • Parent production activation and the separate historical physical-source redesign remain outside this repair.

@mergify mergify Bot added the queued label Nov 7, 2026
@mergify

mergify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

❌ Left the queue · checks failed

2 h 12 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Sat 7 Nov, 17:09 · rule main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in place
  • 🚫 Left the queue 19:21 · b3f431b

The failure is in this pull request. It failed tested alone on top of main.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

To get back in the queue

  • Push a fix: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, tick the box below to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub branch protection:
    • check-neutral = CI Required
    • check-skipped = CI Required
    • check-success = CI Required

Requeue requested — the merge queue status continues in this comment ↓.

2 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection

Times in UTC · dashboard · how the merge queue works

Keep each DROP DATABASE cleanup bounded by its existing 30-second guard instead of charging both operations against a shared deadline. Cancel each context before advancing and preserve error reporting and all DDL/SNAPSHOT/PITR assertions.

Fix ordinary UT teardown failure in Actions run 42398556672. Refs matrixorigin#32259.
@mergify

mergify Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ Merged into main as ee21c57 at 06:41 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Sun 8 Nov, 06:40 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 06:41 · ee21c57 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — c604b430 Deployed Nov 8, 2026 by ck89119
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 size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask]: Resolve correctness and compatibility findings from S5 View metadata validation

3 participants