Skip to content

docs: approve the on-demand View metadata contract - #29456

Merged
mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ck89119:issue-29436-main
Sep 29, 2026
Merged

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

Conversation

@ck89119

@ck89119 ck89119 commented Sep 28, 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 #29436.

Part of #29433. This PR does not implement S2–S9 or claim to resolve #26227.

What this PR does / why we need it:

Complete the S1 implementation-gating design against the current on-demand implementation already merged in #29139, rather than rebuilding the superseded durable-refresh architecture.

  • Map 17 consumer boundaries and classify all current Type, ColDef, and mo_columns fields as authoritative definition state, derived output, or physical compatibility data. Include the SELECT * FROM view LIMIT 0 catalog shortcut, column-count SHOW, prepared/cached/cursor paths, subscriptions, and the actual unsupported boundaries of COM_FIELD_LIST and View DUMP TABLE.
  • Specify one read-only inference/provenance contract, statement-local ownership and memoization, snapshot/own-DDL behavior, frozen stars, legacy definitions, authorization, invalid-view errors, and historical system-template adaptation.
  • Make the raw-catalog choice explicit: direct mo_columns reads retain physical/MVCC compatibility semantics and are not a current View-schema interface. Record the required reconciliation with [Bug]: View metadata stays stale after source column type changes #26227's earlier persistence-oriented acceptance criteria.
  • Define numeric resource/performance budgets, benchmark cases, mixed-version activation and rollback restrictions, and the shared admission/protocol/snapshot protections that must survive refresh retirement.
  • Map remaining work and evidence to S2–S9; cross-request caching remains conditional and separately reviewed. No older issue is edited or closed by this change.

Exact design revision and approval

The requester approved this exact revision after the design and the four material choices (raw-catalog compatibility, legacy rejection, rollback restrictions, and numeric budgets) were presented. The approved design bytes are frozen; its pre-approval wording is intentionally retained, with the subsequent APPROVED status recorded separately. This is a task-session approval record, not a claimed GitHub review vote or production rollout approval.

Validation and delivery scope

  • Documentation only: two Markdown files; no production, test, generated-code, or configuration changes.
  • git diff --check and staged-diff checks passed.
  • Lightweight document checks passed: 35 local file links, 21 consistent Markdown tables, balanced code fences, numbered sections, 17 consumer entries, and 10 decisions.
  • Field-inventory checks cover 9 Type, 22 ColDef, and 27 mo_columns fields; the approved design checksum matches the approval record.
  • Updated the branch to mo/main at 3fe37b311df718eb7b369513cd6d615b10b04092 and reviewed the complete fix(cnservice): preserve bootstrap ownership through admission handoff #29450 increment. Its bootstrap-owner/admission fix preserves the shared protections required by this design; no design-contract change was needed.
  • Go tests, BVT, race, mixed-binary/restore tests, and benchmarks were not run for this documentation-only change. Their required evidence remains assigned to the implementation phases; historical fix: derive current View metadata on demand #29139 results are not relabeled as fresh validation.

@mergify mergify Bot added the kind/documentation Improvements or additions to documentation label Sep 28, 2026
@matrix-meow matrix-meow added the size/XS Denotes a PR that changes [1, 9] lines label Sep 28, 2026
@ck89119
ck89119 marked this pull request as ready for review September 29, 2026 03:19
@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 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 design review of exact head a2ed305452607192a7035136160cb6877793d905, base/merge-base 466eb8ff4f65752ad25d7e19274770459f5ef934; fetched current main c69187e0e3. APPROVE for this S1 documentation-only delivery. No confirmed blocking finding. This is independent acceptance of the design contract, not approval of S2–S9 implementations, production activation, performance claims, or closure of #26227. No subagents were used and no product files were changed.

Scope and design decision

Read both complete documents and the full old/new diff, #29436/#29433, and #26227 including its expression-default comment. Cross-checked the key source boundaries: DescribeViewColumns/RegenerateViewDefinition, dependency capture versus description dependency tracking, SHOW column count/table values, the LIMIT 0 raw-column shortcut, COM_FIELD_LIST, View DUMP rejection, and persisted-expression/admission users. All changes are documentation: production 0, tests 0, design +384/-161, review record +115. R0 delivery describes an R3 future architecture; it must not be mistaken for an already-validated runtime refactor.

I accept v2.0-draft.1 + E1, design blob a2f23dd227a40d0f6015d757eb7e878ab9eeea4f, SHA-256 f631ef3fa7c1c100f8c52ce718b22dc27a23e7155d3464a54b5f5bb78d879db7. The separate record explicitly supersedes the frozen draft's approval wording and distinguishes task-session approval from a GitHub vote. I verified the original SHA-256 f8cd0a71...ea0120 and that the current design differs from that approved artifact only by E1's __mo_cpkey -> __mo_cpkey_col correction; this review judges the current contract independently rather than inheriting the author's self-review.

