Skip to content

fix: bound memory during parallel vector load - #26252

Merged
XuPeng-SH merged 3 commits into
matrixorigin:4.2-devfrom
jiangxinmeng1:cherry-pick/pr-26124-4.2
Jul 28, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:4.2-devfrom
jiangxinmeng1:cherry-pick/pr-26124-4.2

Conversation

@jiangxinmeng1

@jiangxinmeng1 jiangxinmeng1 commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #25114 #26272

What this PR does / why we need it:

fix: bound memory during parallel vector load

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@jiangxinmeng1

Copy link
Copy Markdown
Contributor Author

The Ubuntu/x86 UT failure is not introduced by this PR. All five failing packages share a pre-existing LocalFS cross-filesystem rename failure (invalid cross-device link) triggered by the CI /tmp → /mnt workspace layout. Tracking the root cause in #26272: #26272

@jiangxinmeng1

Copy link
Copy Markdown
Contributor Author

Fix for #26272 has been pushed in 8f585a4539: LocalFS temp files are now created on the target filesystem when the root path is empty, preventing EXDEV in the Ubuntu UT workspace. Validation: go build ./pkg/fileservice, go vet ./pkg/fileservice, all TestLocalFS*, and all downstream TestWriteTransferPage_* passed.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 70f9e1d against 4.2-dev@46dfc97cf284c51ce12095aa75618b1ef0410453. No blocking findings.

I traced the full memory-bound closure: parallel vector CSV decoding now avoids the varchar-plus-binary overlap; LOAD write parallelism and merge receiver buffering are capped; connector backpressure occurs before upstream batch production and terminates on context/edge completion; hashbuild transfers retained batches into spill ownership one at a time, cleans the current/remaining batches on error, and bounds per-bucket rows by observed row width. Reset and deferred cleanup close the reuse/error paths.

The compile delta is intentionally adapted to the older 4.2 join architecture rather than being patch-identical to main. SINK_SCAN-dependent shuffle receivers stay coordinator-local, while remote dispatch sources are attached to an executable scope tree; ordinary joins retain the existing 4.2 path. Late irregular-index steps rerun shuffle/runtime-filter planning after remap, with the existing RuntimeFilterBuildList guard preventing duplicate filters. The final unused-helper removal is consistent with that adaptation.

I also reviewed the added #26272 fix. With an empty LocalFS root, Write/NewWriter now create temp files beside the absolute destination, preserving same-filesystem atomic rename; non-empty-root semantics are unchanged. Creation, error cleanup, close/rename ownership, directory sync, and fd-cache boundedness were checked. I applied the exact 8f585a4 patch in an isolated worktree: the cross-filesystem regression passed under -race x10; full pkg/fileservice -race, vet, and build passed. GitHub CI is green on this head.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants