Repository navigation
fix(agg): preserve grouped MEDIAN results across chunks and spills on 4.2-dev - #32152
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? |
|
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: 4c3cf4fb9745844193c8be7eb797875080e030ad
Assessment: approve
The MEDIAN chunk, spill-selection and failure/reuse fixes preserve existing serialization and ownership boundaries. Shared validation adds bounded work without new stateful machinery. No actionable correctness or design issue remains in the frozen 4.2-dev scope.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Full aggexec, group and vector suites passed normally and under race: 395 roots / 896 named results per mode, zero failures or skips, using Go 1.26.6 and freshly built native prerequisites.
-
All 12 focused roots and 12 adaptive race checks passed, totaling 1066 root repetitions. Merge-base controls and a targeted allocation/retry probe confirmed the repaired failures.
-
Build, vet, formatting and whitespace checks passed; timestamp tests passed with UTC and America/New_York.
-
Reused author-reported single-CN SQL/BVT results: 16/16 twice, with confirmed spill/reload.
-
Reviewed all 12 changed files and three discussion entries. Reconciled 30 validation receipts with retained logs and provenance in validation-audit.json; source remains clean.
Limitations:
-
Author SQL/BVT and microbenchmark raw logs were unavailable. No local full-service SQL, multi-CN, released-binary or performance run is claimed.
-
Relevant CI build, UT, SCA and coverage jobs remain pending in the supplied snapshot and were not counted as passes.
|
mo-bot review · Commit: Review discussion changed before publication; a fresh contextual review is queued. |
LeftHandCold
left a comment
There was a problem hiding this comment.
Reviewed a3cfb7551431d7e9d87c33383fb13c44e3757873...348fbe281899e388fa4daa5da3ee714ff7cb10f1 against the current 4.2-dev base. Approve: no actionable blocking finding in this revision. This is a code-review approval, not a claim that every CI job has finished.
Design and correctness
- Read all 13 changed files and traced the affected result-growth, serialization, Group/partial-to-MergeGroup, window and Vector consumers. This is a bounded bug fix within the existing aggregate/result owners; it does not need another state machine or serialization framework.
- Numeric and decimal MEDIAN now advance the output chunk correctly. Selected result values, empty/NULL flags and aggregate state use the same selection and actual chunk offsets, including omitted leading/middle/trailing chunks. The nonempty frame layout remains unchanged.
- Checked exact/full/partial chunk growth with preallocation, allocation errors, DISTINCT replacement decoding, and duplicate-only input after a full Group batch. Failed intermediate serialization does not publish
ExtraBufor advance the output cursor. The documented failed-growth contract is to free the executor, not retry the partially changed executor. - Rejecting a zero-selected runtime MEDIAN/window frame does not reject public empty-input SQL: in-tree spill callers serialize only nonempty buckets. Ordinary aggregate codecs retain their separate existing path.
Unhappy-path audit
| Question | Assessment |
|---|---|
| Q1 — ownership/cleanup | Temporary serialization vectors have local cleanup; Group reset/free owns failed aggregate state; replacement decoding releases the old DISTINCT hash. No new competing cleanup owner found. |
| Q2 — termination | No new blocking primitive, retry loop or background worker. Errors return through the existing operator cleanup path rather than publishing partial output. |
| Q3 — growth/performance | Allocation failures are propagated and zero-row extension of a full chunk is avoided. Selection validation is bounded by the existing chunks/flags; no persistent cache or duplicate execution path is introduced. |
Evidence and limits
- Inspected regression oracles for 8,191/8,192/8,193/16,385 groups, numeric/decimal values, NULLs, sparse selections, invalid input, allocation/serialization failure, and partial/final aggregation; the SQL case compares resident and forced-spill results and includes DISTINCT/empty controls.
- Independently verified the latest-head coverage UT job succeeded. Its log contains actual product
go testexecution, and the downloaded coverage artifact includes executed blocks in the changed aggregate, Group and Vector files. Shared build, SCA and the pessimistic multi-CN BVT check also report success; other UT/BVT jobs remain pending at review time. - The PR reports additional normal/race runs, repeated SQL/BVT, codec compatibility probes and serializer measurements. Those raw local receipts were not independently reproduced here; they are not represented as reviewer-run tests or proof of full mixed-version execution.
- Both worktrees remain unchanged;
git diff --checkand Go 1.26.4 parsing/format checks passed. The overlapping Vector change with #32155 merges cleanly at source level; this is not a combined runtime test. - No inline review threads are present to leave unresolved. Earlier bot assessments concern an older head and were not treated as approval of this revision. The main-branch portion of #32141 remains outside this PR.
|
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: 348fbe281899e388fa4daa5da3ee714ff7cb10f1
Assessment: approve
The fix keeps MEDIAN values, NULL flags and selected group state aligned across chunks and spills. It reuses existing serialization and cleanup owners; no actionable issue remains in the scoped 4.2-dev change.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed all 13 changed files, affected consumers, linked issue context and seven discussion items, including changes since the older approval.
-
Static scope/formatting audit and an independent numeric/Decimal oracle for all 16,385 SQL fixture groups passed. Receipt: checks/1793791184422054342-2.json; log: scope-audit.log.
-
Reused author-reported validation and exact-head review 5766933990, which reports executed product coverage. Older-head results were not relabelled as current checks.
-
Frozen CI snapshot: five successful, nine skipped, four in-progress and two neutral checks. Pending entries were not counted as passes.
Limitations:
-
No new local Go, SQL, race or performance execution; raw external validation artifacts were unavailable.
-
Reported codec-source probes do not establish full released-binary or multi-CN execution. The main-branch portion of issue 32141 remains outside this PR.
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed 348fbe2 against 4.2-dev. No blocking finding. MEDIAN advances the result-chunk index, selected result/NULL/group state keep identical chunk offsets, and omitted selection chunks no longer mean all rows. Group publication now propagates serialization errors before advancing its cursor or publishing ExtraBuf. The DISTINCT replacement hash and failed-growth cleanup contracts are explicit. Reviewed numeric/decimal chunk-boundary, partial Group-to-MergeGroup, selection, NULL, allocation-failure and resident/forced-spill SQL controls. Nonempty frame layout is retained; no mixed-version execution requirement is inferred. Ordinary bug-fix exemption applies. Reused exact-head green CI and author normal/race, codec and repeated SQL/BVT evidence; no local full-suite rerun.
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32141 (the 4.2-dev portion). The issue also tracks main, so this PR does not close it.
What this PR does / why we need it:
On 4.2-dev, grouped MEDIAN can overwrite earlier result chunks once there are more than 8,192 groups. During group spill, omitted selection chunks can also be interpreted as selected results while aggregate group-state offsets remain misaligned.
Validation
The nonempty frame layout is preserved. The runtime MEDIAN/window selected-zero API now returns invalid input; in-tree Group spill writes only nonempty buckets. Mixed-version remote partial/final execution, physical short-write injection, and SQL-level allocation-failure injection were not established.