Repository navigation
fix: invalidate prepared special-index plans after index rebuild - #25669
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.
LGTM after reviewing this from the prepared-plan dependency, plugin-hidden-table, and unhappy-path angles.
- correctness: the prepare-plan schema collection now records the hidden tables behind registered FULLTEXT/vector plugins, so DROP/CREATE INDEX and REINDEX can invalidate the prepared plan through the existing EXECUTE-time schema-version path
- plugin wiring: the extra dependencies are resolved through
ResolveIndexTableByReffrom the owning base-table scan, which keeps the collected object/table/version metadata aligned with the same catalog path the runtime uses - unhappy path coverage: the new regression covers hidden-table schema collection directly, and the plan/frontend package tests exercise the existing rebuild path rather than introducing a new invalidation mechanism
I did not find a remaining correctness, leak, or hang issue in the latest diff, so approving.
Merge Queue Status
This pull request spent 2 minutes 38 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #25669 has been merged manually at 58a1522 HintYou were too fast! Tick the box to put this pull request back in the merge queue (same as
|
…rixorigin#25669) ## 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#25625 ## What this PR does / why we need it: Prepared statements previously tracked base-table schemas but omitted the hidden tables used by registered FULLTEXT and vector-index plugins. After DROP/CREATE INDEX, execution could therefore reuse a plan bound to deleted or replaced hidden tables. This PR: - collects every registered index-plugin hidden table referenced by a TABLE_SCAN while ResetPreparePlan builds Prepare.Schemas; - resolves and records each hidden table database ID, table ID, name, and catalog version; - reuses the existing EXECUTE-time catalog invalidation and plan rebuild path; - adds a regression test for hidden-table schema collection. Local FULLTEXT verification after DROP/CREATE INDEX: the pre-DDL prepared statement, rebuilt prepared execution, and fresh SQL all return the same row. Validation: - go build ./pkg/sql/plan - go vet ./pkg/sql/plan - go test -count=1 -timeout 120s ./pkg/sql/plan - go test -count=1 -timeout 120s -run TestInitExecuteStmtParam ./pkg/frontend Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…rixorigin#25669) ## 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#25625 ## What this PR does / why we need it: Prepared statements previously tracked base-table schemas but omitted the hidden tables used by registered FULLTEXT and vector-index plugins. After DROP/CREATE INDEX, execution could therefore reuse a plan bound to deleted or replaced hidden tables. This PR: - collects every registered index-plugin hidden table referenced by a TABLE_SCAN while ResetPreparePlan builds Prepare.Schemas; - resolves and records each hidden table database ID, table ID, name, and catalog version; - reuses the existing EXECUTE-time catalog invalidation and plan rebuild path; - adds a regression test for hidden-table schema collection. Local FULLTEXT verification after DROP/CREATE INDEX: the pre-DDL prepared statement, rebuilt prepared execution, and fresh SQL all return the same row. Validation: - go build ./pkg/sql/plan - go vet ./pkg/sql/plan - go test -count=1 -timeout 120s ./pkg/sql/plan - go test -count=1 -timeout 120s -run TestInitExecuteStmtParam ./pkg/frontend Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…rixorigin#25669) ## 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#25625 ## What this PR does / why we need it: Prepared statements previously tracked base-table schemas but omitted the hidden tables used by registered FULLTEXT and vector-index plugins. After DROP/CREATE INDEX, execution could therefore reuse a plan bound to deleted or replaced hidden tables. This PR: - collects every registered index-plugin hidden table referenced by a TABLE_SCAN while ResetPreparePlan builds Prepare.Schemas; - resolves and records each hidden table database ID, table ID, name, and catalog version; - reuses the existing EXECUTE-time catalog invalidation and plan rebuild path; - adds a regression test for hidden-table schema collection. Local FULLTEXT verification after DROP/CREATE INDEX: the pre-DDL prepared statement, rebuilt prepared execution, and fresh SQL all return the same row. Validation: - go build ./pkg/sql/plan - go vet ./pkg/sql/plan - go test -count=1 -timeout 120s ./pkg/sql/plan - go test -count=1 -timeout 120s -run TestInitExecuteStmtParam ./pkg/frontend 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 #25625
What this PR does / why we need it:
Prepared statements previously tracked base-table schemas but omitted the hidden tables used by registered FULLTEXT and vector-index plugins. After DROP/CREATE INDEX, execution could therefore reuse a plan bound to deleted or replaced hidden tables.
This PR:
Local FULLTEXT verification after DROP/CREATE INDEX: the pre-DDL prepared statement, rebuilt prepared execution, and fresh SQL all return the same row.
Validation: