Repository navigation
feat(collation): add versioned metadata with legacy-only admission - #29503
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
Design-first phase only, exact revision 896c781965f2e7d112216a4f640cd1404abf823e; this is NOT implementation approval.
Scope/trigger: C01 adds collation identity/revision/provenance and physical-format metadata across Type/plan/pipeline/catalog and a tenant presentation upgrade; wire/persistence/upgrade and multiple owners require the feature-design gate. Reviewed docs/design/CLAUDE_issue-29480-collation-metadata.md including the current UTF32 DDL-only and 4.0.12 amendments.
Design decision: PASS the bounded proposal. One immutable capability owner; preserve released 0–3 identities, native Type size/offsets and legacy key/codec bytes; validate before narrowing; separate structural round-trip capability from production admission; known future identities/revisions/formats remain disabled. Existing codecs, factories, catalog/cache and upgrade transaction retain ownership; no new state machine/cache/worker or per-key metadata. Runtime fields and expression provenance have distinct conversion responsibilities. Fixed metadata/plan memory costs are disclosed. The existing-padding-slot approach is preferable here to enlarging the native layout or adding a sidecar registry.
Accepted policy: utf8/utf8mb3 remain silent utf8mb4 compatibility aliases; UTF32 compatibility is DDL-only, not a new conversion/session/native encoding capability; new latin1 requests are rejected while validated historical session restoration is a separate existing-owner path. Review considers persisted data and offline homogeneous upgrade, not mixed-version rolling-upgrade support. The 4.0.12 presentation refresh uses the existing tenant transaction/completion owner and does not rewrite user keys or activate a native domain.
Implementation must still prove the producer/consumer admission matrix, unknown-value rejection without truncation/panic, opaque vector/aggregate cleanup, restart/offline upgrade and proportional runtime cost. I am checking those separately against this accepted proposal; document status and author-reported historical validation are not substitutes for implementation evidence.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Implementation review on exact head 896c781965f2e7d112216a4f640cd1404abf823e, merge-base 43c37847b16d37cfa8b9eef4235ba4388b5e25ce. No subagents or product edits.
Decision: REQUEST_CHANGES for one independently reproduced admission regression. The bounded C01 proposal passed a distinct design-first phase in review 5416586983; the implementation below deviates from its DDL-only UTF32 contract.
[P2] Do not use the DDL alias resolver to bind CONVERT USING. bindConvertUsingCharset now calls charsetForName, which delegates to collation.ResolveDDLCharset. That intentionally accepts UTF32 as a DDL-only utf8mb4 alias, whereas the actual conversion kernel calls collation.ResolveCharset and rejects UTF32. The resulting outer plan.Type is legacy identity 3/revision 0, so RequireLegacyCollations cannot identify the unsupported conversion later.
Independent parsed/public-planner probes on this exact head:
SELECT CONVERT(c USING utf32) FROM select_test.bind_selectreturns a non-nil plan and nil error, despite the expression-domain prohibition.CREATE VIEW reviewer_c01_utf32_view AS SELECT CONVERT(c USING utf32) AS c FROM select_test.bind_selectalso returns a non-nil plan and nil error. The CreateView executor persists the planned view definition, not the SELECT evaluation; the bad request is therefore admitted at the durable-definition boundary rather than rejected before publication. I verified the accepted DDL plan and traced that publication path; I am not claiming a newly executed SQL-server persistence/restart test.- Same-head runtime-kernel race probe rejects UTF32 with
unsupported character set 'utf32'. Supported utf8/utf8mb3/utf8mb4/binary controls preserve the four-byte input. - Same-head DDL UTF32 control remains accepted, and unsupported latin1/ascii/gbk expression controls are rejected. The intended compatibility policy is not itself the defect.
- The same parsed SELECT/CREATE VIEW rejection assertions PASS on the clean exact merge-base, including the DDL UTF32 control. Candidate assertions FAIL in both normal and race runs. This is PR-introduced, not an upstream/base flaky failure.
Reuse the existing non-DDL capability owner for expression binding, matching the evaluator; retain the DDL-only alias for DDL. Add a small orthogonal matrix covering expression binding, durable view admission, the DDL control and supported compatibility aliases. Do not fix this by enabling UTF32 conversion globally, adding another name switch, or merely changing the expected result to accept the invalid plan. Existing helper-only UTF32/session tests and latin1-only CONVERT tests miss this crossed-owner case.
Implementation/design quality examined: fixed immutable common capability owner replaces the old protocol/name mappings; runtime Type remains 16 bytes at unchanged offsets; released identities/legacy codec and key bytes are preserved; expression provenance is distinct from runtime metadata; checked readers validate before narrowing; plan/cache/deep-copy/engine/schema propagation preserves fields; opaque LiteralVec/PK IN/remote vectors and aggregate states use their actual decoded types and existing cleanup owners. The 4.0.12 tenant presentation refresh reuses the upgrade transaction and canonical completion predicate, preserving the upstream 4.0.11/protocol-106 step. No new worker/cache/queue, key rewrite, native-domain activation or mixed-version rollout is approved here.
Fresh evidence: CPU native artifacts rebuilt through top-level make cgo, with pinned/checksum-verified ONNX prebuilt input, then provenance verified. Go 1.26.4 darwin/arm64. Independent candidate normal/race counterexamples FAIL as described, exact clean-base control PASS; runtime conversion probe -race PASS. The focused cross-owner race run executes 29 roots across 13 packages and terminates exit 0 (three additional selected packages contain no matching tests and are not counted as executed cases). A separate full owning-package -race run for all 11 selected capability/type/vector/protobuf/object/catalog/TAE-container/upgrade/postprocess/Bloom packages terminates exit 0, including native-layout/legacy golden and zero-allocation checks. C Bloom test executable PASS, including initialized padding and unchanged wire-length round-trip. Early native preflight refusals caused by the generated dSYM artifact were environmental guard failures, not product failures; it was moved outside native inputs and the successful runs requalified provenance. Non-result whitespace check PASS; full diff-check reports two result-golden trailing-space lines, not silently claimed clean.
Scope/limits: 153 files +7806/-4273; non-generated production/build 2264 changed lines, tests/results 3316, docs 159, generated 6340. Reviewed design, production ownership/conversion/admission/recovery paths, changed test contracts and BVT intent; this decision does not clear every generated binding/result hunk or claim fresh BVT, full frontend/planner suites, restarted durable upgrade or SQL throughput evidence. No performance gain is inferred from metadata propagation; the plan/Expr +16-byte resident increment is explicit and no per-row/key registry state is added. No historical human inline comments were returned; the older implementation approval is at 9e5f50c, not this exact head. Logs and independent overlays are under /private/tmp/mo-review-five.HHHg3U.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
Reviewed head 896c781 against merge-base 43c3784 (153 files, +7806/−4273). Verdict is REQUEST_CHANGES for one blocking hot-path cost regression in the new plan admission fence, plus one non-blocking upgrade-compatibility gap.
Blocking: RequireLegacyCollations (pkg/pb/plan/collation_metadata.go:63) admits plans through an untyped reflect walk of the whole owner graph, and it runs at least twice per statement (pkg/sql/plan/build.go:632 and pkg/sql/compile/compile2.go:135). Measured on this exact head it costs ~120 µs and ~25 KB of garbage per KB of serialized plan — 50–75× a typed traversal of the same message graph — i.e. 163 µs/719 allocs/25.8 KB for a small 8-column point-select plan and 6.9 ms/30 492 allocs/1.2 MB for a 57 KB plan. The design gate for this PR explicitly required the implementation to prove proportional runtime cost, and the existing implementation review explicitly withheld SQL-throughput clearance, so this axis is open and not a duplicate.
Non-blocking: persisted global collation_server spellings that base accepted and aliased (latin1_swedish_ci, ascii_general_ci) are now rejected by the DDL resolver, so every unqualified CREATE TABLE fails in such tenants after upgrade; the 4.0.12 tenant entry only rebuilds information_schema.CHARACTER_SETS.
Not duplicated: XuPeng-SH's open [P2] at pkg/sql/plan/base_binder.go:8657 (bindConvertUsingCharset → charsetForName → ResolveDDLCharset admitting DDL-only utf32 into CONVERT USING while the kernel calls ResolveCharset) is still unaddressed at this head. I independently confirmed the crossed-owner routing and add nothing to it.
Deliberately not raised: the narrowed handshake/change-user collation set is documented policy (design doc: latin1/latin1_* rejected for DDL, session/global settings, handshake/change-user and CONVERT), and the retained IDs cover the collations MO actually implements; the historical-value exception is scoped there to validated session snapshots. Also verified clean on this head: proto field numbers are freshly assigned with no wire-tag reuse; Charset=255 stays the numeric-CAST marker and is exempted in Type.ValidateCollation; SameCollation's added provenance fields are behavior-preserving because the coercibility fields are never set non-zero on compared values; DeepCopy/hash/plan-cache propagation preserves the new fields; the generated Unmarshal validation injection is idempotent; bloom.c padding memset and the Batch.ReadFrom cleanup fixes are sound; and the per-vector/per-batch fence sites (single plan.Type owner) cost ~106 ns with 0 allocs, so the fence concept is not the problem — only the whole-tree reflect walk is.
P1 - Whole-plan reflect walk in RequireLegacyCollations adds ~120 µs and ~25 KB of garbage per KB of plan, twice per statement (pkg/pb/plan/collation_metadata.go:63)
RequireLegacyCollations admits an owner by untyped reflection: it recurses over every struct field, slice element, map value, pointer and interface of the whole graph (lines 64–134), and calls v.Interface() at each node (line 86), which boxes every scalar and allocates a fresh copy of every struct it inspects. There is no gate, no cache across calls, and no early exit for plans that contain no string type.
It sits on the per-statement path at least twice: pkg/sql/plan/build.go:632 walks the finished *Plan in BuildPlan's defer, and pkg/sql/compile/compile2.go:135 walks the same plan again at Compile entry. On top of that, pkg/sql/colexec/evalExpression.go:233, 266, 298 and 2196 re-walk overlapping expression subtrees once per operator during pipeline setup, and pkg/sql/compile/remoterun.go:2224 walks the whole decoded remote pipeline.
Measured on this exact head (Go 1.26.4 darwin/arm64, external module with a replace to this worktree; synthetic but realistic single-table scan plans carrying a full TableDef with Cols/Defaults/Pkey/Indexes/Name2ColIndex/Createsql, Stats, ObjRef, one PK filter and N projected columns):
- 8 cols, 1160 B serialized: 163–172 µs per walk, 719 allocs, 25.8 KB
- 32 cols, 3722 B: 453–478 µs, 2139 allocs, 83 KB
- 128 cols, 14 078 B: 1.64–1.81 ms, 7810 allocs, 310 KB
- 512 cols, 57 857 B: 6.87–7.01 ms, 30 492 allocs, 1.22 MB
Cost is linear at ~120–124 µs per KB of serialized plan, and 50–75× a typed traversal of the identical message graph (generated ProtoSize as the typed-walk proxy: 2.3 µs / 8.6 µs / 36–54 µs / 131–137 µs respectively).
Impact: a point select on an 8-column table pays ~330 µs of pure reflection CPU and ~51 KB of garbage before any execution work starts; a wide 512-column plan pays ~14 ms and ~2.4 MB per statement. At OLTP QPS this is both a latency regression and a substantial GC load, and it grows with plan size, so the widest analytics plans are hit hardest.
Why this is blocking rather than a tradeoff: the fence only needs to inspect Type, TableDef and IndexDef nodes, but it pays for the entire plan graph. The design gate for this PR required the implementation to prove proportional runtime cost, and the existing implementation review explicitly did not clear SQL throughput evidence, so this axis is still open. The cost here is not proportional to the metadata being validated.
For contrast, the cheap sites prove the concept is fine: a single plan.Type owner (pkg/sql/compile/remoterun.go:2917, pkg/sql/colexec/evalExpression.go:418) costs ~106 ns with 0 allocs.
Suggested direction, not a prescribed implementation: reach the same admission contract through typed traversal of the known owners (hand-written or generated visitors over Plan/Query/Node/Expr/TableDef/IndexDef — the repo already has generated DeepCopy and ProtoSize traversals of exactly these messages), validate once at the plan boundary rather than twice, and then drop the now-redundant per-operator expression re-walks. Please also capture a before/after statement-cost measurement for a small point select and a wide-table plan as evidence.
P2 - Persisted global collation_server values accepted before this PR now break every unqualified CREATE TABLE, with no upgrade normalization (pkg/sql/plan/build_util.go:515)
collationForName now delegates to collation.ResolveDDLCollation (build_util.go:515), which resolves through ResolveSQL → Lookup over the closed 12-entry definitions table in pkg/common/collation/metadata.go:128. latin1_swedish_ci and ascii_general_ci are not in that table, so both resolve to false.
Base accepted both spellings: origin/main's collationForName explicitly listed latin1_swedish_ci and ascii_general_ci and aliased them to types.CharsetUTF8, and base had no charset validation on system variables at all (no validateCharsetSystemVariable exists at origin/main), so SET GLOBAL collation_server='latin1_swedish_ci' succeeded and was persisted. Such a tenant worked normally before this PR, because tableDefaultCharset aliased the value to identity 3.
After this PR the same persisted value flows into tableDefaultCharset (build_util.go:566), which reads the global at build_util.go:604 via ctx.ResolveVariable("collation_server", true, false) and now returns unsupportedCollationError at build_util.go:617. The consequence is broad rather than per-request: every CREATE TABLE without an explicit charset/collate option in that tenant fails (build_ddl.go:3326), and the SHOW/ALTER paths that reuse the same resolver (build_show_util.go:932, build_alter_table.go:1377) fail too, until an administrator runs SET GLOBAL collation_server to a supported spelling.
The 4.0.12 tenant upgrade does not cover this: pkg/bootstrap/versions/v4_0_12/tenant_upgrade_list.go contains a single entry that only deletes and rebuilds information_schema.CHARACTER_SETS presentation rows. It does not inspect or normalize persisted charset/collation system variables. The design document's historical-value exception is scoped to validated session snapshots restored through a separate entry, not to persisted global variables.
I am not asking for latin1 to be re-admitted — rejecting new latin1 requests is approved policy and I agree with it. This is about the fate of an already-persisted value that base wrote successfully. I am reporting it as non-blocking because the affected set is narrow (exactly two spellings), the failure is loud rather than silent, it cannot silently corrupt data or keys, and it is immediately recoverable by an admin. Suggested handling: either normalize/validate persisted charset and collation globals as part of the 4.0.12 tenant entry so an upgrade cannot leave a tenant unable to run unqualified DDL, or record the required administrator action in the upgrade/release notes.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of 50553f0 against base/merge-base c659910. APPROVE: no remaining blocking finding identified. Reviewed directly, without subagents.
Previous comments
- XuPeng-SH P2, UTF32 expression admission: closed.
bindConvertUsingCharsetnow uses the same non-DDL capability resolver as execution. Parsed SELECT and CREATE VIEW reject UTF32 and other disabled domains before publishing a plan; UTF32 DDL compatibility and supported UTF8/UTF8MB3/BINARY controls remain. The corresponding current-head planner regression passes normally and under-race. The SQL regression also checks that the rejected view does not exist. - gouhongshen P1, reflective whole-plan traversal: closed. Ordinary plans now use generated typed traversal of metadata-bearing edges, not scalar-by-scalar reflection/boxing. Cycle/shared-node bookkeeping is per invocation, with an inline small-plan buffer and a map only after overflow. Producer and mutable/direct execution boundaries remain checked. The foreign Pipeline adapter still delegates plan-owned structures to the typed visitor.
- Historical GLOBAL latin1/ascii defaults: addressed by an explicit documented upgrade prerequisite, not automatic migration. Section 10 requires supported GLOBAL defaults before upgrade and verification after reconnect. This follows the previous comment's documentation alternative; it does not make these installations transparently upgradeable. Existing data identities/keys remain distinct from admission of new requests.
Design and implementation
The legacy-only C01 boundary is coherent. common/collation owns capability definitions; codecs own structural validation and metadata preservation; planner/execution boundaries own rejection of disabled semantics; the existing tenant-upgrade framework owns the presentation refresh. The generated visitor contains traversal rather than a second capability registry. These are different responsibilities, not independent competing state machines.
Reviewed the public DDL/SET/handshake routes, plan/runtime conversions, deep copies and identity comparisons, protobuf/catalog recovery, opaque LiteralVec/PK-IN/remote-batch/aggregate-state paths, Substrait boundaries, and tenant upgrade. Rejection cleanup remains with existing vector/batch/aggregate owners. The Bloom change initializes the existing serialized allocation without changing its size. The test-only snapshot/clone fixes establish commit/readiness ordering and bounded cleanup rather than retrying failed assertions.
Native Type remains 16 bytes and the manual encoding remains 20 bytes. Revision-zero IDs 0–3 retain their interpretation; this PR does not enable native collation algorithms or rewrite user data/physical keys. The extra 16 bytes in plan Type/Expr and the added admission work are explicit costs. Rolling mixed-version operation is not part of this approval; offline data compatibility is.
Independent validation this review
- Full normal suites passed:
pkg/common/collation,pkg/pb/{plan,api},pkg/container/{types,vector},pkg/vm/engine/tae/containers,pkg/sql/colexec/aggexec. - Focused current-head planner/frontend/compile/aggregate/4.0.12-upgrade regressions passed. Focused
-race -count=1passed in seven packages: pb/plan, container/types, container/vector, aggexec, sql/plan, frontend, sql/compile. All commands reached terminal exit 0; nonmatching selections were not counted. - A separate reviewer probe enumerated actual Go protobuf fields and registered oneof variants, independently of the generator. 1,913 metadata injection/repair checks across Plan, Query, Expr, TableDef and Pipeline passed, including under race. A separate 80-expression probe checked visited-map overflow, a cycle/shared node, late invalid metadata and mutation between calls. These are bounded structural challenges, not a claim to enumerate every possible runtime graph.
- Both generator/postprocessor test suites passed. Regenerated
plan.pb.goandapi.pb.gowith protoc 3.21.1 plus the repository postprocessor: byte-identical. Regenerated SQL parser: identical except the command-line/output-path header. The admission generator's checked-in-output reproducibility test passed. - Local native tests used source-identical, clean native inputs and a verified CPU/release provenance stamp from the existing isolated PR artifact; the primary worktree was not used or modified.
Same-owner benchmark, two admission checks per operation, Darwin/arm64 Apple M4, 100ms samples:
| Plan | Previous reflection | Typed visitor | Allocations before → after |
|---|---|---|---|
| 8 columns | 61.8 µs | 1.24 µs | 1,400 → 0 |
| 512 columns | 2.97 ms | 141 µs | 62,962 → 30 |
The 512-column allocation volume drops from about 2.47 MB to 211 KB. This validates removal of the reported admission regression, not a throughput improvement over main or an end-to-end ClickBench/TPCH result.
Current-head CI independently reports passing Ubuntu UT, SCA, proxy and pessimistic multi-CN BVT, Coverage and CI Required (run). Full distributed/offline-upgrade runs were not repeated locally in this review; those broader claims rely on the recorded author evidence and applicable CI, not on the focused local tests.
Engineering/test increment
Assessed the 159-file change by category: implementation/build +1,822/-719, tests/goldens +3,135/-570, generated +4,896/-2,989, design +168. The generated traversal and codec-boundary tests have concrete correctness/performance purposes; there is no new long-lived cache or lifecycle owner. The charset golden reformat preserves existing result values apart from the intended new admission/SHOW/alias cases. Its trailing whitespace is result data, not a source-code cleanup request. The design document states the final contract and costs; approval is for that bounded contract, not future native activation.
iamlinjunhong
left a comment
There was a problem hiding this comment.
Manual MatrixOne review of exact head 50553f0841282a093fdb26e5fa7772ef91537672 against base c65991043b10fb39988d45b72af1485560ac5433.
Decision: APPROVE. No current confirmed P0, P1, P2, or P3 finding identified within the reviewed legacy-only C01 contract.
Reviewed the production diff across the capability owner, runtime/manual codecs, protobuf metadata and generated admission visitor, SQL and session/protocol admission, plan/runtime conversions and copies, compiler/pipeline boundaries, decoded literal/PK-filter/batch/aggregate state, catalog/schema propagation, Substrait export, and the 4.0.12 tenant metadata refresh. Also inspected the associated regression assertions and the unrelated Bloom/snapshot/clone cleanup changes. No product code was modified and no subagents were used.
Previous findings:
- UTF32 CONVERT USING admission: resolved. Binding now calls the same non-DDL ResolveCharset owner as evaluation. The parsed SELECT/CREATE VIEW regression asserts rejection with no published plan, retains supported aliases, and keeps the UTF32 DDL control.
- Whole-plan reflection cost: resolved. Ordinary plans use generated typed metadata paths, with invocation-local cycle tracking and an inline small-plan set; producer and mutable/direct compile boundaries remain independently checked. The generator reproducibility tests passed, and current-head admission benchmarks below independently confirm removal of the reported small-plan allocation cost.
- Persisted GLOBAL latin1/ascii defaults: the documentation alternative from the earlier P2 is implemented in design section 10, with explicit per-account pre-upgrade normalization and reconnect verification. The 4.0.12 handler does not automatically migrate these globals. This documented prerequisite remains a release limitation; it does not enable native latin1/ascii or transparently normalize historical defaults. No explicit author reply was found in the retrieved PR conversation or inline review comments; this disposition rests on the implemented mitigation, not presumed author acknowledgement.
Independent local validation (Go 1.27.1, Darwin/arm64 Apple M4):
- Full suites passed: proto/postprocess/plan_collation_admission, proto/postprocess/plan_string_literal_form, pkg/common/collation, pkg/pb/api.
- All collation/typed-admission tests passed using the actual pb/plan production sources and test sources except the unrelated plan_gapfill_test.go, whose types dependency requires unavailable native artifacts. The normal full pb/plan package command failed to build because jemalloc.h is absent; the CGO-disabled alternative also failed due to the existing mpool C allocator dependency. Neither failure is counted as a passing full package suite.
- BenchmarkStatementCollationAdmission executes both retained admission checks: 8 columns 1,222 ns/op, 0 B/op, 0 allocs/op; 512 columns 177,801 ns/op, 211,216 B/op, 30 allocs/op (100ms samples). These are synthetic admission measurements, not end-to-end SQL throughput or Linux performance.
CI on this head: CI Required, Ubuntu UT, UT Coverage, SCA, Coverage, shared build, PROXY BVT and pessimistic multi-CN BVT passed; disabled/conditional jobs are skipped rather than counted as test passes. The latest REST PR response reported mergeable_state=clean, superseding the supplied earlier behind snapshot. GraphQL thread-state retrieval was rate-limited, so no independent claim of resolved-thread enumeration is made. Native/full planner/frontend/BVT/restart/offline-upgrade suites were not rerun locally in this review; the author and prior human review evidence remains separate from the checks above.
LOOM_FINDINGS: {"p0":0,"p1":0,"p2":0,"p3":0}
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
Reviewed current head 50553f0 against base c659910, including the merge-resolution delta from 896c781 and all existing reviews, issue comments, and inline review comments. The authored update fixes the prior blockers: CONVERT USING now uses the non-DDL resolver and rejects SELECT and durable-view publication for UTF32; whole-plan reflection is replaced by a generated typed visitor with per-call cycle state and a foreign-wrapper fallback; historical global defaults are explicitly documented as a pre-upgrade administrator prerequisite. The generated visitor is byte-identical to regeneration, and focused collation, protobuf, and postprocessor suites pass. No blocking or non-blocking findings remain.
Merge Queue Status
This pull request spent 2 hours 5 minutes 59 seconds in the queue, with no time running CI. ReasonPull request #29503 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #29480
What this PR does / why we need it:
Implement C01's collation identity and metadata foundation with legacy-only production admission:
pkg/common/collationowner to distinguish native identities, effective legacy semantics, protocol IDs, SQL aliases, and advertised capabilities.utf8/utf8mb3→utf8mb4compatibility, including four-byte characters and the historical 0900 alias.No new comparison, transcoding, index semantics, or physical key format is enabled. Activation, mixed-version protection, and migration remain with C11/C12 (#29490, #29491). The approved design is in
docs/design/CLAUDE_issue-29480-collation-metadata.md.Validation
Latest integrated main:
c65991043b10fb39988d45b72af1485560ac5433, using normal merges without rewriting the branch. Current validation: all 66 selected owning/reverse-consumer full suites pass in one complete batch; selected static checks pass separately. Changed Go executable-line coverage is 944/1043 = 90.51% against that exact base (generated/test sources excluded under the existing policy; the owned admission generator has 93.9% package coverage). Historical evidence scopes remain below.Current review/conflict follow-up (2026-10-06, head
50553f0841282a093fdb26e5fa7772ef91537672)CONVERT ... USINGbinding now calls the existing non-DDLResolveCharset, matching its evaluator. Parsed SELECT and CREATE VIEW reject UTF32 before plan publication, while UTF32 DDL compatibility and utf8/utf8mb3/utf8mb4/binary expression controls remain supported. Real SQL rejects the conversion/view and confirms the rejected view is absent; a supported utf8mb3 view preserves four-byte HEX F09F9880.-racepasses for both owning packages. Final self-review also retained the original exact latin1 error oracle inside the expanded matrix; the complete planner suite and both focused race suites pass again on that strengthened test source. Go 1.26.4, GOWORK=off, repository CGo workflow, private cache and short TMPDIR.Historical CI/conflict follow-up: run 37113580134 (896c781)
54ef8df5cb, Ubuntu UT, UT Coverage, SCA and standalone pessimistic BVT passed. The PROXY clone failure was post-lock source-definition revalidation (txn need retry in rc mode, def changed); subsequent clone failures cascaded from it. Coverage prerequisites were incomplete, not a calculated threshold failure.ALTER REINDEX; the fixture now uses a bounded, read-only readiness fence before cloning that source again. It requires both expected account/table-specific latest job generations to be Running, have LSN > 0, and have no error. No CREATE/CLONE retries, sleeps, new skips, or weakened schema-change checks. Local probes observed readiness 0→1; the precise CI protobuf field difference was not reproduced, so this is not a claim of a reproduced CI root cause or Linux CI green.-short -tags matrixone_test -race -count=1(46.536s package elapsed; N=1 for the 30s adaptive budget). Independent protobuf regeneration is byte-identical. The new 4.0.12 owning suite passes with 100% package coverage. Persisted system and ordinary tenant versions advance from 4.0.11 to 4.0.12, retain canonical MAXLEN=4 and emoji HEX F09F9880, and remain identical after another preserved-data restart. The earlier real 4.0.10/MAXLEN=3 repair evidence below is historical; the unchanged refresh predicate/body is additionally covered by the current legacy-MAXLEN=3 admission/idempotence/error tests.CI/conflict follow-up
Diagnosed run
36820782639at9e5f50c4c7: the UT failure was uninitialized trailing bytes in the C Bloom filter wire allocation; UT coverage failed on a cross-CN snapshot test's persisted-row visibility, and coverage merge was blocked by that producer failure (not a calculated coverage-rate failure).Initialize the entire existing Bloom filter allocation in both constructors without changing wire length, bitmap offset, hash behavior, or legacy decoding. Keep full same-seed serialization equality; add boundary/round-trip and native padding regressions. A poisoned-allocation counterexample fails before and passes after; both changed native lines are covered (2/2). Focused constructor/marshal/unmarshal/cleanup ASAN+UBSAN passes; the broader native test emits unrelated varlena alignment diagnostics and is not claimed sanitizer-clean.
Fence completed cross-CN commits before snapshot phase admission and persisted-row assertions; retain all quota/winner/error assertions. Cancel and join creators before teardown and clean pending snapshots on assertion failure so a subsequent mode cannot inherit them. No production snapshot semantics, retries, sleeps, or skips were added.
Resolve expression/Substrait conflicts while preserving upstream zonemap cleanup and embedded-reader restrictions. Preserve checked collation metadata in new zonemap argument vectors and revalidate mutable plans at embedded read/build consumers. The embedded key-format counterexample rejects without publishing reads or wire bytes after the fix.
Fresh build and charset BVT neighborhood 709/709 pass; existing DDL/system-variable goldens pass twice (43 + 3 original skips, 177/177), and system-table/show checks pass (40 + 1 original skip, 189/189). No result files changed in this follow-up. Local validation uses Go 1.26.4 on Darwin/arm64, not an assertion that the new Linux CI run is already green.
Final exact snapshot race regression passes; adaptive measurement was 24.65s, so the 30s budget selected
-race -count=1. All 42 packages pass-vet=all -run '^$'static checks (not counted as test execution), and gofmt/diff checks pass.The six changed Go executable lines in the focused follow-up are covered (6/6). Local cache disappearance and an overlong Unix-socket TMPDIR caused separate environment failures; final validation uses a private cache and a short owned temporary path.
Go 1.26.4,
GOWORK=off, repositorymo-cgo-test: all 40 selected Go packages passed their full suites atc628836143, including the CN, proxy, and real-login upgrade consumers previously omitted from the package selection. After merging0d3687004d, the six interacting owner/consumer packages (frontend,plan,compile,cnservice,tests/upgrade,colexec/filter) passed their full suites again; this follow-up changes only two BVT result files.Changed executable-line coverage at
c628836143: 812/850 = 95.53%, excluding generated code and test sources; admission/tenant-refresh review-fix increment 81/83 = 97.59%. That earlier oracle-only follow-up added no production executable lines.make buildpassed. Independent protobuf regeneration matches the merged artifacts byte-for-byte; parser source is unchanged by this follow-up and retains its verified generation evidence.mo-tester generated and semantically reviewed the added ALTER rejection/compatibility results, then verified: basic 281/281, errors 207/207, complete charset_collation neighborhood 709/709, with no ignored/abnormal statements. The neighborhood includes same-instance reruns of the modified files.
Existing BVT goldens refreshed from reviewed mo-tester output:
database/system_table.sql40 passing assertions plus 1 existing issue skip, anddml/show/show.test189/189; both passed normal comparison and a same-instance rerun. Only the MAXLEN and SHOW CHARSET blocks changed, preserving unrelated dynamic/formatting oracles. This is not a claim that the entire repository BVT suite was rerun locally.Further existing BVT goldens now match rejected
character_set_client=xxxrequests (retaining the original session value) and UTF MAXLEN=4:ddl/mysql_ddl_1.sql43 passing assertions plus 3 existing issue skips, andsystem_variable/system_variables.sql177/177, each comparison-verified twice on the same isolated instance. A public SQL probe confirmed failed requests preserve both default and supported-alias starting values, while ordinary user-variable assignment toxxxremains successful. No business-data migration is involved.Final-version fixtures now follow the bootstrap/CN owner instead of hardcoded 4.0.10. Cancellation, rollback/commit, checked-tenant cache, authentication, and allocator-cleanup assertions are retained. The exact CN cancellation test passed adaptive race stress (100 repetitions); incremental
-vet=allpassed.Real persisted-metadata upgrade: a separately built clean
main@76862df5c8initialized system and ordinary tenants at 4.0.10 / utf8 MAXLEN=3. Starting the new binary on the same data upgraded both to 4.0.11 / MAXLEN=4, matching SHOW and freshly created tenants. Four-byte user data remained unchanged; another preserved-data restart produced identical results. This validates the presentation refresh, not native-format mixed-version activation or rollback acceptance.Regression tests cover the real pipeline ExtraBuf→MergeGroup consumer, a valid aggregate preceding the rejected aggregate, no destination publication, legacy retry, and mpool cleanup; MIN/MAX argument/state admission rejects disabled revisions.
Completed self-review and error-path ownership checks. Worktree-owned test services were stopped; unrelated services/data were not modified.
Existing baseline limitation
Also ran the normally skipped
metadata/collation_character_set_applicability.sqlwithout its issue-skip flag. At the original publication baseline it had 3 existing failures out of 5 assertions (tracked by its existing #25103 marker). A separately built cleanmain@e5f70bedc4, using identical isolated configuration and fresh data, produced exactly the same three actual results as this branch. This is not counted as passing; the test and its assertions remain unchanged.The generated
.resultformat causes presentation-only churn. Two trailing-space rows are preserved verbatim because they represent an empty final column and a string containing trailing spaces; source whitespace checks pass.CI follow-up: run 37098445038
313f38204dwas the parent cleanup inTestIssue29399AccountRestoreRollsBackInvalidPrivileges; both target/source restore subtests passed. Four independent drops shared one 30-second deadline, leaving the final source-account drop only about nine seconds.b210a0a5fc(including the preceding trace retirement and the nested prepared common-value fix). Updated one prepared EXPLAIN authorization fixture to call the retained object-type-aware helper rather than its deleted table-only wrapper; the SQL and authorization oracles are unchanged.6249e488b5base; after the final upstream update, the five interacting full suites (plan,frontend,compile,colexec,issues) passed again. The other 40-package evidence is reused, not claimed rerun at the newer base.b210a0a5fc, combining unchanged-file evidence with fresh profiles for the two changed planner files (old line mappings excluded). This follow-up adds no production executable lines; unchanged native Bloom evidence remains 2/2 covered.-short -tags matrixone_test -race -count=1; adaptive measurement was 42.3s (30s budget => N=1), followed by a final-base rerun (44.029s package elapsed). Tagged normal same-process-count=2also passes.