Repository navigation
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? |
70178a2 to
c643d85
Compare
|
mo-bot review · Commit: Review linked issue or PR description changed before publication; a fresh contextual review is queued. |
|
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: b72ed7bb117afcf359ef36bfa5b1473fe0476a0e
Assessment: request_changes
The existing CRC32 plus JSON-to-TEXT cast and persisted-expression preservation are coherent, and earlier protocol/migration restrictions are removed. One availability regression remains: the blanket fallback guard rejects FK updates that retain unchanged generated values.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P2
pkg/sql/plan/build_dml_util.go:292: Delete a parent row in an existing self-referencing table with ON DELETE SET NULL and an independent stored c=CRC32(j) using the legacy JSON expression. The child action changes parent_id, not j or c.
Impact: The DELETE now fails during planning although the existing generated value can be carried unchanged. Preserve this referential action by checking affected generated dependencies or using the existing generated-expression evaluation path when recomputation is necessary.
Evidence: crc32_catalog_compat.go:60-62 rejects solely on column presence. build_dml_util.go:1848-1856 retains original positions for unchanged columns, and :345-360 reinserts those values; the frozen base has this flow without the guard. TestCRC32LegacyGeneratedFallbackForeignKeySetNull adds an unrelated CRC input/generated pair and expects rejection. The acknowledged lack of legacy recomputation does not justify rejecting unchanged values.
Validation:
-
Reviewed the complete 37-file delta, affected owners, all 90 discussion entries, and issue 28910 with both supplied comments.
-
Static audit passed: frozen inputs, unchanged source, whitespace/formatting, unchanged protocol/migration owners, independent CRC32 oracles and complete discussion coverage. Receipt: checks/1794418269042451048-3.json; log: source-audit.log.
-
Frozen CI: 13 successful, 14 skipped and 2 neutral checks. Considered current author reports of release lifecycle validation and same-build prepared migration within their stated scope.
Limitations:
-
No local Go, SQL, race or release-binary execution; the finding follows from planner flow rather than a live baseline/candidate reproduction.
-
Author runtime logs were unavailable locally. Upgrade CI jobs were skipped; backup-product testing and deployment QA remain unverified.
|
Thanks for the review. I reproduced the unrelated self-FK The legacy update path now carries an existing stored generated value only when the recursive FK action, its changed columns and generated dependencies, and the insert projection prove that value is unchanged. Changed dependencies, virtual values, invalid/unknown expressions and unproven projections still fail closed; no old value is silently recomputed under new CRC32 semantics. The regression and 14 boundary cases pass on Ubuntu. I also created a self-referencing table with The current head The overall upgrade run remains partial: the independently observed old constant-DEFAULT ALTER COPY guard also fails on the target-main control. The SQL snapshot and old cold archive are not an independent |
fengttt
left a comment
There was a problem hiding this comment.
There are lots of things that has almost nothing to do with CRC. Should not add those random useless stuff, please keep a PR clean.
The only thing that comes to my mind is if there is a index on expression, well, that would have been an extremely bad design and we simply should advise user drop/reindex. At least I think that is good enough.
|
mo-bot review · Commit: PR closed or head changed |
|
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: 6f6439f01d84b457b7be43af6e8b957c87353844
Assessment: request_changes
The existing cast and scoped replay approach preserves stored-value compatibility without the removed protocol machinery. One correctness defect remains: function-name casing can silently change a legacy DEFAULT during MODIFY/COPY.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P2
pkg/sql/plan/crc32_catalog_compat.go:327: After upgrading a table with folded DEFAULT crc32(cast('{"t1":"a"}' as json)), repeat that definition using uppercase CRC32 in MODIFY COLUMN, preserving its type and moving it FIRST.
Impact: The unchanged default switches from 3719146973 to 4012824821. Subsequent inserts omitting the column receive a different checksum solely because function-name casing changed.
Evidence: The byte comparison rejects the uppercase spelling and rebinds it with JSON-to-TEXT conversion. A native planner/executor probe through indexed COPY and the emitted internal CREATE passes the lowercase control and fails the uppercase checksum assertion. See probe-indexed-v3-tests.log and receipt checks/1794462909795116013-4.json. Reuse the existing token-aware sameLegacyCRC32Expression comparison, preserve string-literal case, and add a DEFAULT regression.
Validation:
-
Reviewed all 31 changed files and 104 discussion entries; saved review-plan.md and discussion-assessment.json.
-
Private-runtime preflight and native owner build passed. Focused normal/vet-all tests passed: 47 roots and 185 named tests across four packages.
-
Complete owning-package run passed with 45,313 named passes and 10 unrelated skips; owner-tests.log, receipt checks/1794463027176714058-4.json.
-
Final source, discussion and receipt audit passed; assessment-audit-final.log, receipt checks/1794463144968277682-4.json. Source remains unchanged.
-
Frozen CI reports 13 successful, 14 skipped and 2 neutral checks.
Limitations:
-
The DEFAULT reproduction uses constructed legacy catalog metadata, not a live predecessor binary.
-
Current-head BVT, release upgrade/restart/cold-archive recovery and two-CN migration are author-reported; raw runtime artifacts were unavailable locally.
-
mo_br product restore remains unverified. Local SQL-service, race and performance execution was not performed.
|
@XuPeng-SH, the folded DEFAULT case in your review is addressed in The same update also handles an adjacent real v4.2.5 upgrade case: changing the old DEFAULT column from @fengttt, relative to current main there are no Validation on the new head: the standard CRC32 BVT passed 188/188; 40 focused planner tests/subtests passed; the full planner package with |
|
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: 4d28229979c011009b59528b417ab3632e1e403c
Assessment: approve
The cast-based fix preserves existing CRC32 execution semantics. Retained catalog guards protect persisted values through reconstruction and reuse existing DDL replay and assignment conversion. The earlier DEFAULT-casing and unrelated-FK findings are resolved.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed all 31 changed files, linked issues and 108 discussion entries; saved discussion-assessment.json.
-
Source/patch/owner audit and 19 independent CRC32 byte oracles passed: review-audit.log and checks/1794492290545873625-3.json. Source remains unchanged.
-
Reused frozen current-head CI: 13 successful, 14 skipped and 2 neutral checks, including successful required CI and Ubuntu UT.
-
Reused current-head author reports covering planner tests, 188/188 SQL BVT, official-v4.2.5 upgrade/restart/cold-archive recovery and distinct-CN prepared migration. Evidence scope is recorded in validation-ledger.json.
Limitations:
-
No local runtime tests were run; raw author execution logs were unavailable.
-
Unsafe legacy generated-column fallback writes remain rejected, and historical erroneous NULL values are not repaired.
-
mo_br product restore, native performance and deployment QA remain unverified.
|
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: 1609272f9908fd91aeb9b3a89dd541098b8e6a8c
Assessment: approve
New JSON bindings reuse the existing CAST and CRC32 function. Scoped replay and assignment/input guards remain necessary to preserve legacy stored values. Earlier findings are resolved; no actionable defects remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete 31-file delta, affected consumers, both linked issues and all 110 discussion entries; saved discussion-assessment.json.
-
Static/source audit passed: review-audit-v3.log and checks/1794543722301622392-3.json. Verified frozen inputs, unchanged source, whitespace, released CRC32 identity and 19 independent byte oracles.
-
Confirmed 29/31 changed files and relevant functions in the other two match the previously validated candidate. Reconciled earlier author-reported v4.2.5 lifecycle, SQL BVT and prepared-migration results within that unchanged scope.
-
Reused exact-head CI: 13 successful, 14 skipped and two neutral checks, including UT, coverage, SCA and multi-CN BVT. Upgrade jobs were skipped.
Limitations:
-
No local Go/native, SQL-service or release-runtime tests were run; raw author execution artifacts were unavailable.
-
Unsafe legacy generated-column fallback writes remain rejected, and historical erroneous NULL values are not repaired.
-
mo_br product restore and deployment QA remain unverified; old cold-archive recovery is separate evidence.
Maintenance update — 2026-11-13Merged target On the immediately preceding candidate Resolved the four obsolete inline threads for protobuf/CRC32-specific executor options and helper constants: those changes are absent from the current implementation. Full current-head CI/BVT and the separate upgrade/backup acceptance remain outstanding. |
CI update — 2026-11-13Exact-head workflow run 43392904951 completed successfully. Shared build, coverage UT, arm64 SCA, pessimistic multi-CN BVT and Ubuntu/x86 UT passed. The multi-CN artifact does not select The current-head CRC32-specific BVT remains NOT_RUN. Its personal Ubuntu host's shared admission lock is still present without an owner record, so safe availability cannot be established. I did not remove the lock or touch processes. The bounded 12 ordinary plus 12 |
|
mo-bot review · Commit: Review discussion changed before publication; a fresh contextual review is queued. |
|
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: c28854ee8fcb7f4706f2cb84a73da90df8484134
Assessment: approve
The existing TEXT cast and CRC32 identity provide the new behavior without extra protocols or overloads. Scoped replay and narrow guards preserve legacy stored values, which an index rebuild alone cannot protect. The concrete compatibility and migration concerns are addressed. Updated CI/status comments do not invalidate the matching completed evidence; no actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Complete 31-file source coverage and all 115 discussion entries reconciled. Source, patch, fixtures, dependencies and frozen CI are unchanged from the preceding full review; changed/new discussion bodies were assessed.
-
Current audit passed: all changed-file hashes, 198 native inputs and retained outputs, 64 evidence artifacts and 11 original command/source/exit receipts matched. Nineteen independent CRC32 byte oracles were recomputed. Receipt: checks/1794566932669761418-2.json.
-
Reused exact-head isolated single-CN canonical SQL runs: 188/188 twice, zero failed/ignored/abnormal statements, and independently verified zero residual database/tables after each round. Original receipt and logs are retained under reused-evidence; no Go tests or native builds were rerun in this job.
-
Frozen CI: 13 successful, 14 skipped, 2 neutral checks. Broad BVT omits func_crc32; upgrade jobs were skipped. validation-audit.json distinguishes the new audit from reused executions.
Limitations:
-
Earlier v4.2.5 upgrade/restart/old cold-archive reports remain qualified supplied evidence, not a fresh release-upgrade test. mo_br, deployed QA and complete issue #28910 closure remain unverified.
-
Legacy fallback still rejects unsafe old CRC32 generated-column writes and does not repair preexisting NULL values; complete old-table DML availability is not claimed.
-
Canonical tester comparisons ignored metadata. Two retained setup failures executed no CRC32 comparisons. The earlier author-side CGo abort remains unexplained and did not recur in the retained successful runs.
|
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: 1703f86b8ce571c95db2a4d941f36a0b0aaa559a
Assessment: approve
No actionable findings remain. New JSON calls reuse TEXT conversion and existing CRC32 execution; scoped replay and input guards protect legacy materialized values. The queue fix closes the lost-wakeup window using the existing scheduler. Earlier protocol, migration, DEFAULT and FK concerns are addressed.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 33 changed files, affected owners/consumers, both linked issues and all 118 discussion entries. discussion-assessment.json covers every key exactly once.
-
Source audit passed: clean frozen head, patch correspondence, whitespace, gofmt on 30 Go files, 188 SQL/result statement pairs, 19 independent checksum oracles and a three-ordering queue model. Receipt: checks/1794824741699876945-2.json; retained stdout confirms PASS and stderr is empty.
-
Isolation preflight passed: checks/1794824069462016103-2.json. This was not a product test.
-
Reused frozen CI: 13 successful, 14 skipped and 2 neutral checks. Reconciled relevant code and fixtures with supplied historical CRC32 BVT, v4.2.5 upgrade/restart/cold-archive recovery and prepared-migration reports.
Limitations:
-
No fresh Go/native, race, service, BVT or release execution. Historical runtime reports remain attributed evidence; their raw artifacts were unavailable locally.
-
Unsafe legacy fallback writes remain rejected, and preexisting erroneous NULL values are not repaired.
-
mo_br product restore and deployment QA remain unverified; upgrade CI jobs were skipped.
|
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: 031557350606c2826c564a1dda70af13186db1fd
Assessment: approve
No actionable findings. New JSON calls reuse TEXT conversion and existing CRC32 execution. Scoped replay and narrow guards preserve materialized legacy values; the queue fix closes the completion handoff through the existing scheduler. Earlier protocol, migration, DEFAULT and FK concerns are addressed.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 33 changed files, affected owners, both linked issues and all 121 discussion entries.
-
Static audits passed: source/patch identity, whitespace, gofmt, 19 checksum oracles, 188 SQL/result statement pairs and six modeled queue orderings. Receipts and logs are reconciled in validation-evidence.json.
-
All 33 changed files match the preceding reviewed candidate; 20 core functions match the reported release-tested revision.
-
Reused qualified historical BVT/release/migration reports and frozen CI: 13 successful, 14 skipped and 2 neutral checks.
Limitations:
-
No fresh local Go, native, race, service or release execution; historical raw runtime artifacts were unavailable.
-
Unsafe legacy fallback writes remain rejected; erroneous historical NULL values are not repaired.
-
mo_br restore and deployed QA remain unverified. Upgrade CI jobs were skipped; the earlier author-side CGo abort remains unexplained.
|
mo-bot review · Commit: "interrupted" |
Rebase update — 2026-11-16
Rebased and pushed onto upstream
main8e8708a8d306a69512d140b40bfcfebc1d404a32; current head:031557350606c2826c564a1dda70af13186db1fd.git diff --checkpasses and GitHub reports the PR mergeable. Exact-head run 43871964993 completed with 13 success, 14 skipped, 2 neutral and no failures. Shared Build, Ubuntu/x86 UT, coverage UT, arm64 SCA, PROXY and pessimistic multi-CN BVT, CI preflight, Iceberg adapter tidy and Summary passed. Local PASS on darwin/arm64 with Go 1.27.1:mo-cgo-testran 7 focused CRC32 compatibility tests acrosspkg/sql/planandpkg/sql/plan/function.Remaining gates: fresh review on this head; the dedicated 188-statement
func_crc32.sqlBVT remains NOT_RUN because the shared-host lock has no verifiable owner; compatiblemo_brbackup/restore and deployed QA remain open. No unresolved inline review threads remain.What type of PR is this?
Which issue(s) this PR relates to
Partially addresses #28910; the issue remains open pending QA and the gaps below.
What this PR changes
Newly bound
CRC32(JSON)casts the JSON value to text and passes those bytes to the existing CRC32 function. JSON strings retain their quotes and escapes. SQL NULL and JSONnullremain distinct; non-JSON inputs keep their existing behavior.Already persisted expressions retain their old binary-JSON semantics. For example, on an official v4.2.5-created table, a stored generated column for
{"t1":"a"}contains3719146973, while a newly boundCRC32(j)returns4012824821. This difference is intentional: silently rebinding the old expression would make later writes disagree with existing generated values. Rebuilding an index over the generated column alone would not recompute those values.The catalog and DDL compatibility code preserves old bound expressions through supported ALTER COPY and LIKE reconstruction, including their column references. An explicitly changed generated expression uses the new semantics and rebuilds its values and dependent indexes. This update reuses the existing scoped DDL replay rather than adding a CRC32-specific executor option or context key; it removes the added overload constant as well.
The CRC32-specific migration refusal and direct-table proof protocol are removed. Existing mainline lifecycle checks and
RequiredProtocolVersionremain in place. No CRC32-specific protobuf schema or new CRC32 overload is added.A separate CRC32 execution identity would make the algorithm distinction explicit but would still need DDL reconstruction to retain the old bound identity, and would not by itself fix the legacy DML fallback that does not evaluate generated columns. It also adds a durable function identity and its compatibility maintenance. A third route is to convert all old expressions and rebuild materialized data, indexes and constraints with a recovery contract. That changes the product contract and is not performed by this PR.
The MODIFY/CHANGE compatibility check compares SQL tokens when a persisted DEFAULT is repeated: changing function-name casing preserves the old folded value, while changing string-literal content is treated as an explicit new expression. Ambiguous historical spellings are rejected when a CRC32 call may be involved; an unrelated ordinary string literal containing
crc32does not acquire that restriction. When the output column type changes without changing the expression, the existing assignment conversion is applied to the stored default; an out-of-range conversion fails instead of rebinding the SQL to the new CRC32 algorithm.Validation and remaining gaps
Previous submitted head — 2026-11-16 (before latest main rebase)
Head
06549d553334bc6e63690f6a2380ff8f275f561bis based on upstreammainat3399778af96aa97c22dd8b752155eefb0c49dc97. The PR patch was preserved during the rebase; GitHub reports no merge conflict. Exact-head CI remains in progress, with no failures reported in the current run. The latest approval reviewed the prior head1703f86b8ce571c95db2a4d941f36a0b0aaa559a, so this head still needs re-review. The CRC32-specific 188-statement BVT remains NOT_RUN; upgrade/backup restore and deployed QA are also open, as detailed below.Previous submitted head — 2026-11-13
Head
c28854ee8fcb7f4706f2cb84a73da90df8484134merges targetmainthrough3ac43c9. In exact-head CI run 43392904951, shared build, coverage UT, arm64 SCA, pessimistic multi-CN BVT and Ubuntu/x86 UT passed; workflow run concluded success. The generic multi-CN artifact does not selectfunc_crc32.sql.The current-head CRC32-specific 188-statement BVT is NOT_RUN: the personal Ubuntu host's shared admission lock is present, but its owner record is missing, so ownership and availability cannot be established. I did not remove the lock or touch processes. A preceding full attempt stopped at 98/188 with a CGo double-free; the cause remains undetermined. The bounded 12 ordinary plus 12
CRC32(JSON)generated-column cycles passed on preceding head1609272f, not this head. Upgrade/backup and deployed QA acceptance remain open.Previous submitted candidate before the 2026-11-13 sync:
1609272f9908fd91aeb9b3a89dd541098b8e6a8c, including maina626dd045a656c801b6730732adc16df056379d3. At that time, exact-head CI, full planner tests, SQL BVT, migration and the v4.2.5 upgrade/restore were pending. On the immediately preceding merge candidate23bb14377c225ed6081591f37d00466f1f1f4b35, focused CRC32 executor, planner, protocol, identity and JSON-owner tests passed. The later main merge changed storage-engine code, so those results are not presented as exact-head runtime evidence.Previous candidate (historical):
4d28229979c011009b59528b417ab3632e1e403c, based on6c38b0df3e676a950852b78e44803f22b15a7e72with main4760bcaa88b23fabe064b1631b624c0e8c40d549. The previous candidate's required CI passed on attempt 2. Attempt 1 failed in the Ubuntu x86 race-UT job.TestPartialFlushBusyTombstoneKeepsDeleteAcrossRestartencountered a deadline and a nil-pointer panic around engine restart;TestViewDescriptionSubscription/historical_publication_authorization_and_source/alias_membership_remains_historicalencountered a context deadline. The checkpoint test passed when replayed serially on this head with-race,matrixone_testand short mode in an isolated Ubuntu namespace. The subscription test instead aborted earlier in a different subtest with a CGo double-free signal, so that attempt did not reproduce the CI timeout. The same named subtest also aborted with a double-free on target main under the same race, tag and short settings in an isolated namespace (using a different cache location); this establishes a baseline occurrence, not the cause of the original timeout. Neither observation establishes the original CI causes or their relationship to this PR. A single targeted retry of the failed CI job was requested after the checkpoint replay and the earlier successful CI on the same base; attempt 2 passed on a different runner. The cause of the original attempt-1 failures remains undetermined. Required CI passed on the preceding head; that success is historical, not current-head CI.4d28229979c011009b59528b417ab3632e1e403c, 40 focused planner tests/subtests passed, covering output-type conversion, out-of-range conversion, non-JSON CRC32, case-only and changed-string DEFAULTs, ambiguous origins, and indexed ALTER COPY/internal CREATE. These planner fixtures exercise constructed old catalog metadata; they do not by themselves establish an upgrade. The complete planner package passed with-vet=allon the previous candidate: 24,490 named tests and subtests passed, and 2 were skipped (TestPrepareHnswIndexContext_DifferentDistanceFunctions/cosine_similarityandTestProjectionBinderMakeFrameConstValue/Interval_expression_-_should_call_resetInterval).4d28229979c011009b59528b417ab3632e1e403c, a real stopped-service upgrade from official v4.2.5 passed the old generated values and physical indexes, later writes, ALTER/LIKE, an explicitly changed generated expression, restart, and restoration of an old-version cold archive. A separate old-release DEFAULT table with a physical index passed case-only MODIFY/COPY, later inserts, a deliberately changed JSON string, indexed lookups, restart, and cold-archive restore. Its old default remains3719146973, while a newly bound query for the same JSON returns4012824821. The cold archive is not a test of the separatemo_brproduct.4d28229979c011009b59528b417ab3632e1e403c, the standard CRC32 SQL BVT passed 188/188 with normal expected-result comparison and observed task readiness. Ordinary prepared WHERE and parameterized CRC32 queries passed migration between distinct CNs on the previous candidate.6c38b0df3e676a950852b78e44803f22b15a7e72exposed an output-type bug: changing the old DEFAULT column from unsigned to signed without changing its expression made a later insert use4012824821instead of3719146973. On the previous candidate4d28229979c011009b59528b417ab3632e1e403c, the same type change retains3719146973in both the old and subsequent row. LIKE, additional writes after restart, and recovery from the old cold archive preserve the same default.mo_brbackup and restore remains unverified. New/old CN mixed operation, old-CN reentry and downgrade are outside this PR's selected scope. Blocking reviewer decisions remain outstanding; the cause of the earlier CI failure remains undetermined.