Repository navigation
fix(compile): normalize materialized CTE spill rejection - #27109
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 review: no blocking findings. The materialized spill adapter now normalizes initial spill-disk/FD admissions and cumulative disk Grow rejection at the terminal no-recovery boundary, while TerminalBudgetError preserves lifecycle/accounting failures. The wrapper delegates Release to the original reservation, and rejected growth leaves the charged size unchanged, so cleanup remains balanced. Verified at f1132e7: the focused regression and full compile/materialized/hashbuild package tests pass; the same Grow oracle fails on the PR base with the raw admission error.
…n#27109) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27106 ## What this PR does / why we need it: Materialized CTE spill uses the shared HashBuild disk/FD budget, but its compile-layer adapter previously returned raw admission errors. A cumulative spill-file growth rejection could therefore be published to dependent readers as `20101 internal error`, while a HashJoin consumer could independently normalize the same failure to `3015 resource exhausted`. Which concurrent scope reached the coordinator first determined the client-visible error. This change normalizes terminal budget admission errors at the materialized spill adapter before the source can publish them. It covers both initial disk/FD reservations and later disk-reservation growth, while preserving lifecycle/accounting failures unchanged through `hashbuild.TerminalBudgetError`. The regression now proves both initial and cumulative disk rejection return resource exhaustion with actionable requested/used/limit details and do not retain the raw admission sentinel. Validation: - `GOWORK=off go list -mod=readonly ./pkg/sql/compile` - `GOWORK=off go build -mod=readonly ./pkg/sql/compile` - `GOWORK=off go vet -mod=readonly ./pkg/sql/compile` - `.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=240s -run '^TestMaterializedSpillBudgetUsesProcessLimits$' ./pkg/sql/compile` - `.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=300s ./pkg/sql/compile` - `git diff --check` No SQL syntax, public API, wire format, or persisted format changes. --------- Co-authored-by: XuPeng-SH <[email protected]>
…n#27109) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27106 ## What this PR does / why we need it: Materialized CTE spill uses the shared HashBuild disk/FD budget, but its compile-layer adapter previously returned raw admission errors. A cumulative spill-file growth rejection could therefore be published to dependent readers as `20101 internal error`, while a HashJoin consumer could independently normalize the same failure to `3015 resource exhausted`. Which concurrent scope reached the coordinator first determined the client-visible error. This change normalizes terminal budget admission errors at the materialized spill adapter before the source can publish them. It covers both initial disk/FD reservations and later disk-reservation growth, while preserving lifecycle/accounting failures unchanged through `hashbuild.TerminalBudgetError`. The regression now proves both initial and cumulative disk rejection return resource exhaustion with actionable requested/used/limit details and do not retain the raw admission sentinel. Validation: - `GOWORK=off go list -mod=readonly ./pkg/sql/compile` - `GOWORK=off go build -mod=readonly ./pkg/sql/compile` - `GOWORK=off go vet -mod=readonly ./pkg/sql/compile` - `.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=240s -run '^TestMaterializedSpillBudgetUsesProcessLimits$' ./pkg/sql/compile` - `.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=300s ./pkg/sql/compile` - `git diff --check` No SQL syntax, public API, wire format, or persisted format changes. --------- Co-authored-by: XuPeng-SH <[email protected]>
…n#27109) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27106 ## What this PR does / why we need it: Materialized CTE spill uses the shared HashBuild disk/FD budget, but its compile-layer adapter previously returned raw admission errors. A cumulative spill-file growth rejection could therefore be published to dependent readers as `20101 internal error`, while a HashJoin consumer could independently normalize the same failure to `3015 resource exhausted`. Which concurrent scope reached the coordinator first determined the client-visible error. This change normalizes terminal budget admission errors at the materialized spill adapter before the source can publish them. It covers both initial disk/FD reservations and later disk-reservation growth, while preserving lifecycle/accounting failures unchanged through `hashbuild.TerminalBudgetError`. The regression now proves both initial and cumulative disk rejection return resource exhaustion with actionable requested/used/limit details and do not retain the raw admission sentinel. Validation: - `GOWORK=off go list -mod=readonly ./pkg/sql/compile` - `GOWORK=off go build -mod=readonly ./pkg/sql/compile` - `GOWORK=off go vet -mod=readonly ./pkg/sql/compile` - `.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=240s -run '^TestMaterializedSpillBudgetUsesProcessLimits$' ./pkg/sql/compile` - `.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=300s ./pkg/sql/compile` - `git diff --check` No SQL syntax, public API, wire format, or persisted format changes. --------- Co-authored-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
issue #27106
What this PR does / why we need it:
Materialized CTE spill uses the shared HashBuild disk/FD budget, but its compile-layer adapter previously returned raw admission errors. A cumulative spill-file growth rejection could therefore be published to dependent readers as
20101 internal error, while a HashJoin consumer could independently normalize the same failure to3015 resource exhausted. Which concurrent scope reached the coordinator first determined the client-visible error.This change normalizes terminal budget admission errors at the materialized spill adapter before the source can publish them. It covers both initial disk/FD reservations and later disk-reservation growth, while preserving lifecycle/accounting failures unchanged through
hashbuild.TerminalBudgetError.The regression now proves both initial and cumulative disk rejection return resource exhaustion with actionable requested/used/limit details and do not retain the raw admission sentinel.
Validation:
GOWORK=off go list -mod=readonly ./pkg/sql/compileGOWORK=off go build -mod=readonly ./pkg/sql/compileGOWORK=off go vet -mod=readonly ./pkg/sql/compile.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=240s -run '^TestMaterializedSpillBudgetUsesProcessLimits$' ./pkg/sql/compile.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=300s ./pkg/sql/compilegit diff --checkNo SQL syntax, public API, wire format, or persisted format changes.