Repository navigation
test(plan): pin padded binary default replay and dump fingerprint parity (#31066) - #31147
gouhongshen wants to merge 1 commit into
Conversation
|
CI follow-up on head Three jobs of run 40247682659 (attempt 1) failed; dispositions:
No rerun was issued (the workflow run was still pending its other jobs when handled); the fix push created a fresh CI wave on the new head. No base update was needed. |
|
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: e73f3a365cbea83e507bbfeab4aa73800b03775a
Assessment: request_changes
Reviewed the complete six-file delta and affected consumers. Reusing the SQL formatter and preserving historical hash rendering are sound choices, but re-quoting padded BINARY defaults introduces a restore-compatibility regression.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
pkg/sql/plan/build_show_util.go:1782: Recreate a table containing BINARY(8) DEFAULT 'a' from generated CREATE SQL. This also occurs when DUMP reconstructs manifest SQL for a table containing legacy text metadata.
Impact: The bound Sval includes seven padding NUL bytes. Emitting those bytes changes the replayed Default.OriginString and therefore the persisted schema hash, despite preserving the default value. LOAD's schema comparison consequently rejects the recreated target. Preserve the original default representation for assignment-padded binary values and add a replay/hash regression test.
Evidence: A real planner roundtrip confirms that OriginString changes from 'a' to 'a' plus seven NUL bytes. TestReviewBinaryDefaultManifestReplayHash then fails through the frontend manifest/hash helpers: hash 587ed28b… becomes a0489c91…. The identical probe passes with exact merge-base versions of both changed production files. Retained logs: candidate-manifest-replay.log and base-manifest-replay.log.
Validation:
-
Isolation preflight passed; reused native inputs, build receipt and library hashes were audited.
-
Four added planner tests and reviewer probes covering 40 boundary/excluded-form cases passed. Receipt: checks/1792985509092679061-6.json.
-
All three added frontend hash tests passed; the reviewer binary replay/hash probe failed in the same run.
-
Manifest regression: candidate receipt checks/1792985920147330185-4.json records exit 1; base-production control checks/1792985979322664248-3.json records exit 0.
-
Frozen current-head CI reports successful unit, static-analysis, coverage and compose BVT checks.
-
Commands, source fingerprints, exits and logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/51fc567abc2678c1d0513100/attempt-1/evidence-audit.json. Source remains unchanged.
Limitations:
-
The regression was verified through planner replay and frontend manifest/hash helpers, without running a live SQL DUMP/LOAD service.
-
local_validation was empty; author-reported service runs had no supplied retained artifacts for independent reconciliation.
-
No performance benchmark was run: added work is confined to generated CREATE text, with no new I/O, synchronization or ordinary SELECT/DML execution work.
|
Review P2 (padded BINARY defaults) — reproduced on head 1. The finding is valid for this head. A planner-roundtrip probe on
2. This PR no longer fixes something main lacks. Probe on 3. The conflict is real and has the same root. Recommendation: close this PR as superseded by #31067 and verify/close #31066 against main. Pushing a rebase that resurrects a second implementation of an already-merged fix — this one carrying the confirmed padded-binary regression — adds no user-facing value. One small follow-up worth keeping from this probe: a 4. The CI Required failure in the same event batch (run 40258122824, attempt 1) was already dispositioned by the previous turn: workflow-supersession cancellation at the 02:20 draft→ready transition, with the successor run 40258611196 on the byte-identical head completing green. No rerun or base update follows from it; being |
…ity (matrixorigin#31066) The once-escaped SHOW CREATE TABLE string-default fix for matrixorigin#31066 landed on main in matrixorigin#31067 (4769417), which renders executable DDL defaults from the stored OriginString and keeps the historical DUMP fingerprint rendering. That supersedes this branch's previous competing re-quote rendering, which the review showed corrupted assignment-padded binary defaults, so the branch now rebases onto the merged implementation and carries test-only deltas on top of it. Added on top of main: - planner: TestShowCreateReplayKeepsAssignmentPaddedBinaryDefault pins the review P2 for matrixorigin#31066. `binary(8) DEFAULT 'a'` binds a NUL-padded Sval while the stored default text stays 'a'; SHOW CREATE must print the stored text, replaying the printed DDL re-binds the same OriginString/Sval, the second SHOW cycle is idempotent, and the schema-hash input of the replayed table stays equal to the source's, so an archive keeps loading into a target rebuilt from SHOW output. The same test fails on the superseded re-quote head (e73f3a3), which printed and re-bound the padded spelling. - frontend: TestTableDumpPaddedBinaryDefaultReplayHashMatchesManifest and TestTableDumpPaddedBinaryDefaultRejectsPaddedSpelling pin the manifest/hash gate the P2 broke: a replayed target hashes equal to the manifest and is accepted, while the padding-spelling default text the superseded rendering produced is a genuinely different schema and is rejected. - BVT: keeps show_create_table_default_quote (dml/show), whose information_schema column_default/hex parity between source and replayed tables complements the merged cases/ddl pair.
e73f3a3 to
0952288
Compare
|
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: 095228839f5204d5d99832ffaac8525a4e35e9c9
Assessment: request_changes
Reviewed the complete four-file tests-only delta and frozen discussion. Reusing the merged renderer and historical hash implementation is sound; the earlier padded-BINARY production defect is resolved. One actionable test-oracle defect remains. No production performance changes are introduced.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
pkg/frontend/table_dump_default_hash_test.go:70: TestTableDumpPaddedBinaryDefaultReplayHashMatchesManifest creates replay with proto.Clone(def), rather than rebuilding it from replaySQL.
Impact: The positive manifest assertion compares identical metadata and does not establish the promised replay-to-manifest compatibility. Parse and bind the emitted replaySQL, then hash that resulting TableDef and check manifest acceptance. Retain the mismatched-origin negative control.
Evidence: Lines 63–65 use replaySQL only for substring assertions; lines 70–78 hash the source and its clone. The separate planner test performs real replay but does not exercise the frontend normalization/hash gate. oracle-audit.log confirms this AST provenance; receipt checks/1793056704943431435-4.json records the assigned head and exit 0. This is a test-quality defect, not an observed production LOAD failure.
Validation:
-
Static checks passed for the exact head/base, clean source, frozen patch, Go formatting, all four changed files and correspondence of 14 SQL/result statements.
-
Both check receipts match the assigned source fingerprint, retained logs and exit 0. Mapping: /home/xupeng/.local/state/mo-bot/jobs/41531446b15169f8493e56a8/attempt-1/receipt-log-map.json.
-
All six nonempty discussion items were reconciled, including the earlier bot finding and author counterevidence. Saved discussion-assessment.json in the diagnostic directory.
-
Frozen exact-head CI reports successful unit, static-analysis, coverage and compose BVT checks. Detailed scope and evidence are retained in review-scope.json and review-evidence.json.
Limitations:
-
No local product tests or native builds were executed; local validation comprised static audits.
-
local_validation contains no retained worker artifacts. Current CI outcomes are reported statuses; per-test CI logs and author-local execution claims were not independently verified.
aunjgr
left a comment
There was a problem hiding this comment.
Request changes on this commit for the inline finding. This is based on source and control-flow review; I did not run a local reproduction.
| // The candidate target a replay of that output rebuilds keeps the same | ||
| // stored default text, so its fingerprint is the manifest's and the LOAD | ||
| // gate accepts it. | ||
| replay := proto.Clone(def).(*plan.TableDef) |
There was a problem hiding this comment.
[P2] Hash a definition actually rebuilt from the emitted DDL
replay is a clone of def, so comparing their hashes and passing them to tableDumpRelationSchemaMatches succeeds regardless of whether replaySQL can recreate the same frontend DUMP/LOAD fingerprint. The planner test separately exercises DDL replay and the canonical hash input, but it does not run this frontend hash/normalization boundary on that reconstructed definition.
Please build the target definition from the emitted CREATE TABLE, or exercise DUMP/LOAD end to end, and pass that target to tableSchemaHash. Keep the different-default negative control.
|
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: 095228839f5204d5d99832ffaac8525a4e35e9c9
Assessment: request_changes
The earlier production regression is resolved. The existing P2 test-oracle finding remains valid; no additional actionable issues were found.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
- P2
pkg/frontend/table_dump_default_hash_test.go:70: The positive replay/manifest test constructs replay with proto.Clone(def), rather than rebuilding it from replaySQL.
Impact: The hash comparison proves equality of identical metadata, leaving the claimed replay-to-manifest compatibility untested. Parse and bind the emitted DDL, then hash that reconstructed target and check acceptance. Retain the mismatched-origin negative control.
Evidence: Lines 58–65 only render and substring-check replaySQL; lines 70–78 hash the source and its clone. The separate planner test performs replay but does not pass its reconstructed definition through the frontend hash/normalization boundary. This confirms the unchanged prior finding, not a production LOAD failure.
Validation:
-
Static audit passed: frozen head and patch, clean source, Go formatting, 14 SQL/result statements and independent literal/hex expectations. Receipt checks/1793199918688276326-5.json matches static-audit.log.
-
All 10 discussion entries reconciled in discussion-assessment.json.
-
Frozen CI reports successful unit, static-analysis, coverage and compose-BVT checks.
Limitations:
- No local Go or BVT execution; per-test CI logs and author-local execution artifacts were not supplied.
|
This pull request is closed, so it cannot be queued. Reopen it to get the box back. |
Note
Rebased onto the merged #31067 (
4769417cd, "Fixes #31066"): main nowrenders executable DDL defaults from the stored
OriginStringand keeps thehistorical DUMP fingerprint rendering, which supersedes this branch's
previous competing re-quote implementation (whose padded
BINARYrestoreregression the review confirmed). The old head is
e73f3a365c; this PR nowcarries test-only additions on top of that merged fix: the padded-binary
replay/manifest-hash regression the review asked for, plus the e2e
default-text parity BVT pair.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #31066
What this PR does / why we need it:
The once-escaped SHOW CREATE TABLE default fix for #31066 landed on main via
#31067, so this PR rebases onto it: the superseded re-quote implementation,
its ALTER parser-mode pin (already in #31067) and the tests it duplicated are
dropped. What remains is the coverage merged main still lacks, answering the
review's P2 request ("Preserve the original default representation for
assignment-padded binary values and add a replay/hash regression test"):
pkg/sql/plan/show_create_table_default_test.go(
TestShowCreateReplayKeepsAssignmentPaddedBinaryDefault):binary(8) DEFAULT 'a'binds a NUL-paddedSvalwhile the stored default SQL textstays
'a'. SHOW CREATE must print the stored text (the padded spellingmust not leak into replayable DDL), replaying the printed DDL re-binds the
same
OriginString/Sval, a second SHOW cycle is idempotent, and thepersisted schema-hash input of the replayed table stays equal to the
source's, so a DUMP archive keeps loading into a target rebuilt from SHOW
output.
pkg/frontend/table_dump_default_hash_test.go(
TestTableDumpPaddedBinaryDefaultReplayHashMatchesManifest,TestTableDumpPaddedBinaryDefaultRejectsPaddedSpelling): the manifest/hashgate the P2 broke — the context-free replay render (dump/CDC/publication
consumers) must not print the padded bound literal, a SHOW-replay rebuild of
the target recomputes the manifest's schema hash and
tableDumpRelationSchemaMatchesaccepts it, while the padding-spellingdefault text the superseded rendering produced binds the same default bytes
but hashes differently and is rejected.
test/distributed/cases/dml/show/show_create_table_default_quote.{sql,result}:SHOW CREATE prints the once-escaped defaults, the replayed DDL stores the
same defaults, and
information_schemacolumn_default/hexvalues areidentical between source and replayed tables — complementing the merged
cases/ddl/show_create_table_default_quotepair with backslash, integerand NULL columns plus the catalog-parity checks.
Issue-to-test proof
re-quote head
e73f3a365c— it printsbinary(8) DEFAULT 'a\0\0\0\0\0\0\0'— and passes on this head; the frontend gate test fails there the same way
(
Context-free renderprints the padded spelling) and passes here.tests:
TestShowCreateTableStringDefaultRoundTrip,TestAlterCopyDefaultUsesInternalParserMode(planner) andTestTableDumpDefaultHashesMatchPre31067(frontend frozen parent-parityhashes); related sweeps stay green (
TestTableDump|TestShowCreate| TestConstructCreateTableinpkg/sql/plan, the dump-relation family inpkg/frontend).mo-servicebuild, mo-testerrunmethod): the pair 14/14 with the legacyshow_create_tablesuite 64/64 in the same directory, fix(plan): preserve replayable defaults and dump fingerprints #31067's owncases/ddlpair 12/12, and themetadata/information_schemafamily 81/81(the previously corrupted
hex(column_default)rows included); goldenresults matched, no result file was edited.
Test commands
UT (CGo-transitive packages, repository wrapper):
.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout 600s -run '^TestShowCreateReplayKeepsAssignmentPaddedBinaryDefault$|^TestShowCreateTableStringDefaultRoundTrip$|^TestAlterCopyDefaultUsesInternalParserMode$' ./pkg/sql/plan/.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout 600s -run '^TestTableDumpPaddedBinaryDefault|^TestTableDumpDefaultHashesMatchPre31067$' ./pkg/frontend/-run 'TestTableDump|TestShowCreate|TestConstructCreateTable' ./pkg/sql/plan/,-run 'TestTableDump|TestTableSchemaHash|TestGetTableDumpRelations|TestReadTableDumpManifest' ./pkg/frontend/Static:
go vet(exit 0) andgolangci-lint --new-from-rev <merge-base> ./pkg/sql/plan/... ./pkg/frontend/...(0 issues).BVT: isolated
mo-service -launch(port plan 41xxx, fresh /tmp data dirs) +shared mo-tester jars with isolated config/report under
/tmp.Risks
regenerated, so no expected output was edited.