Skip to content

Fix worker capture vector cleanup in parallel DedupJoin - #33127

Merged
mergify[bot] merged 6 commits into
matrixorigin:mainfrom
ck89119:issue-33123-main
Nov 24, 2026
Merged

mergify[bot] merged 6 commits into
matrixorigin:mainfrom
ck89119:issue-33123-main

Conversation

@ck89119

@ck89119 ck89119 commented Nov 24, 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:

Fixes #33123

What this PR does / why we need it:

A parallel DedupJoin worker transfers captured old-column vectors to the merger, but the vectors still belong to the worker's allocation pool. Freeing them with the merger's process pool caused a panic during finalize and another while draining queued messages. Downstream operators then waited for an end signal until the SQL client timed out.

The worker records the allocation pool when it creates the capture vectors. It transfers that pool with the vectors in WorkerJoinMsg only on successful publication; on a rejected send the worker still owns the captures. Local cleanup, normal merger consumption, and mailbox draining all pass the recorded worker pool to Vector.Free, preserving its independent ownership check. No query timeout changes.

The regression test runs real worker finalization against merger consumption and the error-drain path. A separate negative test verifies that an incorrectly declared pool is rejected. Removing just the pool handoff from this revision reproduced the mismatch in the success-path test. The dedupjoin package passed normal and race tests, vet, and lint. The original revision was also checked locally with 50 self-referencing replacements on a one-million-row composite-key table. The TKE nightly workload was not rerun.

Release old-column captures using the pool recorded on each vector, not the receiving process pool. Cover both successful consumption and mailbox draining after a worker failure with an accounted worker pool.

Fixes matrixorigin#33123
@mergify mergify Bot added the kind/bug Something isn't working label Nov 24, 2026
Keep the recorded capture pool until publication succeeds. Use it to validate local and transferred vectors on release, including mailbox drains. Exercise real worker publication and reject mismatched owner pools.
@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 →

@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

@XuPeng-SH

XuPeng-SH commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 0b88faf7e265673ac1c84f68f57c96f9f8f1a75f

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: 0b88faf7e265673ac1c84f68f57c96f9f8f1a75f

Assessment: approve

Parallel DedupJoin now carries the allocating worker's pool with its captured vectors. Successful publication transfers cleanup to the mailbox consumer, and rejected publication leaves it with the worker. Normal consumption, abort drain and local cleanup share the same release routine and preserve Vector.Free's pool check.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

Validation:

  • Isolated runtime preflight, frozen patch verification and native builds passed with Go 1.27.1 and the repository's pinned dependencies. The initial host toolchain and missing jemalloc diagnostics were resolved. See review-validation.md.

  • The full dedupjoin package passed in normal and race modes. Four exact lifecycle tests passed 100 race repetitions each, covering successful transfer, abort drain, failed publication, stop/send ownership and mailbox reset. The wrong-pool test passed in both package runs.

  • Frozen CI reports successful Ubuntu unit tests, Linux arm64 static analysis and multi-CN pessimistic and proxy BVT for this head.

Limitations:

  • The exact million-row TKE nightly scenario from issue #33123 was outside local validation. The review confirms the concrete capture-cleanup failure path and its correction.

@mergify mergify Bot added the queued label Nov 24, 2026
@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue · pull request branch update failed

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

So far

  • ✅ Entered the queue Tue 24 Nov, 09:22 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 10:05 · 476b20f

Reason

The pull request can't be updated

merge conflict between base and head

To get back in the queue

  • Update or rebase the branch yourself: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, tick the box below to queue it again as it is.

Requeue requested — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot removed the dequeued label Nov 24, 2026
@matrix-meow matrix-meow added size/S Denotes a PR that changes [10,99] lines and removed size/M Denotes a PR that changes [100,499] lines labels Nov 24, 2026
@mergify mergify Bot added the queued label Nov 24, 2026
@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as af99c16 at 11:39 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Tue 24 Nov, 11:38 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 11:39 · af99c16 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit af99c16 into matrixorigin:main Nov 24, 2026
@mergify mergify Bot removed the queued label Nov 24, 2026
@ck89119
ck89119 deleted the issue-33123-main branch November 24, 2026 11:50
fengttt added a commit to fengttt/matrixone that referenced this pull request Nov 24, 2026
Resolve conflicts with matrixorigin#33115 (vector test consolidation) and
matrixorigin#33127/matrixorigin#33133 (dedupjoin captured-vector owner pool): carry the
read-only-NULL fixture to minmax_test.go, keep the pool-owned bitmap
tests in mpool_test.go, and free both the captured vectors (with their
owner pool) and the worker's matched/captured bitmaps in
freeWorkerJoinMsg. Port upstream's new tests to the pool-taking
bitmap API.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
ci — 5340b5bd Deployed Nov 24, 2026 by ck89119
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/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 自引用 REPLACE INTO SELECT ORDER BY LIMIT 在百万行表上超时

3 participants