Skip to content

fix(sysview): publish declared COLUMNS metadata, numeric SUB_PART and full generated expressions - #31489

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-30936-main-951252f3
Oct 30, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-30936-main-951252f3

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Oct 27, 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:

Related to #30936.
Related to #30935.
Related to #30937.

What this PR does / why we need it:

Fixes the declared-catalog metadata defects of #30936/#30935/#30937 and delivers the corrected
identities through the repository's supported model: unconditional publication plus one
idempotent stored-view refresh hop
. No feature-specific protocol gate and no mixed-version
fallback exists in this PR: after the first implementation review every such mechanism was
removed (MORPCLatestVersion stays 134, no read substitution, no admission survey, no per-tenant
floor), while the stored-view migration the reviewers called "necessary" is retained.

Design record (design-first review chain)

The change is triggered (persisted-view migration, upgrade recovery, cross-subsystem changes), so
the repository's design gate applies: docs/design/20261026-declared-catalog-metadata-publication-and-repair.md
is the reviewed artifact, implementation of each round proceeded only after that round's
independent design review returned PASS, and the document's status block and revision history
record every reviewed revision's exact content hash, disposition and implementing head:

  • Revision 9 (sha256 57043aac71c74a7cb63f0a8ac047a4ac898bf974791644569e5c57f4bd2838d9),
    PASS 2026-10-28 - the shutdown-only rework that removed the protocol-135 gate family;
    implemented at rework head 9f454cb5d0.
  • Revision 12 (sha256 47ebfe15a45940221c3d2d5ad6955e11a5c89a1a909fa9d4e382e1ac9db0a599),
    PASS 2026-10-29 - the post-consolidation vehicle plus preserved upgrade admission and
    on-demand continuation; implemented at head efb7234682.
  • Revision 14 (sha256 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66),
    PASS 2026-10-30 - the rebase onto upstream fix(sql): enforce DECIMAL UNSIGNED and ZEROFILL attributes end to end #31739's ladder: vehicle renumbered to v4_0_19,
    the merged COLUMNS identity, the frozen 4.0.18-snapshot recognition, the direct-route census.
    This is the delivered design content; it was implemented at head 61da7f8ef0.
  • The design-first decision of record for revision 14 is identified and linked in the tracked
    document (revision 16) and here. The returning review was the controller-run independent
    pre-PR design review: a read-only, ephemeral Codex review session under the
    fix-issue-loop-local-reviewer contract, provider-separated from the implementing Grok CLI
    session (reviewer model gpt-6.1-sol, reasoning effort xhigh;
    implementing handler magpie/tass/glm-5.3; controller run
    3dedc8b010734de9ba6a4c92c3fdf56e, review session thread
    01a18bcc-5369-7d91-ae66-c072a48a5b1e, run window 2026-10-30T07:53:04Z-07:59:46Z,
    exit 0). It returned approved: true (PASS - design only, no findings) at
    2026-10-30T07:59:46Z for exactly that content hash. Retained external evidence:
    the approved bytes are public at
    https://github.com/matrixorigin/matrixone/blob/61da7f8ef005f2ee14a3ea44e738e6baee24876d/docs/design/20261026-declared-catalog-metadata-publication-and-repair.md
    (that committed document hashes to the approved sha256); the verbatim decision record plus
    its provenance is durably published at
    https://gist.github.com/gouhongshen/f1120ed42e7a71f75afa79d1ff8b5bc2; and the controller
    retains the full review transcript and the exact checkpoint submission the reviewer was
    sent (state/logs/issue-30936/1793346784-b0837235.jsonl,
    state/artifacts/issue-30936/pr-event-result-1793345798133.json), next to every earlier
    round's decision record under state/artifacts/issue-30936/ (revision 9 PASS
    pre-pr-review-1793174134562.json, revision 10 REQUEST_CHANGES
    pre-pr-review-1793224739314.json, revision 11 REQUEST_CHANGES
    pre-pr-review-1793225484685.json, revision 12 PASS pre-pr-review-1793226200902.json,
    revision 13 REQUEST_CHANGES pre-pr-review-1793323124836.json).
  • Revision 15 (sha256
    551fb06436f784e8b75fa9c7d37702ea47379ed5902256b8188d1dfcacb22f6c) - the documentation-only
    consolidation at the implementation review's request (head 38901ce0e7): the design-approval chain and
    the actual v4_0_19 vehicle are stated in the document's status block, the revision-13/14
    amendments are folded into the standing sections, and the transient review/run correspondence
    was moved out of the tracked file (it remains recorded in the review threads and retained
    review evidence). No decision, invariant, oracle or validation entry changed from the approved
    revision 14; the approved revision-14 wording governs wherever the consolidation could be read
    as a change.
  • Revision 16 (sha256
    2df7a7dfef372bf41feb160c3c3252ac9f1d6b3522106c94fe1e3f5d038d9f8d) - the
    documentation-only evidence-link pass at the design-gate review's request (this push): the
    tracked design's status block and revision history now identify the actual design-first
    decision of record for the delivered revision and its reviewer, and link the retained
    external evidence (public byte link of the approved content, durable verbatim
    decision-record gist, controller-retained transcript and checkpoint submission). No
    decision, invariant, oracle or validation entry changed from the approved revision 14.

Delivered vehicle

The stored-view refresh hop is pkg/bootstrap/versions/v4_0_19 - version "4.0.19", minimum
upgrade version "4.0.7", required protocol 118 (a pre-existing grandfathered gate), offset 2 -
registered on main's consolidated ladder behind upstream's v4_0_18 handle (upstream #31739
consumed the planned successor slot as "4.0.18", so the vehicle was renumbered after it). Its
tenant hop publishes both identities for existing accounts: a ready 4.0.7 cluster queues the
single direct [4.0.7 -> 4.0.19] upgrade executed by this handler alone, a main-era 4.0.18 stamp
queues the direct [4.0.18 -> 4.0.19] upgrade, older sources chain their per-handle rows through
the frozen 4.0.7 stage and the 4.0.18 handle, and the login/manual on-demand walks step every
successor handle (upstream's re-entrant planning loops with this PR's manual-walk completion
check); fresh accounts initialize at 4.0.19 with the published identities and run no leg.

Root causes

  1. information_schema.COLUMNS ([Bug]: ENUM/SET character length is missing and SET is misreported as numeric in information_schema.COLUMNS #30936) derived every declared-metadata field from the
    physical column type alone: internal_char_length(mc.atttyp) and
    internal_numeric_precision(mc.atttyp). ENUM is stored as an internal uint16 and SET as a
    uint64 bitmap, so both published SQL NULL for CHARACTER_MAXIMUM_LENGTH/
    CHARACTER_OCTET_LENGTH, while SET exposed its backing-store NUMERIC_PRECISION=20/
    NUMERIC_SCALE=0. The declared labels persisted in mo_columns.attr_enum were never
    consulted.
  2. information_schema.STATISTICS and SHOW INDEX ([Bug]: prefix-index length is missing from STATISTICS.SUB_PART and SHOW INDEX metadata #30935) published NULL literals and the
    string 'NULL' for SUB_PART/Sub_part, although prefix lengths are retained in
    mo_catalog.mo_indexes.algo_params.
  3. GENERATION_EXPRESSION ([Bug]: information_schema truncates valid generated-column expressions at 500 characters #30937) went through varchar(500) casts, silently truncating
    declared generated-column expressions longer than 500 characters.

Exact changes (shutdown-only delivery)

  • pkg/sql/plan/function: additive two-argument overloads
    (varchar,varchar -> int64) on internal_char_length/internal_char_size/
    internal_numeric_precision/internal_numeric_scale that derive character metadata from the
    declared ENUM/SET labels and suppress SET's bitmap numeric identity, plus the new
    mo_index_sub_part function. The historical one-argument overloads remain bound for
    definitions persisted by older binaries; the new ones carry no protocol requirement.
  • pkg/util/sysview: the current COLUMNS identity composes those label-aware overloads and the
    unbounded GENERATION_EXPRESSION projection on the #31160 binary-family NULL selector,
    under upstream fix(sql): enforce DECIMAL UNSIGNED and ZEROFILL attributes end to end #31739's attributed-DECIMAL COLUMN_TYPE decoration applied verbatim (COLUMN_TYPE
    pinned to varchar(65535), att_is_unsigned decked ancient rows - D13-2/D14-1); the current
    STATISTICS identity publishes retained prefix lengths as a numeric SUB_PART (actual SQL
    NULL for whole-column parts). Bootstrap init, CREATE ACCOUNT and subscription publication
    install these identities unconditionally: after main's fix(bootstrap): remove view scan and enforce complete tenant initialization #31662, CREATE ACCOUNT installs the
    complete current definition set or aborts, so this PR adds no rung, survey or authoring floor.
  • Historical-snapshot reader recognition (invariant I6): the snapshot adapter
    AdaptLegacyInformationSchemaColumnsDDL, the derived view-metadata seam
    ViewMetadataColumnsDDL and the migration gate IsInformationSchemaColumnsMigrationDDL
    recognize every recent published generation byte-stably - the historical templates, the
    base-era NULL-selector MEDIUMINT identity, and the exact upstream 4.0.18 published identity
    frozen independently of the mutable current constructor (InformationSchemaColumns4018DDL,
    D14-1) - next to the corrected current. Unknown or user-edited definitions stay refused with
    the unchanged error, IsCurrentInformationSchemaColumnsDDL stays exclusive, and snapshots keep
    their recorded projections and timestamp; the readers stay read-only.
  • pkg/bootstrap/versions: the v4_0_19 tenant hop carries the two shared-builder legs: the
    shared COLUMNS entry keeps its exact base shape (UpgSql = sysview.InformationSchemaColumnsDDL,
    protocol gate 109, exact-identity CheckFunc, DROP+CREATE), so refreshing an account installs the
    merged identity; the shared STATISTICS entry publishes the prefix-aware identity under the
    pre-existing STATISTICS gate (41). One idempotent rewrite per pre-existing account; completed
    legs never churn; a failed leg leaves the account marker untouched and retries.
  • pkg/bootstrap upgrade admission and continuation: upstream's re-keyed admission guards (the
    >= 4.0.7 line, the registered frozen-handle identity and the crossingPending route
    predicates) are adopted verbatim; this PR keeps the recovery-path guards (the frozen 4.0.7
    target's legacy-CDC admission and the offset-only resume rejection) that a final above 4.0.7
    otherwise bypasses, and adds the manual walk's in-transaction completion check (an account left
    below the cluster final returns cannot upgrade tenant version %s to current cn version %s
    instead of caching success) - upstream's loops alone lack it.
  • pkg/sql/plan: SHOW INDEX publishes Sub_part through mo_index_sub_part (numeric
    protocol type, actual SQL NULL without a retained prefix).
  • MO_INDEX_SUB_PART is id 623 (FUNCTION_END_NUMBER 624) after upstream fix(sql): enforce DECIMAL UNSIGNED and ZEROFILL attributes end to end #31739 allocated
    620..622 for the unsigned-Decimal admission checks; the id is internal plan wiring only and
    every view DDL references the name.
  • Deleted with their suites (the withdrawn mixed-version machinery): the MORPCVersion135
    constant and plan feature flag, the persisted-expression/remote-execution protocol mappings
    for it, the admission/authoring-floor branches in tenant publication, the
    FrozenViewServingBelowMetadataFloor read substitution and its serving-floor adapter, the
    metadata maintenance pass and its restore-compatibility/admission-interval tests. The
    pre-existing 118/126 admission handoffs, the VIEWS authoring fence, the 130-134 upstream
    planes and the columns/tables maintenance keep their base behavior untouched.

Issue-to-test proof

Defect oracles (unchanged red/green pair on base 7e0c9d94 vs the fixed tree; recorded probe
logs and full-suite receipts in the review evidence):

Delivery and history oracles (all green at the delivered head):

  • Publication (pkg/frontend, pkg/util/sysview) :
    TestCreateTablesInformationSchemaPublishesDeclaredMetadataUnconditionally proves fresh
    creation executes the corrected declared-label COLUMNS identity and the prefix-aware
    STATISTICS identity and never authors a predecessor identity, beside upstream's own
    TestCreateTenantInformationSchemaRequiresCurrentProtocol peer-answer rejection matrix.
  • Hop (pkg/bootstrap): rewrite/no-op/retry chains for the v4_0_19 hop - base-era
    NULL-selector and V110 tenants converge to exactly the published identities, a current
    tenant is a no-op, a mid-hop DDL failure leaves the marker untouched and repairs on retry,
    and a 4.0.13 account converges through the whole historical chain
    (TestColumnsUpgradeReachesExistingTenants; the maintenance keeps a single current identity
    across shared/maintenance/hop).
  • Upgrade admission and recovery (admission oracles re-derived at the three-handle
    registration, final 4.0.19): the ready 4.0.6, created-4.0.7, off-frozen-offset and
    interrupted offset-only routes keep upstream's terminal rejections (TestLegacyCDCAdmissionBeforeUpgradeMutation,
    TestV407RejectsDifferentOffsetBeforeCreatingRoute,
    TestV407RejectsInterruptedOffsetOnlyRouteBeforeMutation) including the recovery path, with
    the crossed-route non-rejection the pending-scan permits; the continuation oracles drive the
    real v4_0_7 handler plus the successor registration (late-login convergence from 4.0.6 to
    the final, already-4.0.7 manual upgrade, failure/retry without premature caching,
    second-login idempotence and the no-successor-SQL-before-4.0.7-completion ordering).
  • Historical transition H1a/H1b (design section 7): the base-era pair and the frozen
    InformationSchemaColumns4018DDL identity are recognized byte-stably at all three reader
    seams, an unknown definition stays refused at every seam, and with the live view at the
    corrected identity a snapshot recorded at the base-era or the 4.0.18 current definition binds
    and returns its recorded text with its projections and timestamp preserved, while the
    pre-refresh leg pins a live 4.0.18 definition still gating legacy adaptation (no silent
    pass-through).
  • Version-census oracles: route fixtures carry the composed route matrix (the single direct
    [4.0.7 -> 4.0.19] row, the direct [4.0.18 -> 4.0.19] row, three-leg chained census for
    below-4.0.7 sources, the frozen-4.0.7 resume admission), and
    pkg/tests/sqlintegration/TestCreateAccountCatalogInitialization and
    pkg/embed/catalog_view_identity_test.go derive their expected version from the registered
    final (GetFinalVersion), so renumbered vehicles no longer retire a version literal one by
    one.

