Skip to content

fix(external): isolate parallel worker runtime parameters - #31496

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/25bda321a382e543052b7bb5fa98c625f0d014d6a44ee1b1008140c2b67bfe1c
Oct 28, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/25bda321a382e543052b7bb5fa98c625f0d014d6a44ee1b1008140c2b67bfe1c

Conversation

@iamlinjunhong

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:

What this PR does / why we need it:

Parallel LOAD workers share a statement's tree.ExternParam. Preparing workers and opening their readers write its context and FileService, causing data races and overwriting another worker's parser context.

Copy the top-level parameter on every Prepare before runtime writes. Each worker keeps its own context and service binding while nested configuration remains shared and read-only. Preserve explicit services, the executing worker's nil-service fallback, remote decoding and Arrow rollout checks. The copy adds one fixed-size allocation per Prepare and no per-row work or synchronization.

Regression coverage includes concurrent preparation, distinct file services and real JSONLINE reads, independent parser cancellation, reset/reprepare, rejected input, decoded parameters and the Arrow S3-alias gate.

Validation on macOS arm64 / Go 1.27.1:

  • Original source fails the new regression through a source overlay; repaired source passes.
  • Repository CGo wrapper: focused tests and the complete external package pass in normal and race modes, with no skipped tests.
  • The exact concurrent regression passes 100 repetitions under the race detector.
  • Formatting, changed-package go vet and repository-configured incremental golangci-lint pass (0 issues).

CI is pending. No public SQL or wire format changes; no new BVT was needed for this internal ownership fix. Leave the issue open for reporter verification after merge.

@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 →

@XuPeng-SH

XuPeng-SH commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: ea97e79be6007eb51d29716b806d5821d21de717

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: ea97e79be6007eb51d29716b806d5821d21de717

Assessment: approve

Reviewed the complete delta, linked issue, discussion and affected lifecycle. The copy correctly isolates worker context/service writes while preserving configuration, cleanup and rollout behavior. No actionable findings remain; the discussion contains no substantive disputes.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Baseline production overlay reproduced FileService/Ctx races and shared-template mutation.

  • Candidate external-package tests passed in normal and race modes; the focused concurrency test passed 100 repetitions.

  • go vet for external and the compiler-package build passed.

  • Native provenance, source fingerprints, command/exit receipts and retained logs independently reconciled in /home/xupeng/.local/state/mo-bot/jobs/ca0e9593a12fec415f1c8d45/attempt-2/validation-audit.json. Source remains unchanged.

  • Complete discussion ledger saved as attempt-2/discussion-assessment.json.

Limitations:

  • One existing MinIO integration test skipped because its binary is unavailable; the changed disk-backed S3 alias test passed.

  • Validation exercised production operators directly, without a full SQL cluster run or performance benchmark. Frozen CI did not establish core-test coverage.

@mergify mergify Bot added the queued label Oct 28, 2026
@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

40 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 28 Oct, 05:12 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 05:53 · 984d9e0

Reason

Pull request #31496 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.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You 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.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Merge conditions: 2 of 3 met

This pull request

Condition Required by
✅ #review-threads-unresolved = 0 GitHub branch protection
✅ github-review-approved GitHub branch protection

The batch, tested in place

Condition Required by
❌ any of: check-neutral = CI Required, check-skipped = CI Required, check-success = CI Required GitHub branch protection

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

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

dequeued kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants