Repository navigation
[4.2-dev] fix SDK contracts and exact ENUM member replay - #32723
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? |
|
This pull request is merged. |
|
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: 2bc83b0b9a2410c4fb92d13c12db2e9e194d063f
Assessment: request_changes
The prefix adapter is proportionate, but its integration misses Linux’s existing terminal-reset monitor.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P2
pkg/frontend/mysql_buffer.go:369: Complete a buffered TLS upgrade on Linux, start a long-running query, then reset the client connection before the request reaches 30 seconds.
Impact: terminalTCPConn unwraps TLS but cannot recognize bufferedNetConn. The early terminal-error monitor therefore skips this connection, leaving query work and resources active until ordinary completion or the legacy 30-second request-age path.
Evidence: socket_terminal_linux.go:49-54 asserts *net.TCPConn directly; lines 118 and 135-137 establish the age-gated fallback and terminal-probe skip. The extracted-source race probe completes verified TLS in both cases: raw TLS passes, while buffered TLS returns a nil terminal probe despite successful generic disconnect detection. See transport-probe.stdout.log and checks/1794585238752540963-2.json. Unwrap this adapter in the existing TCP resolver and extend the terminal-reset regression; the added generic FIN test does not cover this consumer.
Validation:
-
Isolation preflight passed.
-
Extracted-source race probe confirmed the finding; prefix/EOF, unsupported-socket and raw-TLS controls passed.
-
Final source, formatting, discussion coverage and receipt audit passed: checks/1794585566371815007-2.json; review-audit.json. Source remains unchanged.
Limitations:
-
The independent probe executes byte-identical extracted methods, not the complete frontend package or a live SQL server.
-
Author-reported frontend normal/race, repeated regressions and live TLS/SDK checks were assessed but not independently rerun. Pending or cancelled CI was not counted as passing.
|
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: ad230a7df924903b16086ddb68a5b030cac7456b
Assessment: approve
The branch identity design reuses catalog, receipt and transaction owners while preserving restore authorization. Shared quoting and SQL-mode handling preserve 4.2 metadata contracts. The rebased TLS FIN/reset behavior is covered, and earlier fixture and NBE findings are resolved. No blocking findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete 84-file delta, affected owners/consumers, all 32 discussion entries and five linked issue contexts; retained review-plan.md, review-notes.md and discussion-assessment.json.
-
Current-head race checks passed: eight TLS/status roots and 16 branch/restore/publication/Stage roots. Logs: frontend-focused-race.jsonl and frontend-closure-race.jsonl; command/source/exit receipts reconciled in validation-audit.json.
-
Five owning packages passed 309 test roots under -race -short -tags=matrixone_test; one existing TestDecimal128Float skip. Log: owner-race.jsonl.
-
Static audit passed: 62 Go files formatted, Python AST, accepted design digest, baseline golden controls and native provenance (170 inputs, 43 outputs). 81 of 84 PR files match reviewed a864b44; terminal changes were separately assessed.
-
Reused scoped frozen reports for remaining owning-package/stress checks, public BVT/SQLAlchemy replay, Parquet measurements and shutdown upgrades from actual v4.2.1/v4.2.8 artifacts.
Limitations:
-
Public-service, SDK, performance and physical-upgrade runs rely on supplied reports rather than fresh local execution; their raw logs were unavailable. An earlier reported service-shutdown stall remains unexplained.
-
Current CI is pending; skipped SDK/upgrade jobs were not counted as passes.
-
Historical comma-bearing ENUM recovery and standard SQLAlchemy BOOL/view reflection remain separate issues; new comma-bearing ENUM declarations are rejected.
-
Qualification covers the documented shutdown-upgrade scope. Rolling/multi-CN/full-release qualification and old-binary downgrade remain outside that evidence; branch identity and path-form Stage references have documented downgrade incompatibilities.
|
mo-bot review · Commit: Review linked issue or PR description changed before publication; a fresh contextual review is queued. |
|
mo-bot review · Commit: Review discussion changed before publication; a fresh contextual review is queued. |
QA finding: reproducible regression for non-constant legacy ENUM domainsI ran a local A/B against merge-base
Allocations are unchanged (1024-row cases: 1026 allocs/op; 64-row cases: 66 allocs/op). The base/head timing ranges do not overlap for either label case, so this does not look like a one-run outlier. The relevant path is Scope: this is a vector-function microbenchmark regression, not demonstrated end-to-end SQL throughput regression. Constant-domain cases improve substantially (for example, 64-label/1024-row/constant numeric: 725.012 us -> 4.246 us, with 1026 -> 3 allocs/op). Parquet FLOAT32 conversion was effectively neutral in three A/B rounds (page/plain -0.67%, page/dictionary +1.04%, allocations unchanged). Could you please either optimize the dynamic legacy decode path, explain why that path is not performance-reachable/hot in real plans, or update the performance report? The current report describes much smaller long-run regressions (about 3%-4.5%), which does not match these repeated results. For completeness, after correcting the test wrapper to execute the PR worktree rather than the primary checkout, the owning package tests, focused race tests, and |
iamlinjunhong
left a comment
There was a problem hiding this comment.
Reviewed exact head c5623e47313ec1d1fb12f5024fc39e8d9c8b0f90 against 25305b61371edf756b8ec8fb7b32008886139bac on 4.2-dev. No confirmed P0/P1 findings; two non-blocking issues remain:
- [P2]
clients/python/tests/online/test_mysql_enum_set_replay.py:130: the freshENUM('')test still expects emptyattr_enum. The new encoder writes1#0:with encoding 1, which the engine/catalog preserve. The first iteration therefore fails before reflection coverage. Update the assertion to check the new tag/payload pair and use a separate legacy fixture for old empty metadata. - [P2]
pkg/sql/plan/function/func_mo.go:1059: dynamic legacy domains are decoded for every row, adding delimiter counting before splitting. The supplied exact-head QA measurements show 3-member label conversion regressions of 15.58%/15.71% at 64/1,024 rows over seven interleaved rounds on Darwin/arm64. Optimize this path or add these measured limits to the performance report. This is microbenchmark evidence, not a demonstrated end-to-end SQL throughput loss; ordinary constant-domain improvements remain valid.
Earlier TLS terminal-monitor, stale scalar-fixture, NBE quoting, signed-exponent and Parquet concerns were checked against the current source and are no longer findings. Prior automated assessments are not treated as explicit author replies. This is the first review by this reviewer; no earlier reviewer-specific feedback requires a response check.
CI snapshot: 14 success, 13 skipped, 2 neutral (29 total); no failed or pending checks, but not all checks passed. Python SDK execution and upgrade checks were skipped. Current CI run.
Validation: inspected the supplied diff/discussion and affected producer/consumer paths; the read-only PR artifact check passed. The Python file parses successfully. Runtime tests and benchmarks were not rerun: the stale assertion follows directly from the encoder/catalog path, and the performance assessment reuses the supplied exact-head QA evidence. Product execution reported by the author was not independently reproduced. git diff --check reports trailing spaces in three added golden-result rows; these are not treated as defects. No source or GitHub changes were made.
| "WHERE att_database=%s AND att_relname=%s AND attname='e'", | ||
| (database, name), | ||
| ).one() | ||
| assert native == ('ENUM', '') |
There was a problem hiding this comment.
[P2] Update the empty-domain catalog assertion for the new encoding. This test creates a fresh ENUM('') at line 110. getTypeFromAst now calls EncodeEnumMembers, which deliberately stores that domain as encoding 1 with payload 1#0:; PlanColsToExeCols and GenColumnsFromDefs preserve that payload in attr_enum. Consequently the first source-table iteration returns ('ENUM', '1#0:'), and this assertion fails before client reflection is exercised. Assert the new tag/payload pair here; keep any legacy-empty compatibility check on a separately prepared legacy fixture.
| if p.constant { | ||
| return p.members, p.null, nil | ||
| } | ||
| return p.decode(row) |
There was a problem hiding this comment.
[P2] Account for the dynamic legacy-domain conversion regression. When the domain argument is a non-constant vector, every row reaches DecodeEnumMembers, whose legacy path now counts delimiters before SplitN; the base called strings.Split directly. The supplied exact-base/head QA measurement (issuecomment-6904265723) reports seven interleaved 500-ms rounds with 3-member label conversion slower by 15.58% at 64 rows and 15.71% at 1,024 rows, with unchanged allocations. The maintained benchmark directly exercises this supported argument shape. Please reduce this repeated decode overhead or document the measured Darwin/arm64 regression and its workload limits alongside the Linux numbers. This evidence concerns vector-function microbenchmarks; it does not establish an end-to-end SQL throughput regression.
Use checked comma boundaries in the common decoder while retaining count, size and encoding validation. Cover changing domains, empty byte members and fatal definition errors independently; refresh current-base performance and validation evidence for PR matrixorigin#32723.
|
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: a65a0508e97ac9ade79ffba0791b1f6d0fb287ab
Assessment: request_changes
Hidden ENUM ordinals change DISTINCT insertion counts, and the previously reported empty-ENUM test remains stale. The decoder optimization and shared-owner designs are proportionate.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
-
P1
pkg/sql/plan/bind_insert.go:3260: Create src(e ENUM('a,b','')), INSERT IGNORE values ('missing'),(''), then INSERT INTO an identically typed dst SELECT DISTINCT e FROM src.
Impact: The SELECT returns one row, but INSERT persists two, with ordinals 0 and 2. Derived DISTINCT and self-UNION DISTINCT also fail, including legacy ENUM domains. Stop hidden-ordinal promotion across DISTINCT boundaries and add a cardinality regression while preserving plain/UNION ALL assignments.
Evidence: Fresh frozen-head SQL execution reproduces six violations across twelve cases: public-enum.log and projection-results.json. build_constraint_util.go:1423 guards explicit set-operation kinds but misses Node_DISTINCT; query_builder.go:2702 groups every child projection, including the newly injected ordinal. GROUP BY/plain/UNION ALL count controls pass. -
P2
clients/python/tests/online/test_mysql_enum_set_replay.py:130: Run the retained online test that creates a fresh ENUM('') domain.
Impact: Its legacy-empty expectation prevents the maintained regression from completing reflection/replay coverage. Update the tag/payload expectation and reconcile metadata casing with the supported public contract while retaining semantic assertions. This prior finding remains unresolved.
Evidence: EncodeEnumMembers deliberately emits encoding 1 and payload '1#0:'. Independent current-service queries confirm ('ENUM','1#0:') and native tag 1, while line130 expects ('ENUM',''). Lines118/124 also expect lowercase metadata; current SQL returns "ENUM('')". See empty-metadata-results.json, public-enum.log and prior review_comments:4581632335.
Validation:
-
Verified the complete 143-path frozen delta and 138 byte-identical paths against prior reviewed/qualified sources; reconciled all 40 discussion keys. Source remains clean.
-
Go 1.26.4 types/function owning checks: 1,465 root passes, nine skips, zero failures. Four focused behavior roots pass; scoped vet passes.
-
Fresh service probe records all twelve projection cases and confirms both findings; overall test exits 1. Control cases pass, database cleanup is verified, and service shutdown completes normally.
-
Pinned protobuf regeneration is byte-identical. Formatting of 117 Go files, Python syntax, index guards, design digest and native/binary provenance checks pass. validation-evidence.json and final-evidence-audit.log reconcile receipts and logs.
Limitations:
-
Broader race/stress, maintained BVT, physical upgrades and performance rely on supplied source-matched reports; raw author logs and candidate Darwin measurements were unavailable.
-
The complete pytest harness and CI suite were not rerun. Local skips comprise TestDecimal128Float and eight unavailable ONNX cases. Initial proxy failures and interrupted setup attempts are retained and excluded from passing evidence.
Release successful read vectors before their test scope ends, including WriterForRead results. Copy the eviction helper result before releasing its backing IO allocation. Record clean-base reproduction and normal, checked coverage, and race validation for the CI finalizer failure.
|
mo-bot review · Commit: "interrupted" |
|
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: 72d085cfec7980b46e6f65bb397896bef75b0639
Assessment: request_changes
Two previously reported findings remain: hidden ENUM ordinals change DISTINCT insertion counts, and the empty-ENUM Python test expects obsolete metadata. The shared codec and new buffer cleanup reuse existing owners proportionately; neither the cleanup nor the base merge fixes these defects.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
-
P1
pkg/sql/plan/bind_insert.go:3260: Create identically typed src/dst tables with e ENUM('a,b',''), insert ('missing'),('') into src using INSERT IGNORE, then execute INSERT INTO dst SELECT DISTINCT e FROM src.
Impact: The INSERT persists two rows with ordinals 0 and 2 although the SELECT returns one visible row. Stop hidden-ordinal promotion across DISTINCT boundaries and add direct/derived DISTINCT cardinality regressions while preserving ordinary and UNION ALL ordinal assignments.
Evidence: This prior finding remains unchanged. build_constraint_util.go:1422 guards explicit set-operation kinds but omits Node_DISTINCT; materialization appends a hidden ordinal, and query_builder.go:2702 groups every child projection. Supplied authenticated review 5915105410 reproduced six violations across twelve public SQL cases with passing controls. change-map.json verifies all relevant inputs are byte-identical at this head. -
P2
clients/python/tests/online/test_mysql_enum_set_replay.py:130: Run test_empty_enum_metadata_replay, which creates a fresh ENUM('') domain.
Impact: The stale assertions fail before reflection/replay coverage completes. Update the fresh-domain payload/tag and native metadata-casing expectations, retaining semantic replay assertions and using a separate fixture for legacy-empty metadata.
Evidence: EncodeEnumMembers emits encoding 1 and payload '1#0:' for this domain; build_util.go:284, engine.PlanColsToExeCols and catalog.GenColumnsFromDefs preserve the pair. The test expects ('ENUM',''), and lines 118/124 expect lowercase metadata although the native formatter returns "ENUM('')". Review 5915105410 independently confirmed these values; the producer, formatter and test files remain byte-identical.
Validation:
-
Verified the complete 144-path delta: 142 paths match authenticated review 5915105410; assessed both PR-local follow-up files and the three base-only compression changes.
-
Read all 43 discussion entries and five linked-issue contexts; saved complete discussion-assessment.json and change-map.json. Reused matching prior execution evidence with attribution.
-
Static audit passed source/patch integrity, Python syntax, index guards, design digest, restored golden controls and new-delta whitespace. Receipt checks/1794808713141337327-2.json matches source-audit.log and source-audit.json. Source remains clean.
Limitations:
-
No fresh Go, live SQL, pytest, race or CI run was performed; prior runtime evidence is reused for unchanged inputs, and its original raw logs were not supplied.
-
Broader upgrade, distributed and performance qualification remains scoped author/prior-review evidence. Candidate Darwin performance remains unverified; prior skips are not passes.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #29928 and #26068. Addresses the ENUM comma-member representation/replay portion of consolidated #30771, including original report #30776. Binary-collation identity and unrelated HEX behavior remain tracked by that open issue.
Native 4.2 companion to SDK PR #32671. The SDK's supported paths on published 4.2.8 do not depend on this native PR.
What this PR does / why we need it:
Preserve the relevant protocol, schema replay, FULLTEXT, parser, Stage, Parquet and branch fixes on 4.2-dev. Ordinary scalar display stays exactly as in the base: INT(32), BOOL(0), BIGINT UNSIGNED(64), and the existing FLOAT/date/text conventions. The restored scalar golden rows remain unchanged.
Complete ENUM member domains
The old comma join maps both ENUM('a,b','c') and ENUM('a','b','c') to the same catalog text. The earlier PR mitigation rejected comma-bearing declarations. This revision removes that restriction and preserves the actual members and ordinals:
Other retained fixes
Compatibility and limits
Validation
Runtime optimization qualified at a65a050, based on c5623e4 and compared with 4.2-dev 25305b6. The subsequent CI-only read-buffer cleanup is 3d34894. All fresh work ran on 57/Linux/amd64, with source-matched CPU native libraries and task-owned data/temp directories outside /tmp.
Full prior implementation qualification is recorded at f9c839a: 7,159 roots across 15 owners, 2,143 frontend/external race roots and focused 100-repeat lifecycle stress, actual two-CN propagation, frozen branch output/restore and stopped upgrades from published 4.2.1/4.2.8. The runtime follow-up at a65a050 confirmed 138 of its 143 PR paths byte-identical to that reviewed version. This follow-up changes one common legacy traversal, two owner test files and two design/evidence documents. Older broader evidence retains its stated source and scope; it is not represented as a fresh release/SDK, cross-cluster CDC or production-checkpoint qualification. Hosted CI must report on the pushed head separately.
CI-only read-buffer cleanup
The failed UT Coverage job reports a checked-allocator missing free of 27 bytes from TestLazyCacheFSReadsMagicPrefixedRemoteObjectsWithoutLocalChecksum after PASS. The final Coverage job is blocked by the absent UT profile; it did not compute a coverage-rate verdict.
Performance versus current base
Same maintained benchmark source on base 25305b6, original PR c5623e4 and candidate; CPU 23, GOMAXPROCS=1. The six dynamic controls plus scalar display use seven interleaved rounds of 500 ms per revision on each Go toolchain. Complete 54-case legacy and 54-case tagged matrices use three interleaved 100-ms rounds each. These are vector-function microbenchmarks, not end-to-end SQL throughput.
The old PR's dynamic regression reproduces on Linux; scalar display on Go 1.27.1 is 127.7 -> 146.6 ns (+14.80%). The legacy reader now uses its existing checked count to traverse exact comma-byte boundaries with strings.IndexByte. The original strings.Split already counted internally: this change reduces general split dispatch/check overhead while retaining tag/size/member validation, independent ParseEnum oracles and the same allocation bounds. No global/payload-equality cache or row/data-shape special case is added.
Bytes/allocations are unchanged for those controls. No legacy short-run median in the complete matrices exceeds 10% versus base (maximum +7.70% on Go 1.26.4 and +5.72% on Go 1.27.1). The sole tagged short-run point above 10%, dynamic 64-member/1,024-row name lookup on Go 1.26.4, is retained and remeasured over seven fixed longer rounds: original PR 655.833 us -> candidate 649.588 us (-0.95%), same 1,027 allocations.
Large constant-batch gains remain. Go 1.27.1 complete-matrix medians:
Residual small costs are reported, not described as universal speedups or zero regression. The candidate has not been retimed on Darwin/arm64; the earlier Darwin QA finding is not claimed resolved on that platform from Linux evidence alone.
Domain design · Compatibility, evidence scope and detailed performance