Why the direction is reasonable

  • Persistent identity/definition/security facts and derived output have distinct owners. The design reuses binder/provenance and existing catalog/context/telemetry-adjacent infrastructure rather than introducing a second inference engine or freshness state machine. Query plans are not replaced with description-cache entries, and CTAS's distinct default/provenance policy is retained.
  • Raw mo_columns is explicitly a physical/MVCC compatibility interface, not a secretly virtualized current-schema interface. Migration of logical consumers includes the often-missed LIMIT 0 and SHOW paths. Keeping compatibility data is justified until actual reader/writer/restore users are retired; it is not permission to keep refresh-only runtime work indefinitely.
  • Request-local immutable reuse is bounded; cross-request caching requires separate evidence/design and is not mandatory. The architecture acknowledges the transfer of work from DDL maintenance to metadata reads, rather than assuming that on-demand is universally faster.
  • Legacy rejection, frozen projections, single-object error versus bulk confirmed-missing-dependency warning, and historical schema versus current authorization are explicit choices. Frozen-star behavior is consistent with the cited MySQL CREATE VIEW contract; this is not a claim of full MySQL equivalence or a fresh differential run.

Adversarial/QA closure at the design level

Challenge Contract that closes it / required later proof
Base or intermediate View changes while root version does not Complete dependency identity/version closure or rebind; no root-only/TTL validity
Memo disabled/evicted or shared DAG revisited Same semantic result and structural budget charge; recursion-stack cycle detection, not global visited-set rejection
Historical snapshot or an already-open cursor after DDL Preserve the proper schema/result generation; do not force latest metadata into FETCH
Invisible broken View, storage failure disguised as missing dependency Candidate authorization before binding; only confirmed dependency absence may be skipped, other errors remain fatal
Partial initialization/cancel/early LIMIT/Reset Borrowed parent txn is not closed; request/provider/operator cleanup is owned; no new background worker
Capability commit succeeds but tenant migration fails Monotonic floor, compatibility-mode B readers, retryable tenant transaction, no reopening old readers
Removal of refresh code also deletes unrelated safeguards Explicit shared admission/snapshot/persisted-expression inventory; R3 runtime retirement and R4 physical cleanup are separate

Q1: ownership and terminal cleanup are specified in §6.3. Q2: directory waits inherit the request deadline and cancellation must not queue behind the work it controls. Q3: definition/output/work/dependency/memo/memory limits are specified in §11. These are reviewable implementation requirements, not a claim that existing code already enforces them. The 128 MiB heap-inclusive preallocation accounting, transitive dependency checks, historical-template adaptation and old-generation draining remain substantive implementation work.

Engineering/test/document quality

The proposed tests distinguish typed provenance from public SQL/client metadata, include nearest controls, prefer existing fixtures and small data, and keep scale/latency measurements out of BVT. No new runtime test is required for this Markdown-only change. S5/S6 evidence remains an activation gate; the listed numeric budgets are acceptance targets, not measurements.

Non-blocking clarifications/improvements:

  1. Define the exact charging unit for '累计绑定列槽' before S2 implementation: whether base bindings, intermediate View outputs and final projections each count. Check this against the explicit 4096-column simple-projection success case; avoid either counting physical copies as additional logical slots or accidentally limiting an entire request to 4096 columns.
  2. In S5's activation test, include an already-B binary serving an A-mode request while the tenant version commits, not just an old L/A binary reconnecting. The existing 'old execution generations drain' requirement must cover that compatibility-mode generation too; allocation of a new protocol number alone is not the drain proof.
  3. The 115-line review record repeats much of the design/risk matrix and local workflow history. It can be shortened to exact revision/hash, decision/approval scope, E1, and evidence limits without losing auditability. Keep the actual contract in one place. Also update the PR body's 'frozen bytes' description/link to acknowledge E1/current hash consistently.

Historical comments and evidence

This PR currently has no human reviews or inline review comments, only the paused-bot notice. E1 is verified fixed. The #26227 expression-default requirement is retained in the provenance/public-validation matrix, but not claimed implemented here. I did not classify unrelated #29139 implementation comments as automatically resolved by a design rewrite.

Locally: git diff --check passed; both recorded design hashes match; 35 local document links exist at the reviewed revision; code fences balance; Type/ColDef field inventories were cross-checked with the proto. Exact-head CI run 36517111491 succeeded, including documentation whitespace/required checks. Runtime UT/BVT/race/upgrade jobs are skipped for the documentation-only scope; no fresh runtime, benchmark, leak/race or rollout PASS is claimed.

@mergify mergify Bot added the queued label Sep 29, 2026
@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-29 04:37 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-09-29 04:38 UTC · at d8152cb08d7e73316034c33aaf0e7bc01c176f91 · squash

This pull request spent 1 minute 35 seconds in the queue, including 1 minute 15 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit d8152cb into matrixorigin:main Sep 29, 2026
19 of 20 checks passed
@mergify mergify Bot removed the queued label Sep 29, 2026
@ck89119
ck89119 deleted the issue-29436-main branch September 29, 2026 06:52

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/documentation Improvements or additions to documentation size/XS Denotes a PR that changes [1, 9] lines

Projects

None yet

3 participants