Repository navigation
fix: decouple local shuffle producers from consumers - #26097
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed the asynchronous fixed-bucket shuffle lifecycle, including producer/consumer ownership, cancellation, nested backpressure, Prepare/Reset ordering, shared-pool cleanup, terminal error propagation, and boundedness. Build, vet, targeted tests, full owning-package tests, race tests, and focused race stress passed. No blocking issues found.
Merge Queue Status
This pull request spent 29 minutes 36 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26097 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.
Failing checks:
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. Tick the box to put this pull request back in the merge queue (same as
|
) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25922 ## What this PR does / why we need it: Fixed-bucket local shuffle workers previously produced and consumed through the same pull pipeline. With bounded bucket queues, nested shuffles could form a wait cycle: a worker blocked while publishing to another bucket and therefore stopped draining the bucket needed by a sibling producer. This change separates each local shuffle worker into an asynchronous producer and a fixed-bucket consumer. Producers use query-scoped contexts, bounded pool writes, explicit consumer closure, and deterministic producer-before-child cleanup. The VM preparation traversal now lets Shuffle prepare its child tree with the same producer process that will execute it, preventing early worker cleanup from cancelling contexts retained by prepared children such as Merge. The compiler workarounds that rejected nested local shuffle topologies are removed because the execution layer now supports them directly. Validation: - `mo-cgo-test -race ./pkg/sql/colexec/shuffle ./pkg/vm/pipeline` - critical cancellation and cleanup tests with `-race -count=20` - `mo-cgo-test ./pkg/vm ./pkg/sql/compile ./pkg/sql/colexec/group ./pkg/sql/colexec/hashjoin` - `git diff --check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25922 ## What this PR does / why we need it: Fixed-bucket local shuffle workers previously produced and consumed through the same pull pipeline. With bounded bucket queues, nested shuffles could form a wait cycle: a worker blocked while publishing to another bucket and therefore stopped draining the bucket needed by a sibling producer. This change separates each local shuffle worker into an asynchronous producer and a fixed-bucket consumer. Producers use query-scoped contexts, bounded pool writes, explicit consumer closure, and deterministic producer-before-child cleanup. The VM preparation traversal now lets Shuffle prepare its child tree with the same producer process that will execute it, preventing early worker cleanup from cancelling contexts retained by prepared children such as Merge. The compiler workarounds that rejected nested local shuffle topologies are removed because the execution layer now supports them directly. Validation: - `mo-cgo-test -race ./pkg/sql/colexec/shuffle ./pkg/vm/pipeline` - critical cancellation and cleanup tests with `-race -count=20` - `mo-cgo-test ./pkg/vm ./pkg/sql/compile ./pkg/sql/colexec/group ./pkg/sql/colexec/hashjoin` - `git diff --check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25922 ## What this PR does / why we need it: Fixed-bucket local shuffle workers previously produced and consumed through the same pull pipeline. With bounded bucket queues, nested shuffles could form a wait cycle: a worker blocked while publishing to another bucket and therefore stopped draining the bucket needed by a sibling producer. This change separates each local shuffle worker into an asynchronous producer and a fixed-bucket consumer. Producers use query-scoped contexts, bounded pool writes, explicit consumer closure, and deterministic producer-before-child cleanup. The VM preparation traversal now lets Shuffle prepare its child tree with the same producer process that will execute it, preventing early worker cleanup from cancelling contexts retained by prepared children such as Merge. The compiler workarounds that rejected nested local shuffle topologies are removed because the execution layer now supports them directly. Validation: - `mo-cgo-test -race ./pkg/sql/colexec/shuffle ./pkg/vm/pipeline` - critical cancellation and cleanup tests with `-race -count=20` - `mo-cgo-test ./pkg/vm ./pkg/sql/compile ./pkg/sql/colexec/group ./pkg/sql/colexec/hashjoin` - `git diff --check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #25922
What this PR does / why we need it:
Fixed-bucket local shuffle workers previously produced and consumed through the same pull pipeline. With bounded bucket queues, nested shuffles could form a wait cycle: a worker blocked while publishing to another bucket and therefore stopped draining the bucket needed by a sibling producer.
This change separates each local shuffle worker into an asynchronous producer and a fixed-bucket consumer. Producers use query-scoped contexts, bounded pool writes, explicit consumer closure, and deterministic producer-before-child cleanup. The VM preparation traversal now lets Shuffle prepare its child tree with the same producer process that will execute it, preventing early worker cleanup from cancelling contexts retained by prepared children such as Merge.
The compiler workarounds that rejected nested local shuffle topologies are removed because the execution layer now supports them directly.
Validation:
mo-cgo-test -race ./pkg/sql/colexec/shuffle ./pkg/vm/pipeline-race -count=20mo-cgo-test ./pkg/vm ./pkg/sql/compile ./pkg/sql/colexec/group ./pkg/sql/colexec/hashjoingit diff --check