Repository navigation
[main] fix(pipeline): wake receivers from terminal edge state - #26250
Merged
XuPeng-SH merged 5 commits intoJul 27, 2026
Merged
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
approved these changes
Jul 27, 2026
1 of 7 tasks
This was referenced Jul 28, 2026
mergify Bot
pushed a commit
that referenced
this pull request
Jul 28, 2026
When normal End delivery fails on a shared `PipelineEdge` that already records a real terminal error, Connector or Dispatch cleanup currently aborts its spool with `ErrPipelineEndSignalDeliveryFailed`. Buffered spool signals can then surface that synthetic cleanup error before the durable execution error. This change resolves the spool abort cause from receiver edges first and only falls back to `ErrPipelineEndSignalDeliveryFailed` when no more specific terminal error exists. It keeps the terminal wakeup and bounded cleanup behavior from #26250 unchanged. Validation: - focused Connector regression with `-race -count=20` - `go test -race -count=1 ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/dispatch` - `go test -count=1 ./pkg/vm/pipeline` - `go build` and `go vet` for all changed packages plus `pkg/vm/pipeline` Approved by: @XuPeng-SH
1 of 7 tasks
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…origin#26250) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#26125 and matrixorigin#26202. Main forward-port of matrixorigin#26228, which carries the same logical fix for `4.2-dev`. ## What this PR does / why we need it: A fatal `PipelineEdge` terminal is recorded and closes `Done()` before all required terminal signals are enqueued into `Ch2`. When `Ch2` is backpressured, the typed terminal signal can remain partially or completely undelivered. `PipelineSignalReceiver` previously waited only on its user context and `Ch2`, so it could remain blocked after the edge was already terminal. That leaves `Merge`, `RemoteRun`, and ultimately `Compile.runOnce` waiting indefinitely. This change: - listens to each edge `Done()` channel in both the optimized 1–8 input selects and the `reflect.Select` path; - drains buffered `Ch2` signals before synthesizing a missing terminal from the durable edge state; - synchronizes and rechecks `Ch2` to preserve ordering across the fatal-state/enqueue race; - makes fatal terminal enqueue non-blocking while holding the terminal-state mutex, avoiding a control-path wait cycle behind the data channel; - adds regressions for buffered ordering, undelivered fatal terminals, shared edges, connector fallback cleanup, and reflect-select removal/reindexing across the 9-to-8 input transition. Normal `End` delivery and the legacy nil-batch compatibility path remain unchanged. The forward-port applies cleanly and is patch-equivalent to matrixorigin#26228. ## Validation - `make thirdparties && make cgo` - `go build ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - `go vet ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - focused new regressions with `-race -count=20` - `go test -race -count=1 -timeout=600s ./pkg/vm/process ./pkg/sql/colexec/connector` - `go test -count=1 -timeout=600s ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - `git diff --check` --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…in#26324) When normal End delivery fails on a shared `PipelineEdge` that already records a real terminal error, Connector or Dispatch cleanup currently aborts its spool with `ErrPipelineEndSignalDeliveryFailed`. Buffered spool signals can then surface that synthetic cleanup error before the durable execution error. This change resolves the spool abort cause from receiver edges first and only falls back to `ErrPipelineEndSignalDeliveryFailed` when no more specific terminal error exists. It keeps the terminal wakeup and bounded cleanup behavior from matrixorigin#26250 unchanged. Validation: - focused Connector regression with `-race -count=20` - `go test -race -count=1 ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/dispatch` - `go test -count=1 ./pkg/vm/pipeline` - `go build` and `go vet` for all changed packages plus `pkg/vm/pipeline` Approved by: @XuPeng-SH
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…origin#26250) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#26125 and matrixorigin#26202. Main forward-port of matrixorigin#26228, which carries the same logical fix for `4.2-dev`. ## What this PR does / why we need it: A fatal `PipelineEdge` terminal is recorded and closes `Done()` before all required terminal signals are enqueued into `Ch2`. When `Ch2` is backpressured, the typed terminal signal can remain partially or completely undelivered. `PipelineSignalReceiver` previously waited only on its user context and `Ch2`, so it could remain blocked after the edge was already terminal. That leaves `Merge`, `RemoteRun`, and ultimately `Compile.runOnce` waiting indefinitely. This change: - listens to each edge `Done()` channel in both the optimized 1–8 input selects and the `reflect.Select` path; - drains buffered `Ch2` signals before synthesizing a missing terminal from the durable edge state; - synchronizes and rechecks `Ch2` to preserve ordering across the fatal-state/enqueue race; - makes fatal terminal enqueue non-blocking while holding the terminal-state mutex, avoiding a control-path wait cycle behind the data channel; - adds regressions for buffered ordering, undelivered fatal terminals, shared edges, connector fallback cleanup, and reflect-select removal/reindexing across the 9-to-8 input transition. Normal `End` delivery and the legacy nil-batch compatibility path remain unchanged. The forward-port applies cleanly and is patch-equivalent to matrixorigin#26228. ## Validation - `make thirdparties && make cgo` - `go build ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - `go vet ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - focused new regressions with `-race -count=20` - `go test -race -count=1 -timeout=600s ./pkg/vm/process ./pkg/sql/colexec/connector` - `go test -count=1 -timeout=600s ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - `git diff --check` --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…in#26324) When normal End delivery fails on a shared `PipelineEdge` that already records a real terminal error, Connector or Dispatch cleanup currently aborts its spool with `ErrPipelineEndSignalDeliveryFailed`. Buffered spool signals can then surface that synthetic cleanup error before the durable execution error. This change resolves the spool abort cause from receiver edges first and only falls back to `ErrPipelineEndSignalDeliveryFailed` when no more specific terminal error exists. It keeps the terminal wakeup and bounded cleanup behavior from matrixorigin#26250 unchanged. Validation: - focused Connector regression with `-race -count=20` - `go test -race -count=1 ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/dispatch` - `go test -count=1 ./pkg/vm/pipeline` - `go build` and `go vet` for all changed packages plus `pkg/vm/pipeline` Approved by: @XuPeng-SH
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…origin#26250) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#26125 and matrixorigin#26202. Main forward-port of matrixorigin#26228, which carries the same logical fix for `4.2-dev`. ## What this PR does / why we need it: A fatal `PipelineEdge` terminal is recorded and closes `Done()` before all required terminal signals are enqueued into `Ch2`. When `Ch2` is backpressured, the typed terminal signal can remain partially or completely undelivered. `PipelineSignalReceiver` previously waited only on its user context and `Ch2`, so it could remain blocked after the edge was already terminal. That leaves `Merge`, `RemoteRun`, and ultimately `Compile.runOnce` waiting indefinitely. This change: - listens to each edge `Done()` channel in both the optimized 1–8 input selects and the `reflect.Select` path; - drains buffered `Ch2` signals before synthesizing a missing terminal from the durable edge state; - synchronizes and rechecks `Ch2` to preserve ordering across the fatal-state/enqueue race; - makes fatal terminal enqueue non-blocking while holding the terminal-state mutex, avoiding a control-path wait cycle behind the data channel; - adds regressions for buffered ordering, undelivered fatal terminals, shared edges, connector fallback cleanup, and reflect-select removal/reindexing across the 9-to-8 input transition. Normal `End` delivery and the legacy nil-batch compatibility path remain unchanged. The forward-port applies cleanly and is patch-equivalent to matrixorigin#26228. ## Validation - `make thirdparties && make cgo` - `go build ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - `go vet ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - focused new regressions with `-race -count=20` - `go test -race -count=1 -timeout=600s ./pkg/vm/process ./pkg/sql/colexec/connector` - `go test -count=1 -timeout=600s ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch` - `git diff --check` --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…in#26324) When normal End delivery fails on a shared `PipelineEdge` that already records a real terminal error, Connector or Dispatch cleanup currently aborts its spool with `ErrPipelineEndSignalDeliveryFailed`. Buffered spool signals can then surface that synthetic cleanup error before the durable execution error. This change resolves the spool abort cause from receiver edges first and only falls back to `ErrPipelineEndSignalDeliveryFailed` when no more specific terminal error exists. It keeps the terminal wakeup and bounded cleanup behavior from matrixorigin#26250 unchanged. Validation: - focused Connector regression with `-race -count=20` - `go test -race -count=1 ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/dispatch` - `go test -count=1 ./pkg/vm/pipeline` - `go build` and `go vet` for all changed packages plus `pkg/vm/pipeline` Approved by: @XuPeng-SH
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #26125 and #26202.
Main forward-port of #26228, which carries the same logical fix for
4.2-dev.What this PR does / why we need it:
A fatal
PipelineEdgeterminal is recorded and closesDone()before all required terminal signals are enqueued intoCh2. WhenCh2is backpressured, the typed terminal signal can remain partially or completely undelivered.PipelineSignalReceiverpreviously waited only on its user context andCh2, so it could remain blocked after the edge was already terminal. That leavesMerge,RemoteRun, and ultimatelyCompile.runOncewaiting indefinitely.This change:
Done()channel in both the optimized 1–8 input selects and thereflect.Selectpath;Ch2signals before synthesizing a missing terminal from the durable edge state;Ch2to preserve ordering across the fatal-state/enqueue race;Normal
Enddelivery and the legacy nil-batch compatibility path remain unchanged. The forward-port applies cleanly and is patch-equivalent to #26228.Validation
make thirdparties && make cgogo build ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatchgo vet ./pkg/vm/process ./pkg/sql/colexec/connector ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatch-race -count=20go test -race -count=1 -timeout=600s ./pkg/vm/process ./pkg/sql/colexec/connectorgo test -count=1 -timeout=600s ./pkg/sql/colexec/merge ./pkg/sql/colexec/dispatchgit diff --check