Repository navigation
fix: release JOIN reset buffers across execution generations - #30106
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: f8f2a6d2e91ccd195319b29ac482a7952de052ab
Assessment: approve
Reviewed the complete eight-file delta. Reset correctly releases execution-owned buffers and callbacks through existing cleanup owners. Buffer recreation, dedup vector ownership, error cleanup and subsequent Free remain consistent. No actionable defects found.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
Validation:
-
Traced pipeline cleanup and Prepare/Call reuse for HashJoin, LoopJoin, DedupJoin and IndexJoin, including partial initialization and dedup expression-vector restoration.
-
Reviewed all four new allocation regressions and existing reuse, empty-input and failure tests. The new tests check actual retained allocations and callback clearing.
-
The supplied exact-head CI snapshot reports successful Ubuntu unit tests, Linux arm64 SCA, coverage, shared build and both proxy and pessimistic multi-CN BVT suites.
-
git diff --check passed for the assigned base/head. Verified command, clean source fingerprint and exit 0 in checks/1791967317714114314-3.json against diff-check.log.
-
The change removes retained generation allocations while requiring buffer recreation on subsequent executions. Per-row join processing is unchanged; no new synchronization, storage I/O or shared state is introduced.
Limitations:
-
local_validation is empty; no retained author execution receipts or raw CI logs were supplied. No local runtime tests or performance benchmarks were repeated.
-
The new regressions do not directly switch between two MPools. Subsequent execution was assessed through existing reuse tests and buffer/callback reconstruction paths.
-
Issue #30105's full text was absent from the frozen evidence; its resource-ownership contract was assessed from the PR description and source.
Merge Queue Status
This pull request spent 14 minutes 2 seconds in the queue, with no time running CI. ReasonPull request #30106 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes Fixes #30118. ## What this PR does / why we need it: Further exploration found that the original unique INNER JOIN grouping defect comes from constant-vector selection copies, not just JOIN projection. `unionT` and `unionBatch` preserve all-row uniform grouping but drop partial logical-row grouping. This also affects Batch.Clone and LoopJoin's bulk build projection. Fix the underlying vector copies: map partial grouping bits through the selection/offset/flags while keeping uniform grouping's range fast path. Remove the temporary unique-projection scalar helper and the now-unnecessary membership scalar guard; retain bulk JOIN projection. Add Go UT for vector copies, Batch.Clone, LoopJoin scalar/range/actual operator resume, and unique HashJoin. No BVT or golden changes. ## Original validation (before the 2026-10-14 base sync) - Frozen official main: `35c8dd5854750ef96f52f9dd298a70acd031d5e4`, macOS arm64. - Before fix, with official main's vector/batch/loopjoin code: 18 vector-copy combinations fail their grouping assertions 3/3; 22 controls pass 3/3. Both Batch.Clone variants and both LoopJoin bulk/operator variants reproduce 3/3; scalar LoopJoin control passes 3/3. Original unique INNER JOIN also reproduced 3/3. - Matrix covers fixed/string/NULL constants, uniform rollup, flat controls, repeated/out-of-order selections, offsets, sparse/dense/empty flags, preflighted publication, preserved prefixes, excluded out-of-range grouping bits, exact values/NULLs, and resource cleanup. - Focused vector, batch, LoopJoin and HashJoin tests pass `-race -count=10` after the root fix. - Containing vector, batch, LoopJoin, HashJoin and Product suites pass 3 rounds locally. - `make err-check` and `git diff --check` pass. - Full local license header check: 6240 files checked, 0 invalid headers (includes uncommitted exploration files, which are not part of this PR). This proves an internal vector metadata defect. No public SQL wrong-result, persistence or multi-CN reproduction is claimed. ## 2026-10-14 follow-up Merged official main `2ce4e58af6f03b943ee288ffad81012766cf830a`. Main already contains the JSON EXPLAIN compilation repair and updated logservice port fixtures; this PR no longer waits for #30106 to supply an EXPLAIN repair. The diff against main remains the six vector/batch/JOIN implementation and regression-test files. Validation of merge commit `6c7efa7ee7` on macOS arm64, using the repository's native-artifact provenance guard and `mo-cgo-test` wrapper: - Focused grouping tests in vector, batch, HashJoin and LoopJoin: passed. - Full normal-mode suites for those four packages: passed. - `git diff --check`: passed. The earlier race/repetition evidence above describes the original implementation validation, not a new race run after this merge. No BVT, external test environment, or manual CI workflow was started in this follow-up. The PR remains draft; remote checks must validate the new head. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes
Fixes #30105.
What this PR does / why we need it:
Release execution-owned off-heap JoinBatch/result buffers during
ResetinHashJoin,LoopJoin,DedupJoin, andIndexJoin. Clear const-set callbacks that capture the previous execution'sMPool; the next execution rebuilds them with its current process.The defect is resource ownership across prepared-pipeline generations. No SQL result error is claimed. The regression tests check that the previous pool has no retained allocation after Reset and that the operator remains usable with the next execution generation.
2026-10-14 base sync and conflict resolution
Merged official main
2ce4e58af6f03b943ee288ffad81012766cf830aand resolved the conflicts in JSON EXPLAIN source/tests.Main now owns the plugin-based
IndexSearchScanEXPLAIN implementation and its payload/algorithm validation. Keep those two files exactly as main, instead of restoring this branch's older manual aliases. Consequently, the PR diff against main contains only the eight JOIN implementation/test files; JSON EXPLAIN is no longer a separate change or merge dependency in this PR.The main sync also includes the corrected logservice gossip fixture port-allocator call.
Original implementation validation
ef502446dc9fd4d31cc8c969d71e9907dc358dfa, each minimal JOIN case reproduced retained allocation 3/3. A 1024-byte VARCHAR left 1048 bytes in the old MPool after Reset.-race -count=20.Validation after base sync
On merge commit
f8f2a6d2e9, macOS arm64, using the repository's native-artifact provenance guard andmo-cgo-testwrapper:TestBuildSQLJSONPlan|TestSQLJSON): passed.pkg/logservicetest compilation with-run '^$': passed. This is a compile check, not a runtime suite.git diff --check: passed.No new race run, full BVT, external test environment, or manual CI workflow was started in this follow-up. Earlier checkout/TLS failures are infrastructure failures, not claimed fixed by this merge. The PR remains draft; remote checks must validate the new head.