Repository navigation
test: avoid stale account ids in statement info BVT - #29817
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.
APPROVE at d733bea, base/merge-base 62827a1. Reviewed both changed hunks, the complete SQL/result case, issue #29071, the account-name rewrite owner and the runtime scalar-subquery path. No blocking finding. There are no substantive prior review comments or unresolved review threads on this PR.
The design is appropriately small for a BVT repair. QueryBuilder.convertAccountToAccountIdIfNeeded / ConvertAccountToAccountIdWithTableCheck resolves the old account-name equality during planning and substitutes a literal ID. The new expression reads the authoritative mo_catalog.mo_account row during execution; account_name is unique, and EXPLAIN confirms a runtime catalog/index scan feeding the scalar join. It adds no duplicate state, cache, validation mechanism or retry loop. The four statement types, stats version 6, complete attempt-count coverage, min/max attempt=1 and quality-bit check remain identical, as do the bounded 1s/60s readiness wait and account cleanup. SQL and .result contain the same exact assertion.
Independent exact-head validation on a clean, reviewer-owned macOS arm64 two-CN + PROXY topology, built through the repository Make/native provenance path:
- The exact committed statement_query_type_3.sql ran in mo-tester normal comparison mode (-n -g -o, focused -i, distributed resources, optimistic exclusion), twice against the same instance: 64/64 passed both times, zero ignored/failed/abnormal. Case times were 9.023s and 2.917s; both process exit codes were 0. SQL and ISCP readiness preceded execution; proxy logs show connections routed to both CNs.
- Between runs, and after the second, mo_catalog.mo_account contained zero rows for bvt_query_type/test_account, checked before the next entry-time cleanup could mask residue.
- Adjacent negative controls: the exact assertion returned 0 with the account absent, then returned 0 for a newly recreated, empty same-name account while prior generations' DDL history remained (IDs 10001 and 10002; new ID 1). Historical rows therefore did not produce a false success. The final account was dropped and teardown rechecked.
- Exact-head CI run 38026351189 is green. Downloaded artifacts show this file actually ran in the pessimistic group, 64/64 in 6.019s. The green PROXY job did NOT select it; the local topology run above fills that gap. git diff --check and exact SQL/result mirror checks passed. Service logs and mo-tester reports were inspected; owned processes were stopped.
Incremental cost: production 0 lines, documentation 0, test input/result +2/-2 across two files. The assertion adds a runtime catalog lookup/scalar join to a bounded BVT query; no production TP/prepared-statement execution code changes. No throughput benchmark is warranted for this test-only patch, and these functional runs are not a claim that every possible collector/propagation flake is eliminated. The underlying general account-name planner behavior is outside this repair's scope.
Merge Queue Status
This pull request spent 13 minutes 57 seconds in the queue, with no time running CI. ReasonPull request #29817 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
#29071
What this PR does / why we need it:
The statement query type BVT reused a fixed account-name predicate against
system.statement_info. The planner can bind that name to a compile-time account ID, which becomes stale after rapid account DROP/CREATE propagation in multi-CN PROXY runs. The assertion now resolves the current account ID at execution time throughmo_catalog.mo_account, while retaining the bounded exporter readiness wait and expected DDL accounting oracle. The mirrored.resultquery text is updated with the same predicate.Validation
git diff --checkGOWORK=off go test -mod=readonly ./pkg/sql/parsers/dialect/mysql -run '^TestQuantifiedTableSubqueryParse$' -count=1