Verification at the delivered head (repository CGo wrapper, real exit statuses in the round logs)

All green at the reworked head 61da7f8ef0: the full ./pkg/bootstrap/... ladder
(route/continuation/recovery/census, including the renamed vehicle's own versions/v4_0_19
suite and upstream's versions/v4_0_18 suite), the full ./pkg/util/sysview,
TestHistoricalViewColumnsSQL in pkg/sql/plan, the full ./pkg/sql/plan/function,
TestIssue30936* in ./pkg/tests/issues replaying the three issue reproductions,
TestCreateAccountCatalogInitialization|TestCollationsMetadataUpgrade in
./pkg/tests/sqlintegration, the pkg/embed catalog identity pair + caller-owned continuation
oracle, and the pkg/frontend publication oracle pair. The first full bootstrap pass at this
head also exposed that upstream's crossing-admission fixtures still modeled the upstream-only
route matrix; they were re-derived to this delivery's composed census (per design D13-7/D14-3,
no production change) and the focused rerun and full ladder rerun are green - the first-pass
failure is retained verbatim in the round logs as the fixture-round evidence. Earlier rounds'
receipts remain valid for the unchanged parts per the repository's evidence-reuse rules; the
distributed multi-CN BVT and hosted CI matrix remain CI work at the pushed head.

