Skip to content

refactor(view): serve opt-in introspection through shared schema requests - #30578

Merged
mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ck89119:issue-29439-main
Oct 19, 2026
Merged

mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ck89119:issue-29439-main

Conversation

@ck89119

@ck89119 ck89119 commented Oct 19, 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 #29439

What this PR does / why we need it:

Route explicitly opted-in View introspection consumers through the approved S2 derived-schema request boundary. Default SQL behavior remains unchanged; this does not activate the full v2 rollout or absorb S3.

  • Share statement-owned authorization, memoization, work limits and deadlines across DESC/SHOW and local/subscription information_schema.columns consumers.
  • Preserve subscriber-visible names, publisher identities, historical snapshots, visibility filtering and ordinary relational semantics. Keep raw mo_catalog.mo_columns physical/MVCC semantics and ordinary-table fast paths.
  • Bound derived TVF output and preserve source page boundaries through APPLY. Release results on errors, cancellation, early termination, Reset and Free; keep default legacy signatures compatible.
  • Skip invalid Views in bulk metadata only for proven missing-dependency binding errors. Authorization/provider/root-lookup failures remain fatal, and the existing S2 public error contract is preserved.
  • Document consumer ownership, activation boundaries and raw-catalog migration guidance.

Validation (Go 1.27.1, repository CGo wrapper and worktree-built native libraries):

  • Full normal tests passed for pkg/sql/plan, pkg/sql/colexec/table_function, pkg/sql/colexec/apply, pkg/util/sysview, pkg/sql/compile and pkg/frontend.
  • Full race tests passed for plan, table_function, apply and frontend; three focused concurrency tests each passed 100 race repetitions.
  • Real native SQL integration passed for DESC/SHOW/FULL, I_S filtering/default predicates, parameters/NULL, JOIN/aggregation/UNION/LIMIT, historical snapshots, subscriptions, mixed tenant domains, denied-role exclusion and physical-catalog controls.
  • Changed-block statement-weighted coverage: 211/227 (92.95%).
  • Existing view_metadata_on_demand.sql passed normal mo-tester comparison twice on the same owned single-CN instance, 64/64 each run, with database/snapshot teardown assertions. This network BVT validates default compatibility; the new opt-in path is covered separately by native SQL integration.
  • Full validation ran on 8ef2eaf4d923; after syncing to 57fb9530859d, semantically unaffected evidence was reused and focused ViewMetadata/ViewSchema plus the new upstream PREPARE/error and session-variable regressions passed for plan/frontend.
  • gofmt and git diff --check passed.

Limitations: two-CN scope-placement unit tests passed, but no live multi-CN or mixed-version rollout was exercised. No default activation, durable refresh removal, or S5/S6/S8 acceptance is claimed.

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

@XuPeng-SH

XuPeng-SH commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: ddd7db0af161f3d9d8cb54eac8aa49149e56d1a4

Review completed. Read the assessment.

@XuPeng-SH

XuPeng-SH commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: ddd7db0af161f3d9d8cb54eac8aa49149e56d1a4

Review belongs to an older commit; it is not a review of the current head.

@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: ddd7db0af161f3d9d8cb54eac8aa49149e56d1a4

Assessment: approve

Reviewed the complete 24-file delta and affected callers. The opt-in design appropriately reuses S2 ownership, authorization and budgets, preserves legacy behavior, and bounds metadata output. No actionable unresolved findings.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • Verified frozen head, matching patch and unchanged source; all 11,529 tracked build inputs match. Isolation preflight and repository-owned native build passed.

  • Focused tests passed across plan, table_function, apply, sysview and compile. Full normal table_function/apply/sysview suites passed.

  • Both native frontend integration tests passed, covering SHOW/DESC, relational metadata queries, history, subscriptions, tenant isolation, role exclusion and physical-catalog controls.

  • Three request-lifecycle tests passed 100 race repetitions each. Full race suites for plan, table_function and apply passed.

  • Reconciled command/source/exit receipts with retained logs: /home/xupeng/.local/state/mo-bot/jobs/44625c49b012c1584b255516/attempt-1/validation-manifest.json. Complete review record: review-notes.md.

Limitations:

  • No live opt-in multi-CN, mixed-version rollout or production performance benchmark; later activation and rollout acceptance remain separate.

  • Raw CI logs and author validation receipts were unavailable. Author coverage totals were not independently verified.

  • The linked issue body was not supplied; its available contract was reviewed through the frozen design documents and PR description.

@mergify mergify Bot added the queued label Oct 19, 2026
@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-19 12:10 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-19 19:09 UTC · at c27f3f26ca6ba8e38486322e382a20093028fb38 · squash

This pull request spent 6 hours 58 minutes 18 seconds in the queue, including 57 minutes 27 seconds running CI.

Required conditions to merge

@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 ddd7db0 independently against the approved shared-request contract and S4 consumer boundaries. No blocking finding in the opt-in path.

