Repository navigation
fix(median): correct unaccounted results across chunks - #32182
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: 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: 220c4c8e4c2e00df8501eb0b4520e22794bf6d8d
Assessment: approve
The fix advances unbound MEDIAN values and NULL markers to the correct output chunk and restores the shared cursor after fully filling preallocated chunks. It reuses existing result ownership, allocation checks and append rollback, with no new state or format. Independent value/error/cleanup oracles and all nine locally executed regression roots support the change. No actionable correctness, design or required-validation gap remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Read every hunk in all nine changed files, both indexed discussion entries and linked issue #32141 with its decimal follow-up; traced shared result consumers, baseline behavior, allocation failures, output transfer and cleanup.
-
Isolation preflight passed. Built native prerequisites using the repository's top-level make cgo in the diagnostic workspace; verified 198 frozen native/build input hashes and retained output hashes and build log.
-
Go 1.27.1 focused tests passed with the supplied test-exec: nine regression roots across pkg/container/vector, pkg/sql/colexec/aggexec and pkg/sql/colexec/group, covering chunk boundaries, account-bound controls, NULLs, preallocation, DISTINCT/percentile/ranking, capacity errors, rollback and cleanup. See focused-components-recovered.log and checks/1793801003177700529-2.json.
-
Frozen-source audit passed: exact clean HEAD, supplied patch match, complete change/discussion coverage, git diff --check, gofmt for all seven changed Go files, native-input provenance and reconciliation of the focused test receipt with actual passing roots. See frozen-audit.log and validation-audit.json.
Limitations:
-
The frozen CI snapshot has build, UT, SCA and coverage still in progress; none was counted as a completed product-test pass. Initial native/toolchain/proxy setup failures were recovered and are retained as environment diagnostics.
-
Local execution was limited to the nine focused roots. Full-package/race checks, two single-CN SQL BVT runs with observed spill/reload and the performance comparison are author-reported evidence without supplied raw logs. Multi-CN and released binaries were not validated.
3d82a0a to
5606a71
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: 5606a71f6274b6a21abf22f5474ae69a9669d484
Assessment: approve
The fix corrects MEDIAN output-chunk and preallocated-result cursors without adding state. It reuses existing allocation and rollback owners, while deterministic expiry tests retain separate real-timer coverage. No actionable defect remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 10 changed files, complete discussion and linked issue; traced result consumers, allocation failures, cleanup and expiry-test lifecycle.
-
Local frozen-audit.log matches checks/1793825069396684664-2.json, exit 0: frozen head, clean source, patch consistency, diff whitespace, gofmt, prior-core comparisons and independent SQL value/NULL oracles.
-
Reused the supplied prior review's nine focused regression passes after verifying unchanged relevant owners and tests; intervening Vector and expiry-test changes were reviewed separately.
-
Author reports four owning packages passing normal/race tests, both changed expiry tests passing 100 individual race repetitions each, and scoped static checks.
-
Author reports two rebased-head single-CN SQL runs with teardown and observed spill/reload. These cover the account-bound control; aggregate/Group regressions cover the unbound defect.
Limitations:
-
No fresh local Go, race or SQL execution; supplied prior-review and author results were reused without embedded raw logs.
-
Frozen build/UT/SCA/coverage CI remains pending and was not counted as passing. Multi-CN and released binaries were not validated.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32141
What this PR does / why we need it:
Unaccounted MEDIAN could overwrite the first result chunk and corrupt both values and NULL markers when results crossed a chunk boundary (8192 groups in Group). Advance the output chunk with the group offset for numeric and decimal results. Also correct the shared split-result cursor for multiple fully preallocated chunks and avoid unnecessary allocations on zero growth or when the current chunk is full.
Document the existing Vector append failure contract and exercise checkpoint rollback, reuse, and allocation-account cleanup after a real grouped varlen allocation failure.
Make the remote allocation statement-group expiry tests deterministic by triggering expiration after the first fragment finishes, and verify that only the still-active fragment is canceled. A separate test continues to exercise the real timer.
Validation:
vector,aggexec,group, andcompilepackage tests in normal and-racemodes; both changed expiry tests also passed 100 individual-racerepetitions each. Incrementalgofmt,go vet,molint, andgolangci-lint.This change does not modify wire formats or the account-bound MEDIAN implementation. Multi-CN and released binaries were not tested.