Residual risks

  • Main advanced during the ladder runs (mergeStateStatus: BEHIND), with no file-level overlap
    against this PR's 37 files; freshness is left to the merge queue rather than a rebase.
  • ENUM/SET declarations whose labels explicitly contain a comma remain split-interpreted end
    to end (metadata, SHOW CREATE TABLE and accepted values). This is the pre-existing
    attr_enum comma-join catalog encoding (unchanged base behavior); the boundary is
    documented in the design note (sections 2.3/4.3/8), pinned by
    TestInternalDeclaredLabelEncodingBoundaryOracle and
    TestIssue30936DeclaredLabelEncodingBoundary, and scheduled as a separate gated
    catalog-format follow-up.
  • Convergence is framework-timed by design: until a given pre-existing account's hop leg
    completes, that account keeps serving its pre-correction (readable) values - the same
    convergence timing every version-held correction has.

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Oct 27, 2026
@mergify mergify Bot added the kind/bug Something isn't working label Oct 27, 2026
@gouhongshen
gouhongshen force-pushed the agent/issue-30936-main-951252f3 branch from a068278 to 08a08b4 Compare October 27, 2026 23:53
@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: efb72346825daf719455aa6c5e4230841bd06cc8

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: efb72346825daf719455aa6c5e4230841bd06cc8

Assessment: approve

No actionable findings remain. The metadata corrections preserve historical readers, and the catalog migration covers existing and late-upgraded tenants. The earlier protocol-gate concern is resolved in this head.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

Validation:

  • Reviewed all 38 changed files, relevant owners and consumers, three linked issues, and all 16 discussion items.

  • Bounded static checks passed: frozen head, unchanged source, patch correspondence, gofmt, diff whitespace and golden-file scope.

  • Reused supplied exact-head successful build, UT, SCA, coverage and proxy/pessimistic BVT conclusions.

  • Saved review-plan.md, discussion-assessment.json, review-notes.md and validation-manifest.json; check receipts were reconciled with retained logs.

