Repository navigation
feat(sql): enable native Unicode unique keys - #30113
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? |
|
Reviewed head [P1] Preserve the trailing rowid when adding the V1 index-key projectionLocation:
Two consumers still rely on that last-column contract:
This is reachable through I reproduced the planner-contract failure with a local targeted test calling Please insert the computed key before the trailing rowid (and adjust |
|
已处理 reviewer comment 和上一轮 failing checks:
本地已通过受影响包测试及 TestUnicodeCollationConsumerContract;新 CI 已触发。 |
|
Re-reviewed head Recommendation: approve from code review, subject to all required CI checks passing. No new blocking code findings; the previous trailing-RowID P1 remains resolved. The new tests assert the actual key-expression/serializer choices, rather than just successful execution: V1 physical keys, legacy Exact-head local validation passed:
I independently checked the previous Coverage failure: it was a real changed-code coverage failure, 172/237 lines (72.57%), not a missing producer/profile. The gate requires more than 75%. The added tests are useful, but local test success does not establish that this threshold is now met. That run's proxy and pessimistic BVT jobs passed; its Ubuntu UT was cancelled, not completed successfully. At posting, the new exact-head CI run has passed shared build; Ubuntu UT is queued and SCA, UT coverage and both active BVT jobs are still running. Please wait for Coverage and CI Required to pass before merging. Supplemental tests remain review-local; no production code was modified or pushed. No distributed mixed-version rollout test was run. Ordinary PR comment only; no formal approval review submitted. |
…que-activation # Conflicts: # pkg/defines/const.go
|
Updated head Resolved the mainline protocol-version conflict: main already uses MORPC v113 for DECIMAL variance/stddev result contracts, so native Unicode UNIQUE-key admission now uses a new MORPC v114 and the DDL authoring gate is aligned to v114. This prevents two incompatible persisted-plan contracts from sharing one protocol number. Docker validation passed for the collation-admission, index, and utility focused tests (the first container started before this final constant fix and was discarded; a fresh CI run is now authoritative). |
|
Follow-up head |
|
Updated head Docker/CGo validation passed:
New required CI run: |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: f53be3e758ef1f9cc81bd556de3d9c961374bdbf
Assessment: request_changes
The mandatory design gate remains open. Reusing existing index, key-expression and transaction owners is a reasonable direction, but activating native Unicode UNIQUE keys exceeds the currently approved contract.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
pkg/sql/plan/build_ddl.go:4330: CREATE TABLE with a native Unicode UNIQUE column now activates persistent KeyFormatV1 under protocol 114.
Impact: Design requirement: provide and link an approved, versioned amendment covering this activation before implementation acceptance. It must define the narrowed supported scope, compatibility/recovery boundary and validation criteria; otherwise retain the admission fence. This finding establishes an unmet design gate, not an observed runtime defect.
Evidence: docs/design/issue-29206-uca400-backend.md:91-92 requires another design review for scope changes, and lines 105-113 explicitly exclude native Unicode UNIQUE keys. The parent issue-28164-collation-key-reuse.md also conditions activation on rollout and validation gates. No amendment or traceable design approval appears in the frozen PR body, 19 comments or changed documents. Existing implementation-review approvals do not identify an approved design revision. The persisted-format and protocol changes independently trigger .agents/skills/mo-dev/references/feature-design-review.md.
Validation:
-
Read all changed hunks across 24 files and reconciled the frozen discussion with current admission, RowID preservation, metadata and protocol changes.
-
Source audit passed: exact HEAD/base, clean checkout, supplied patch matching the frozen delta, and git diff --check. Receipt: /home/xupeng/.local/state/mo-bot/jobs/9417223740e661688fb707f3/attempt-1/checks/1792051627559986236-2.json; matching scope-audit.log and scope-audit.json retained alongside review-map.json.
-
The exact-head frozen CI snapshot reports successful Ubuntu UT, SCA, coverage, proxy BVT and pessimistic multi-CN BVT. The latest author comment reports three focused planner tests passing. local_validation is empty; no local runtime tests were executed.
Limitations:
-
Implementation acceptance stopped under mo-self-review/SKILL.md: “Missing/unapproved or failed design makes the decision REQUEST_CHANGES and short-circuits full implementation polishing.” Full failure/concurrency, restart/restore and compatibility closure remains pending.
-
V1 paths add key construction, projections and metadata validation. No current-feature performance measurements were supplied or executed; affected and legacy workload costs remain unverified.
-
Raw CI logs and standalone linked-issue content were not supplied. Source and GitHub remained unchanged.
|
已更新 PR,当前 head 为 本次处理:
验证通过:
设计文档明确标记为“Proposed for independent design approval”,没有伪造审批记录。实现 review 仍应以该修订获得 maintainer/design approval 为前置条件。 |
|
Design review: PASS for the bounded activation contract in I independently reviewed the amendment against the parent UCA400 supported subset and the earlier weight-key design. It explicitly supersedes only the native-UNIQUE exclusion for new ordinary persistent tables, reuses the existing canonical-key and transactional hidden-index owners, defines the v114 admission/restore/downgrade and failure boundaries, preserves the PRIMARY KEY/existing-table/mixed-index exclusions, and states resource bounds and acceptance oracles. This closes the previously missing versioned design scope. No separate RFC, special approval label, or additional approval ceremony is needed for this design decision. This is a distinct design decision, not an implementation APPROVE: I am continuing to verify the full implementation against that contract, especially all DML key producers, protocol consumers, error/rollback paths and actual validation evidence. |
|
Re-reviewed exact head Recommendation: approve from the code-review perspective, subject to required CI and the documented release-validation gates. No new blocking implementation finding in this review; the previous trailing-RowID P1 remains resolved. The design-gate status changed during this review. The amendment initially still showed pending approval, but aptend has now recorded an independent design PASS for this exact head and document blob Implementation checks:
Exact-head local validation passed with CGo configured:
Required CI is still incomplete. I did not perform crash/restart, backup/restore, deployed mixed-version, race, or performance testing in this round; the local passes above do not certify those broader acceptance criteria in the amendment. Supplemental tests remain in an isolated review worktree. No production edits or pushes. Ordinary comment only: no formal approval submitted and no earlier review dismissed. |
aptend
left a comment
There was a problem hiding this comment.
Deep review of exact head 99b823b4d799f306ea29e3b69d5e495664d5d7ef against base/merge-base 461bc8e34920959e5fc141e3d1b37673a90894e1: no blocking implementation finding.
The previous design-scope blocker is closed by my separate design PASS, for amendment blob a504e95aade455130449670d969a122af8bec216. Its still-pending prose is not a requirement for another approval ceremony. Approval here is the implementation decision, not a claim that deployment qualification or pending CI has finished.
Scope: read all changed hunks across 27 files and all current formal reviews, inline/thread state and author discussion; checked the f53be3 -> current increment separately from upstream merges. Mapped CREATE/ALTER admission and persisted base/index metadata, generated visitors/postprocessor, every changed INSERT/dedup/ODKU/IGNORE/UPDATE/DELETE/REPLACE/FK key producer/probe/lock, physical function typing, and tests. MORPC114 does not reuse main's DECIMAL113 capability. Unsupported PK/existing-index/mixed-index paths remain fenced, and opaque native keys are not substituted for base text on indexed reads/FK actions.
Ownership/unhappy-path audit: canonical bytes flow into the existing statement vector/hidden-index owners and transaction rollback; new maps/projections are bounded by schema/statement lifetime. No new worker, queue, retry or lifecycle owner was introduced. Error paths return before handing off invalid keys; normal and FK paths use the same physical-key domain. No confirmed cleanup, liveness or retained-growth defect. The speculative prefixed-UPDATE RowID concern did not reproduce and is not a finding.
Independent exact-head checks in a detached worktree, Go1.27.1/Linux/amd64 with freshly built CGO/thirdparties:
- Focused new admission/key-expression/RowID tests: PASS.
- Full
pkg/sql/plan,pkg/pb/plan,pkg/sql/util: PASS (13.897s / 0.021s / 0.043s). - Existing
TestUnicodeCollationConsumerContract: PASS (6.02s). - Supplemental real-SQL prefix UPDATE/DELETE/key reuse, composite UPDATE/duplicate rollback/ODKU, child prefix UNIQUE + FK UPDATE CASCADE, CREATE LIKE/ADD plain column preserving uniqueness, and composite UNIQUE + FK DELETE SET NULL: all PASS (5.85s). Probe SHA256
b8af4d22b2cdca46059cf2dae7115720c10ca16e1e7477632dd06d3671b1754c. - Actual catalog WAL schema round-trip and compile remote-batch/execution-boundary tests: PASS;
git diff --check: PASS.
The first diagnostic attempts contained an unsupported PK assignment in ODKU and then an unrelated restrictive child FK; both were probe setup errors, corrected before the final passing run, not PR regressions. Current run38708807723 is still incomplete; earlier f53be3 CI was green but is not relabeled as current-head CI. No live crash/restart, deployed mixed-version/backup-restore, race or performance qualification was run here; typed WAL/metadata checks are not substitutes for those rollout checks. Required CI/release gates remain independently enforced. No production edits or pushes; temporary probes are removed after this review.
|
Updated PR #30113 at head Changes:
|
|
Re-reviewed exact head Recommendation: approve from the code-review perspective, subject to required CI and the documented release-validation gates. No new blocking implementation finding. This is a merge-follow-up review. All 26 files in the current PR diff have identical contents to the previously reviewed The design gate remains closed by aptend's independent design PASS. The amendment still has the approved blob Reconfirmed:
Fresh exact-head validation, with CGo configured:
At the final GitHub check, this head was unchanged and mergeable. Preflight passed, while Shared Build, SCA, and UT Coverage were running and Ubuntu UT was queued. Required CI is not yet green. No fresh live crash/restart, backup/restore, deployed mixed-version, race, performance, or full generator-regeneration validation was performed; these local results do not certify those broader release gates. No production edits or pushes. Ordinary review comment only; no formal APPROVE submitted and no existing review dismissed. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: e8d4aeeda9b6824bacb0de47e6a445a404fd39d9
Assessment: approve
Reviewed the complete 26-file delta and frozen review discussion. The design coherently reuses canonical-key, hidden-index and transaction owners, with explicit compatibility fences. The approved design amendment remains unchanged. No actionable unresolved findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Verified the frozen head, clean source, patch contents and approved design blob a504e95aade455130449670d969a122af8bec216. Native prerequisites were reconciled against 192 source inputs and 62 artifact hashes before testing.
-
Full protobuf admission and generator suites passed, including actual regeneration. Focused planner/util tests passed for key construction, mutation restrictions, RowID preservation and malformed input. Diagnostic overlays verified protocol-113 rejection and native Unicode metadata preservation through the catalog WAL reader.
-
The committed embedded-CN Unicode regression passed. Supplemental SQL checks passed for duplicate rollback, mixed native/binary UNIQUE keys, ODKU, REPLACE, LIKE/ALTER/TRUNCATE preservation and prefix-key maintenance through FK cascades. The initial supplemental probe used an already-unsupported ODKU assignment; its corrected version passed, with both results retained.
-
Legacy admission benchmark medians, base to head: eight columns 1.652→1.665 µs; 128 columns 48.185→52.021 µs. Allocation counts and bytes were unchanged. These shared-host measurements do not establish production throughput.
-
Frozen exact-head CI reports successful Ubuntu UT, arm64 SCA, coverage, shared build, proxy and pessimistic multi-CN BVT, and required checks. Skipped checks were not counted as executed validation.
-
Commands, source fingerprints, exit receipts, logs and overlay hashes were reconciled in /home/xupeng/.local/state/mo-bot/jobs/be343b7c134fb1276d11e217/attempt-1/validation-audit.json. Detailed scope and reasoning are retained beside it in review-map.md; final audit receipt 1792070546391007069-2.json exited 0.
Limitations:
-
No fresh live crash/restart, backup/restore, deployed mixed-version cluster, race or sustained-load qualification was performed; these remain documented release-validation limits.
-
The supplied packet contains CI statuses and author reports, but no retained raw author/full-CI logs. Local execution claims are limited to the audited checks above.
Merge Queue Status
This pull request spent 40 minutes 29 seconds in the queue, with no time running CI. ReasonPull request #30113 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
|
|
关联验证更新(2026-10-19 UTC;此 PR 不在本轮最近合并范围内,以下是已有行为的续测,不据此归因于本 PR):main
复现命令在两个 CN 对 #25096/#28164/#30339/#30340 四个现有问题共 8 个断言均失败,整体 exit 1: 原始日志 SHA-256 |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28164
What this PR does / why we need it:
This PR enables the first narrowly scoped C07 slice for native Unicode collations:
CREATE TABLEdefinitions with nativeutf8_unicode_ciorutf8mb4_unicode_cisecondaryUNIQUEkeys;Native Unicode primary keys, existing-table migration/backfill, and indexed-read support remain intentionally out of scope for follow-up PRs.
Validation:
go test ./pkg/sql/plan ./pkg/sql/util ./pkg/pb/plan -count=1go test ./pkg/sql/plan/function ./pkg/container/types -count=1go test -count=1 -run TestUnicodeCollationConsumerContract ./pkg/tests/sqlintegrationgo test ./proto/postprocess/plan_collation_admission -count=1gofmtandgit diff --check