Repository navigation
Conversation
Record normal pipeline completion durably even when data fills the signal channel, and keep substantive execution failures from being replaced by sibling cancellation fallout.\n\nFixes matrixorigin#26743\nFixes matrixorigin#26745
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? |
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed exact head 120107d against merge base 9a7c98b.
[P1] Preserve an independent deadline when it is joined with cancellation fallout.
If an operator returns errors.Join(context.DeadlineExceeded, context.Canceled) while the pipeline is normally canceled, isScopeCancellationError accepts every leaf, errors.Is(err, pipelineCtx.Err()) succeeds through the context.Canceled sibling, and the pipeline cause replaces the whole join. With an active query context, lines 624-628 then normalize the result to nil. Scope.Run therefore reports success even though the independent operator deadline should remain terminal. The direct DeadlineExceeded case in TestScopeRunPreservesCancellationCause does not exercise this joined form.
Please classify the cancellation leaves by their causal source (or otherwise retain any independent deadline leaf) and add the joined DeadlineExceeded + Canceled counterexample.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 120107d against merge base 9a7c98b.
[P1] Preserve an independent deadline inside a joined cancellation error.
isScopeCancellationError treats errors.Join(context.DeadlineExceeded, context.Canceled) as wholly cancellation-shaped. If the pipeline was normally canceled, errors.Is(err, pipelineCtx.Err()) succeeds through the context.Canceled leaf; lines 624-628 then replace the complete join with the pipeline cancellation cause and suppress it because the query context is still active. Scope.Run consequently returns success even though an independent operator deadline occurred.
A minimal counterexample on this head calls normalizeScopeRunError(errors.Join(context.DeadlineExceeded, context.Canceled), normallyCanceledPipelineCtx, activeQueryCtx): expected an error matching context.DeadlineExceeded, got nil.
Please classify joined leaves by causal source or retain independent deadline leaves, and add this exact regression. The durable End/Done state machine, spool cleanup ordering, query-owned deadline classification, and first substantive root-error propagation otherwise look sound.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 3c62ade against merge base 9a7c98b.
No blocking findings.
The latest commit closes my previous P1: joined errors are now classified leaf by leaf, so errors.Join(context.DeadlineExceeded, context.Canceled) cannot be attributed wholesale to normal pipeline cancellation. The new Scope.Run and remote-cancellation regressions exercise that exact counterexample.
Lifecycle review also checks out:
- End is recorded durably without waiting for Ch2 capacity; Done wakes the receiver, which drains queued data/signals before synthesizing a missing End.
- Shared-sender counts and fatal first-wins state remain coherent across full channels; Error/Abort causes stay observable.
- Connector/Dispatch defer normal spool reclamation until the paired Merge has quiesced, while failure paths abort immediately; reuse drains stale signal-owned resources before resetting terminal state.
- Scope aggregation preserves substantive/root errors, independent deadlines, query-owned deadline classification, and only suppresses cancellation leaves attributable to the same canceled context.
Validated on this exact head:
- go build and go vet: pkg/vm/process, pkg/sql/compile, pkg/sql/colexec/connector, pkg/sql/colexec/dispatch, pkg/vm/pipeline
- go test -count=1 for all five packages
- go test -race for the terminal, connector/dispatch cleanup, scope error-normalization, and remote cancellation regressions
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed the durable terminal-state delivery and cancellation/error normalization paths. The shared-sender, buffered-data, and mixed cancellation/error cases are covered; the patch preserves meaningful execution errors and query-deadline classification.
Merge Queue Status
This pull request spent 23 minutes 52 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26990 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.
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
|
Backports #26990 to 4.2-dev. A normal pipeline End is now recorded as durable edge state even when the bounded data channel is full. The receiver drains buffered batches before observing the recorded End, preventing a slow full-table-scan consumer from turning graceful completion into pipeline end signal delivery failed. The backport also preserves substantive execution errors across sibling-pipeline cancellation and keeps query deadline classification intact. Existing 4.2-dev cancellation helpers were retained while resolving the cherry-pick conflict. Validation: - Focused regression tests across process, connector, dispatch, and compile - Full owning-package tests - Focused race stress for concurrent terminal publication, count 100 - Full owning-package race tests - go build and go vet for all affected packages Approved by: @XuPeng-SH
…ors (matrixorigin#26990) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26743 Fixes matrixorigin#26745 ## What this PR does / why we need it: This fixes two execution-mechanism failures, independently of query-plan quality: - Records normal pipeline completion as durable edge state, so a full data channel cannot turn `End` into `pipeline end signal delivery failed`. Receivers drain buffered data before observing the recorded terminal state. - Preserves substantive operator failures across sibling-pipeline cancellation. Cancellation is suppressed or replaced only when every error-tree leaf is attributable to the same canceled context; independent deadlines and joined substantive errors survive scope aggregation and remote cleanup. - Keeps query-owned timeouts classified as `context deadline exceeded`, while allowing the internal-executor cause to be attached by the owning caller. Q4 may still exceed the hash-build memory budget with its current plan; after this change the client receives that actual resource error instead of `context canceled`. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…ors (matrixorigin#26990) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26743 Fixes matrixorigin#26745 ## What this PR does / why we need it: This fixes two execution-mechanism failures, independently of query-plan quality: - Records normal pipeline completion as durable edge state, so a full data channel cannot turn `End` into `pipeline end signal delivery failed`. Receivers drain buffered data before observing the recorded terminal state. - Preserves substantive operator failures across sibling-pipeline cancellation. Cancellation is suppressed or replaced only when every error-tree leaf is attributable to the same canceled context; independent deadlines and joined substantive errors survive scope aggregation and remote cleanup. - Keeps query-owned timeouts classified as `context deadline exceeded`, while allowing the internal-executor cause to be attached by the owning caller. Q4 may still exceed the hash-build memory budget with its current plan; after this change the client receives that actual resource error instead of `context canceled`. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…ors (matrixorigin#26990) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26743 Fixes matrixorigin#26745 ## What this PR does / why we need it: This fixes two execution-mechanism failures, independently of query-plan quality: - Records normal pipeline completion as durable edge state, so a full data channel cannot turn `End` into `pipeline end signal delivery failed`. Receivers drain buffered data before observing the recorded terminal state. - Preserves substantive operator failures across sibling-pipeline cancellation. Cancellation is suppressed or replaced only when every error-tree leaf is attributable to the same canceled context; independent deadlines and joined substantive errors survive scope aggregation and remote cleanup. - Keeps query-owned timeouts classified as `context deadline exceeded`, while allowing the internal-executor cause to be attached by the owning caller. Q4 may still exceed the hash-build memory budget with its current plan; after this change the client receives that actual resource error instead of `context canceled`. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26743
Fixes #26745
What this PR does / why we need it:
This fixes two execution-mechanism failures, independently of query-plan quality:
Endintopipeline end signal delivery failed. Receivers drain buffered data before observing the recorded terminal state.context deadline exceeded, while allowing the internal-executor cause to be attached by the owning caller.Q4 may still exceed the hash-build memory budget with its current plan; after this change the client receives that actual resource error instead of
context canceled.