Repository navigation
Conversation
Signed-off-by: XuPeng-SH <[email protected]>
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 of commit e2bddfb.
No blocking issues found. The attempt-level ownership model correctly closes every materialized source generation opened by the attempt, including statically planned but unstarted lazy readers, initialization/ execution errors, panic unwinding, cancellation, and prepared-plan retry reuse. Scope completion barriers are in place before Close, and Source.Close is idempotent for already-released generations.
Validation: local materialized UT, compile UT, focused race repetitions, full pkg/sql/compile UT; GitHub UT, SCA, coverage, Compose BVT, and multi-CN BVT all passed.
Non-blocking note: the diagnostic does not include statement/trace or materialized-step ID; this can be improved separately.
) ## 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#28266 ## What this PR does / why we need it: A prepared information_schema.COLUMNS lookup with LIMIT can stop lazy UNION ALL before all statically planned readers of the shared mo_current_roles CTE start. Operator Reset therefore cannot release those unstarted readers, and the next prepared execution rejects the still-active materialized source generation. This change makes one pipeline execution attempt the final owner of every materialized generation it successfully opens. Operator cleanup remains the eager path; an attempt-level deferred cleanup closes skipped readers on success, initialization or execution errors, and panics. Partial initialization returns only sources opened by that attempt, so an active source owned elsewhere is never closed accidentally. The reuse error now reports the generation and unreleased owner IDs. Normal already-released generations use a fast no-op Close, and planner materialization plus lazy UNION behavior remain unchanged. ## Validation - make build - full normal tests for ./pkg/sql/internal/materialized and ./pkg/sql/compile - full race tests for both owning packages - go vet for both owning packages - repeated focused race tests for success, execution-error, panic, cancellation, and prepared-reuse lifecycle cases - fresh quickstart black-box execution of the exact parameterized information_schema.COLUMNS LIMIT query across hit, miss, repeated execution, and schema recreation - EXPLAIN confirms mo_current_roles materialization, UNION ALL, LIMIT, and Sink Scan reuse remain enabled - distributed metadata regression executes the prepared query twice on one connection Signed-off-by: XuPeng-SH <[email protected]>
) ## 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#28266 ## What this PR does / why we need it: A prepared information_schema.COLUMNS lookup with LIMIT can stop lazy UNION ALL before all statically planned readers of the shared mo_current_roles CTE start. Operator Reset therefore cannot release those unstarted readers, and the next prepared execution rejects the still-active materialized source generation. This change makes one pipeline execution attempt the final owner of every materialized generation it successfully opens. Operator cleanup remains the eager path; an attempt-level deferred cleanup closes skipped readers on success, initialization or execution errors, and panics. Partial initialization returns only sources opened by that attempt, so an active source owned elsewhere is never closed accidentally. The reuse error now reports the generation and unreleased owner IDs. Normal already-released generations use a fast no-op Close, and planner materialization plus lazy UNION behavior remain unchanged. ## Validation - make build - full normal tests for ./pkg/sql/internal/materialized and ./pkg/sql/compile - full race tests for both owning packages - go vet for both owning packages - repeated focused race tests for success, execution-error, panic, cancellation, and prepared-reuse lifecycle cases - fresh quickstart black-box execution of the exact parameterized information_schema.COLUMNS LIMIT query across hit, miss, repeated execution, and schema recreation - EXPLAIN confirms mo_current_roles materialization, UNION ALL, LIMIT, and Sink Scan reuse remain enabled - distributed metadata regression executes the prepared query twice on one connection Signed-off-by: XuPeng-SH <[email protected]>
) ## 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#28266 ## What this PR does / why we need it: A prepared information_schema.COLUMNS lookup with LIMIT can stop lazy UNION ALL before all statically planned readers of the shared mo_current_roles CTE start. Operator Reset therefore cannot release those unstarted readers, and the next prepared execution rejects the still-active materialized source generation. This change makes one pipeline execution attempt the final owner of every materialized generation it successfully opens. Operator cleanup remains the eager path; an attempt-level deferred cleanup closes skipped readers on success, initialization or execution errors, and panics. Partial initialization returns only sources opened by that attempt, so an active source owned elsewhere is never closed accidentally. The reuse error now reports the generation and unreleased owner IDs. Normal already-released generations use a fast no-op Close, and planner materialization plus lazy UNION behavior remain unchanged. ## Validation - make build - full normal tests for ./pkg/sql/internal/materialized and ./pkg/sql/compile - full race tests for both owning packages - go vet for both owning packages - repeated focused race tests for success, execution-error, panic, cancellation, and prepared-reuse lifecycle cases - fresh quickstart black-box execution of the exact parameterized information_schema.COLUMNS LIMIT query across hit, miss, repeated execution, and schema recreation - EXPLAIN confirms mo_current_roles materialization, UNION ALL, LIMIT, and Sink Scan reuse remain enabled - distributed metadata regression executes the prepared query twice on one connection Signed-off-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
issue #28266
What this PR does / why we need it:
A prepared information_schema.COLUMNS lookup with LIMIT can stop lazy UNION ALL before all statically planned readers of the shared mo_current_roles CTE start. Operator Reset therefore cannot release those unstarted readers, and the next prepared execution rejects the still-active materialized source generation.
This change makes one pipeline execution attempt the final owner of every materialized generation it successfully opens. Operator cleanup remains the eager path; an attempt-level deferred cleanup closes skipped readers on success, initialization or execution errors, and panics. Partial initialization returns only sources opened by that attempt, so an active source owned elsewhere is never closed accidentally.
The reuse error now reports the generation and unreleased owner IDs. Normal already-released generations use a fast no-op Close, and planner materialization plus lazy UNION behavior remain unchanged.
Validation