Limitations:

  • No local Go, SQL or race tests were rerun. Raw CI logs and author-local receipts were unavailable, so individual test execution and race mode were not independently certified.

  • Upgrade compatibility CI jobs were skipped and are not counted as passes.

  • Preexisting ambiguity in comma-containing ENUM label encoding remains outside this change.

@gouhongshen gouhongshen left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Codex automated review

Follow-up review of head efb7234 against the previously reviewed head 9f454cb. The delta is the rebase onto current main plus the renumbered delivery vehicle; the range contains no merge commit, so no conflict-resolution delta exists. The previously blocking topic, the per-feature MORPCVersion-135 gates with their mixed-version machinery, is fixed at the rework head and is still fully gone here: pkg/defines is unchanged versus main, MORPCLatestVersion stays 134, and no serving-floor, metadata-maintenance, or admission-survey code remains anywhere in the tree. aunjgr's inline finding and the two mo-bot CHANGES_REQUESTED reviews on that topic are answered by that rework, and I verified their substance in code, so there is nothing left to report from them. The new surface this round reworks the vehicle onto the consolidated ladder: a v4_0_8 tenant hop as the direct successor of the frozen 4.0.7 stage with two shared-builder MODIFY_VIEW legs (COLUMNS at the historical 109 gate, the prefix-aware STATISTICS identity at 41), the four upstream upgrade-admission guards keyed on final == '4.0.7' re-keyed onto a >= 4.0.7 comparison plus the registered 4.0.7 handle identity, and the login and manual on-demand walks continuing via upgradeTenantToFinalVersionOnDemand to the cluster final before success is cached, keeping mid-walk failures resumable from the committed create_version. I checked the fix from first principles: the label-aware overloads derive metadata only for T_enum/T_uint64 columns carrying declared labels, with empty-domain, NULL-label, BIGINT UNSIGNED, geometry-SRID and JSON-array branches all handled; the STATISTICS and SHOW INDEX projections are legal under their GROUP BY after the algo_params addition; the historical V110 and NULL-selector COLUMNS identities are recognized byte-stably at all three snapshot-reader seams; and the four changed distributed-BVT expectation rows match the new identities, with no stale prefix-index expectations elsewhere in the suite. Verification at this head through the repository CGo wrapper, all with real exit statuses: full ./pkg/bootstrap/... including the new v4_0_8 package, ./pkg/util/sysview, ./pkg/sql/plan/function, the pkg/frontend publication oracles, pkg/sql/plan TestHistoricalViewColumnsSQL, the embedded-cluster oracles TestIssue30936* (4/4 pass: declared ENUM/SET metadata on both CNs, numeric and NULL SUB_PART through STATISTICS and SHOW INDEX, unbounded GENERATION_EXPRESSION, encoding boundary), the previously CI-failing TestCreateAccountCatalogInitialization, and pkg/embed TestCallerOwnedTenantUpgradeRollsBackAndRetries, all pass. Limitations: I did not run the distributed multi-CN BVT, race mode, or the hosted CI matrix; hosted-CI failures the author attributes to upstream code (e.g. the data race inside issue_31401_test.go) were not reproduced and I attribute them to upstream as the author does. One non-blocking P2 on test hygiene remains, described in the findings; there are no blocking findings, so this verdict is COMMENT.

P2 - pkg/embed tenant-walk oracle pins the literal 4.0.8 instead of deriving it from the registered final (pkg/embed/catalog_view_identity_test.go:271)

TestCallerOwnedTenantUpgradeRollsBackAndRetries pins the literal "4.0.8" at lines 271 and 280 to assert that the caller-owned walk continues past the paged 4.0.7 stage to the registered final. This exact version-literal pin class already broke this PR's CI twice: run 40792282505 failed UT Coverage on the pkg/embed pin ("4.0.7" at the previous head), and run 40932194894 failed UT Coverage on the sqlintegration literal, which commit efb7234 then fixed by deriving the expectation from the bootstrap registry itself (GetBootstrapService().GetFinalVersion()). The embed oracle holds the same service handle in scope at line 239 (svc.GetBootstrapService()), so both assertions could compare against the registered final and keep their meaning: the observed walk outcome equals the registry's final version. As written, every future registered upgrade hop retires this literal again and re-breaks the package in CI until it is edited by hand, repeating the failure mode this round spent a commit repairing. The walk behavior itself is correct and verified passing at this head; this is purely test-hygiene and does not block the change.