The request marker is not authority: consumer identity and per-root authorization remain checked. The common request serializes binding with cancellation-aware waits, shares existing work/deadline/memo limits and does not own the parent transaction. Bulk skipping uses binding-error provenance rather than swallowing root/provider/authorization errors. TVF result release covers completion, error, early termination, Reset and Free; APPLY preserves bounded source pages instead of coalescing them.

Reviewed local/subscription placement, historical template adaptation, SHOW rebind/dependency behavior, ordinary-table/default compatibility and the lifecycle/public/native tests. Passing exact-head CI and source-qualified evidence are reused; no new local service or real mixed-version run is claimed. This approval does not authorize default activation or completion of S5/S6/S8 rollout gates.

@mergify
mergify Bot merged commit c27f3f2 into matrixorigin:main Oct 19, 2026
@mergify mergify Bot removed the queued label Oct 19, 2026
@ck89119
ck89119 deleted the issue-29439-main branch October 20, 2026 03:53
XuPeng-SH pushed a commit that referenced this pull request Oct 23, 2026
…d scope with PR #30578 (#30739)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [x] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Fixes #30668

## What this PR does / why we need it:

#30668 asks whether merged PR #30578 was intended to close only the S2
opt-in work or all of S4 (#29439), and requires the remaining
adapter/consumer contract **and tests** to stay tracked before S5
(#29440) is treated as unblocked. This PR answers with a reconciliation
record **plus executable contract tests** (no production code changes).

**Reconciliation record**
(`docs/design/CLAUDE_2026-10-20-view-metadata-s4-reconciliation.md`):

- **Scope answer**: #30578 intended to close the full S4 opt-in consumer
wiring (C04–C07, C11–C13, C16, C17 per the S1 consumer map). Its "S2
boundary" wording refers to reusing the approved S2 request boundary,
not to narrowing S4.
- **Final consumer classification audit** (required by the S1 design at
S3/S4 closure): every executable `mo_catalog.mo_columns` query call site
and every S4-scope View column/definition consumer, classified as
derived, physical-compatible, regression-control, or S5-owned. The audit
finds no remaining required consumer that still observes stale persisted
View columns. Physical-compatible readers include SHOW SEQUENCES/SHOW
INDEX (C17), CDC primary-key probes (`relkind='r'` only), the
auto-increment RESET ownership check, vector-index metadata shape
probes, snapshot sequence restores, upgrade version checks, engine
replication/record layers, and offline checkpoint tools.
- **Explicit D03 raw-catalog policy statement**: raw `mo_columns` keeps
physical snapshot semantics; internal consumers requiring current
columns use the logical entry points; description reads never persist
derived results. The D03 replacement of #26227's persistence acceptance
is recorded as closed (owner clarification 2026-09-30; issue closed
2026-10-10).
- **Residual tracking**: S3 #29438 was delivered by #30551 (merged
2026-10-21) and is closed; C14/`BuildTableDefByMoColumns` disposition is
recorded in the S3 consumer document. The only remaining dependency item
for S5 #29440 is its own scope.

**Contract tests** (pin the reconciliation so S5 cannot regress it
silently):

- `TestDerivedColumnsTemplateSeparatesPersistedAndDerivedAuthority`
(pkg/util/sysview): the I_S COLUMNS templates
(current/V100/V109/V41-derived) keep user Views out of the persisted
`mo_columns` branch and re-add them only through on-demand description;
subscription candidates are authorized and filtered left of the APPLY;
historical single-branch templates gain no subscription rows.
- `TestShowColumnsSplitsPhysicalAndLogicalAuthority` (pkg/sql/plan):
under one opt-in metadata request, DESC/SHOW [FULL] COLUMNS/SHOW
COLUMN_NUMBER plans for a user View never scan `mo_columns`, while
ordinary tables keep their physical `mo_columns` read without any active
request.
- `TestViewColumnsSkipsNullCandidatesYieldsEmptyResult`,
`TestViewColumnsStartRejectsCancelledContext`
(pkg/sql/colexec/table_function): filtered candidates yield empty scans
instead of errors; cancellation at scan start aborts description with
the context error.

Audit baseline: `c0e826888b` (mo/main, 2026-10-21); revision log in the
document records the two earlier review completions.

Validation (darwin/arm64, repository CGo wrapper, worktree-built native
libraries):

- Full normal tests passed for `pkg/sql/plan`,
`pkg/sql/colexec/table_function`, and `pkg/util/sysview`.
- Focused `-race` runs passed for the new plan/table_function contract
tests plus the existing concurrent ViewMetadata request tests.
- gofmt, `go vet`, and `git diff --check` passed.
- No production code changed; BVT/native integration evidence previously
reported by #30551/#30578 is not re-claimed.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
ci — ed83a536 Deployed Oct 19, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Improvements or additions to documentation kind/enhancement 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.

[Subtask]: Serve View introspection metadata through on-demand derivation

4 participants