Repository navigation
fix(sql): preserve ROLLUP provenance across remote batch transport - #29115
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? |
a7cbe87 to
61814b6
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
COMMENT — PASS at 61814b64b483e14c36666fcf95cfe5c902e9b062; self-authored PR, so comment only. No actionable P0–P2 findings after tracing grouping provenance through batch encoding, both senders, remote execution, decoding, merge consumers, compatibility gates, cleanup and reuse.
The codec preserves payload/ExtraBuf and validates grouping framing; forwarding carries the requirement through scopes; remote clients reconstruct each batch before decoding and use existing terminal cleanup on errors. The dual-CN TestRollupRemoteGroupingProvenance passed in exact-head CI.
Residual evidence gaps: no verified real mixed-binary execution or grouping-specific fragmentation, cancellation/retry, and prepared-reexecution matrix. Old-coordinator execution and post-probe binary replacement remain rollout limitations.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #29096
What this PR does / why we need it:
Preserve vector grouping provenance across both remote batch senders and the
shared receiver. Previously the wire retained NULLs and aggregate/hash metadata,
but dropped grouping bits: a ROLLUP sentinel became an ordinary SQL NULL,
splitting hash domains or violating NOT NULL partial-group metadata. In-memory
Dup tests hid the lossy edge.
ExtraBuf and parameter/string provenance. Non-grouping wire bytes, persistent
vectors and spill format are unchanged.
sending destinations/sources, including a stripped top-level Dispatch and
forwarding-only scopes. Preserve the query requirement through redispatch;
fail closed for old/unknown peers without blocking local-only ROLLUP.
dual-CN fixture with physical peer-address proof and exact result assertions.
fixture; replace its old unknown-result placeholder with independently derived
totals (139.95 = 89.96 +49.99) and all11 grouping-level rows.
Design and review
GPT-6 medium produced the design and performed whole-change R3 wire/compatibility
review. Fixed its two intermediate compatibility findings (stripped Dispatch
destinations and local-only placement), and the final P2 assertion-failure
cleanup finding. Re-review: code APPROVE, no outstanding code blockers.
Validation evidence
Base:
3ac87c30625fc082391e5384a4c94e50a2916cf6; Linux/amd64, Go1.26.4,native CPU build via
make cgo. Go tests use.agents/skills/mo-dev/scripts/mo-cgo-test.codec;
TestPipelineGroupingRoundTripfails at the lost grouping marker,completed exit1. Current codec normal/race tests pass.
Final group40.216s, compile7.854s, DML408.560s. DML includes forced remote
SQL for true NULL vs ROLLUP, NOT NULL/window, empty input, CTE, COALESCE and JOIN.
malformed/truncated payloads, decoder reuse, peer rollback/unknown versions,
forwarding scope redispatch and stripped Dispatch checks. MPool returns to0.
DML.
gofmt,go vet -mod=readonly, golangci-lint2.6.2 with--new-from-rev 3ac87c30625fc082391e5384a4c94e50a2916cf6: exit0, 0 issues.This is not a claim that full repository CI/SCA ran.
make build-with-prebuilt-native: exit0. Binary SHA256:23f491cf9ddf5ad54742fff0034aa6d323e7ccfd34e2848cae4e4768ba231b91.ebed6c8db2f19c48a5581a136fd2915f084d0d36pass on the candidate service:20000,25287,25499,26022,26269 (the last file's
additional SQL-semantics cases also pass). Executed original SQL and compared
tab-separated results exactly with upstream
.resultafter removing onlyechoed query text; no expected values changed. Catalog teardown:0 databases.
function/mysql_compat_null_rollup_grouping.sql:7/7 twice;unskipped
window/rollup.sql:228/228 twice,0 failed/ignored/abnormal.Each run confirms0 remaining test databases. Existing
.sql/.resultformatretained; the newly enabled golden was independently calculated and approved
by GPT-6 medium, not generated from candidate output.
Remaining risks / rollout
MORPC87; old/unknown peers get an explicit unsupported error. Old coordinators
are not retroactively protected by this change.
probes do not fence a connection replacement after the probe.
grouping forwarding scopes also carry the existing query-plan field.
topology evidence and candidate BVT/SQL results are distinguished below.