@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: efb72346825daf719455aa6c5e4230841bd06cc8

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: efb72346825daf719455aa6c5e4230841bd06cc8

Assessment: approve

No actionable findings remain. Metadata corrections, historical readers and tenant-upgrade continuation are coherent. The earlier protocol-gate concern is resolved; the new test-version literal suggestion is nonblocking.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

Validation:

  • Reviewed all 38 changed files, relevant owners and consumers, three linked issues and all 19 discussion items.

  • Bounded static checks passed: frozen head, unchanged source, patch correspondence, formatting, whitespace, complete golden transformations and discussion coverage.

  • Reused supplied exact-head successful build, UT, SCA, coverage and proxy/pessimistic BVT conclusions.

  • Saved review records and reconciled check receipts with retained logs in validation-manifest.json.

Limitations:

  • No local Go, SQL or race tests were rerun. Raw CI logs and author-local receipts were unavailable; individual test execution and race mode were not independently certified.

  • Upgrade compatibility CI jobs were skipped and are not counted as passes.

  • Preexisting ambiguity in comma-containing ENUM label encoding remains outside this change.

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

The per-feature mixed-version gate I previously flagged is removed. The current design approval and upgrade vehicle are not accurately represented in the delivery record, so this review stops at the design-artifact gate rather than approving the implementation.

