Repository navigation
docs: approve the on-demand View metadata contract - #29456
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
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:
- 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.
- 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.
- 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.
Merge Queue Status
This pull request spent 1 minute 35 seconds in the queue, including 1 minute 15 seconds running CI. Required conditions to merge
|
What type of PR is this?
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.
Type,ColDef, andmo_columnsfields as authoritative definition state, derived output, or physical compatibility data. Include theSELECT * FROM view LIMIT 0catalog shortcut, column-count SHOW, prepared/cached/cursor paths, subscriptions, and the actual unsupported boundaries of COM_FIELD_LIST and View DUMP TABLE.mo_columnsreads 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.Exact design revision and approval
371e3c1761dab22dff95d0e830caab31aa46eeeb.f8cd0a71d59c37d14bb6dc964e968d4c68b0d95b01cb6a371f597c1eb6ea0120.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
git diff --checkand staged-diff checks passed.Type, 22ColDef, and 27mo_columnsfields; the approved design checksum matches the approval record.mo/mainat3fe37b311df718eb7b369513cd6d615b10b04092and 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.