… full generated expressions (matrixorigin#30936, matrixorigin#30935, matrixorigin#30937)

Declared catalog metadata published through information_schema.COLUMNS:

- ENUM/SET columns report CHARACTER_MAXIMUM_LENGTH and
  CHARACTER_OCTET_LENGTH from the declared labels, and
  NUMERIC_PRECISION/NUMERIC_SCALE as NULL instead of the physical OID
  projections (issue matrixorigin#30936).
- COLUMN_TYPE composes upstream matrixorigin#31739's attributed-DECIMAL decoration
  (varchar(65535) pin, att_is_unsigned) over the label-aware current.
- GENERATION_EXPRESSION keeps the full stored expression instead of the
  varchar(500) double cast (issue matrixorigin#30937).
- information_schema.STATISTICS and SHOW INDEX report SUB_PART as a
  numeric prefix length with SQL NULL for non-prefix indexes instead of
  the string 'NULL' (issue matrixorigin#30935).

Delivery: upstream matrixorigin#31739 consumed the planned successor slot as "4.0.18",
so the refresh vehicle is renumbered to v4_0_19 ("4.0.19"), registered
behind v4_0_18. Its tenant hop publishes both identities for existing
accounts - a ready 4.0.7 cluster queues the single direct [4.0.7 ->
4.0.19] route, a main-era 4.0.18 stamp queues [4.0.18 -> 4.0.19], older
sources chain their per-handle rows and the on-demand walks step every
successor handle; fresh accounts initialize on the published identities.

History: every recorded COLUMNS generation keeps binding. Snapshots
recorded under the base-era binary-null template and under upstream's
published 4.0.18 identity are frozen and recognized byte-stably at the
historical adapter, the derived-metadata and migration-gate seams, so a
snapshot read after the refresh keeps its recorded projections and
timestamp; unknown or user-edited definitions still fail with
'unsupported historical information_schema.COLUMNS definition'.

MO_INDEX_SUB_PART is renumbered to 623 (FUNCTION_END_NUMBER 624) after
upstream allocated 620..622 for the unsigned-Decimal admission checks; the
id is internal plan wiring only.

Test evidence: pkg/tests/issues TestIssue30936 replay the three issue
reproductions; sysview identity and seam oracles pin the byte-stable
frozen templates; bootstrap route/continuation/recovery suites cover the
direct and chained censuses, and upstream's crossing-admission fixtures
(service_upgrade_crossing_test.go) are re-derived to this composed route
matrix - final row 4.0.19/2, three-leg chained routes, the single direct
4.0.7 -> 4.0.19 row, and the frozen-4.0.7 resume admission counting its
second legacy-CDC gate read; the plan-side historical reader oracle covers
the 4.0.18-era snapshots and the migration-gate pre-refresh leg; BVT rows
rendering the published identity are regenerated from the merged
constructor.
Documentation-only change requested by PR matrixorigin#31489's implementation
review; no code or test change.

The status block now records the design-first approval chain and the
delivered vehicle: the delivered design content is the independently
approved revision 14 (sha256
22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66),
implemented at PR matrixorigin#31489 head
61da7f8, following PASS-approved
revision 9 (sha256
57043aac71c74a7cb63f0a8ac047a4ac898bf974791644569e5c57f4bd2838d9,
2026-10-28) and revision 12 (sha256
47ebfe15a45940221c3d2d5ad6955e11a5c89a1a909fa9d4e382e1ac9db0a599,
2026-10-29); the revision history records every reviewed revision's
exact content hash and PASS/REQUEST_CHANGES disposition, and the
approval artifacts are the design-review records in this PR's chain.

The approved D13/D14 amendments are folded into the standing sections
(refresh vehicle renumbered to 4.0.19 behind upstream's 4.0.18 handle,
frozen InformationSchemaColumns4018DDL() recognition at the reader
seams, census-derived population oracles, recovery/recheck shapes),
and the transient per-round implementation and rebase narratives move
out of this tracked document into the PR's review threads and retained
review evidence. Every decision, invariant, oracle and validation
entry keeps its approved wording; the approved revision-14 wording
governs wherever this consolidation could be read as a change.

Revision 15 content sha256:
551fb06436f784e8b75fa9c7d37702ea47379ed5902256b8188d1dfcacb22f6c
@XuPeng-SH

XuPeng-SH commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 38901ce0e77c413966d8e775b639b05d42e227b6

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: 38901ce0e77c413966d8e775b639b05d42e227b6

Assessment: approve

Reviewed the complete delta and relevant consumers. Metadata corrections, historical view recognition, and 4.0.19 upgrade paths are coherent. Prior protocol-gate and design-record concerns are resolved; no actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

Validation:

  • Reused supplied exact-head successful build, UT, SCA, coverage, and multi-CN BVT results.

  • Static audit passed: clean source, frozen constructor preservation, golden changes, function IDs, and complete discussion coverage. Receipt: checks/1793366386295029479-2.json; log: static-audit.log.

  • Saved review-plan.md, review-notes.md, discussion-assessment.json covering all 25 entries, and validation-manifest.json.

Limitations:

  • No local Go or race tests run. CI raw logs were unavailable; upgrade-compatibility jobs were skipped.

  • The preexisting ENUM embedded-comma encoding ambiguity remains an accepted scoped limitation.

aunjgr
aunjgr previously requested changes Oct 30, 2026

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

The delivery record now correctly identifies the 4.0.19 vehicle and the revised design content. The earlier mixed-version gate concern remains resolved. The approval trace still asserts an independent PASS for revision 14 by date and hash without identifying/linking the actual design-first decision. Please make that existing decision accessible, tied to content hash 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66 and its reviewer. A link to retained external evidence is sufficient; do not commit raw logs or repeat a review already performed. This is the remaining design-gate finding, not a claim of a new runtime defect or a full implementation approval.

@XuPeng-SH

XuPeng-SH commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 38901ce0e77c413966d8e775b639b05d42e227b6

"interrupted"

… delivered revision

Revision 16 (documentation-only): the status block's approval trace and the
revision history now identify the actual design-first decision for the
delivered revision 14 and its reviewer, tied to the approved content hash
22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66, and link
the retained external evidence: the public byte link of the approved content
(the commit whose document hashes to that value), the durable verbatim
decision record gist, and the controller-retained review transcript and
checkpoint submission. No design decision, invariant, oracle or validation
entry changed. Answers the design-gate review of 2026-10-30T13:43:27Z.
@gouhongshen

Copy link
Copy Markdown
Contributor Author

Handled at head a62c3387bf (documentation-only; the implementation content of head 61da7f8ef0 is untouched).

The existing design-first decision is now identified and linked. It is the controller-run independent pre-PR design review of 2026-10-30: a read-only, ephemeral Codex review session under the fix-issue-loop-local-reviewer contract, provider-separated from the implementing handler (reviewer model gpt-6.1-sol, reasoning effort xhigh; implementing handler Grok CLI magpie/tass/glm-5.3; controller run 3dedc8b010734de9ba6a4c92c3fdf56e, review session thread 01a18bcc-5369-7d91-ae66-c072a48a5b1e, run window 2026-10-30T07:53:04Z-07:59:46Z, exit 0). Its retained decision is approved: true (PASS - design only, no findings) at 2026-10-30T07:59:46Z for exactly revision 14 at sha256 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66.

Retained external evidence:

Design revision 16 (sha256 2df7a7dfef372bf41feb160c3c3252ac9f1d6b3522106c94fe1e3f5d038d9f8d, documentation-only; commit a62c3387bf) records this decision of record in the tracked document's status block and revision history, and the PR description carries the same links. No completed review was repeated, and no raw review transcript is committed to the repository.

@gouhongshen

gouhongshen commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Unresolved unrelated CI blocker record (auto-maintained by the issue-fix-loop handler for issue group #30936):

@XuPeng-SH

XuPeng-SH commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: a62c3387bfc0b3d1c53c8db0503d9c8447c0d18c

Review discussion changed before publication; a fresh contextual review is queued.

@gouhongshen gouhongshen left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Codex automated review

Follow-up review of head a62c338 against the previously reviewed head 38901ce. The delta is documentation-only: design doc revision 16 in docs/design/20261026-declared-catalog-metadata-publication-and-repair.md, with zero Go or test file changes, so the implementation (committed at 61da7f8) is byte-identical to what prior rounds reviewed. Disposition of my prior blockers: (1) the per-feature MORPCVersion-135 mixed-version gate machinery from the first round was removed at 9f454cb and remains absent (MORPCLatestVersion stays 134, pkg/defines untouched); (2) the delivery-record inaccuracy about the design approval and upgrade vehicle was corrected at 38901ce and still reads correctly; (3) my remaining design-gate blocker from 2026-10-30T13:43:27Z — the approval trace asserted an independent PASS for design revision 14 by date and hash without identifying or linking the actual design-first decision — is fixed at this head. Revision 16 now names the reviewer (the issue-fix-loop controller's independent local reviewer, a read-only ephemeral Codex session under the fix-issue-loop-local-reviewer contract, model gpt-6.1-sol, controller run 3dedc8b010734de9ba6a4c92c3fdf56e, thread 01a18bcc-5369-7d91-ae66-c072a48a5b1e, PASS at 2026-10-30T07:59:46Z) and links durable external evidence at gist f1120ed42e7a71f75afa79d1ff8b5bc2. I independently verified every checkable claim: the gist is public and contains the verbatim approved:true PASS JSON tied to design revision 14 at sha256 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66 plus reviewer identity and provenance; the document committed at implementation head 61da7f8 byte-hashes to exactly that approved value; the current revision-16 document hashes to 2df7a7dfef372bf41feb160c3c3252ac9f1d6b3522106c94fe1e3f5d038d9f8d as the author states; and the PR description carries the same links. No raw transcript was committed and no completed review was repeated, matching the blocker's constraints. Other reviewers: mo-bot approved the identical code at 38901ce with no actionable findings; the earlier Codex review's non-blocking P2 test-literal suggestion was raised by that reviewer and is not re-emitted here. No blocking or non-blocking findings remain. Limitation: I did not re-run Go tests because the delta since the last validated head is markdown-only and would exercise byte-identical code; focused-suite passes at the implementation head are recorded in the 2026-10-29 review comment.

@XuPeng-SH

XuPeng-SH commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: a62c3387bfc0b3d1c53c8db0503d9c8447c0d18c

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: a62c3387bfc0b3d1c53c8db0503d9c8447c0d18c

Assessment: approve

Complete review closed with no actionable findings. Metadata corrections, historical readers and migration paths remain coherent. The new discussion confirms the resolved design-decision concern.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

Validation:

  • Revalidated frozen source and complete patch identity, qualifying reuse of the full implementation analysis.

  • Verified the accessible design PASS and both document hashes; classified all 33 discussion entries.

  • Reused supplied exact-head successful build, UT, SCA, coverage and multi-CN BVT conclusions.

  • Static audit passed; receipt checks/1793379707320834829-2.json matches static-audit.log. Review records and validation-manifest.json are saved.

Limitations:

  • No local Go, SQL or race tests rerun. Raw CI logs were unavailable, so individual test execution and race mode were not independently certified.

  • Upgrade-compatibility CI jobs were skipped.

  • Preexisting ambiguity in comma-containing ENUM labels remains outside the accepted scope.

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

1 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Fri 30 Oct, 17:33 · rule main · triggered by rule Automatic queue on approval for main
  • 🚫 Left the queue 17:34 · a62c338

Reason

The pull request can't be updated

GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/ci-cancellation.yml without workflows permission
GitHub only lets Mergify write to .github/workflows/ with the workflows permission. An organization owner can accept Mergify's pending permissions at https://dashboard.mergify.com/orgs/matrixorigin/repositories.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

This branch was successfully deployed

No deployments
ci — 28acf50a Deployed Oct 30, 2026 by XuPeng-SH
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.

5 participants