Repository navigation
Description
Parent Issue
Parent issue: #32278
Detail of Subtask
Catalog ID: D06
Origin: A - Introduced by 4.2-to-main evolution or incomplete retirement on main
Evidence level: Regression reproduced with real local-cluster A/B runs
4.2 versus main: provenance
Main's new COM_QUERY -> captureRewritePolicy -> snapshot admission -> GetLatestSnapshot path waits on the transaction-creation limiter. Authorization ReadSnapshot on 4.2 does not consume this limiter. This is a public-path change introduced between 4.2 and main.
Design problem, impact, and existing responsibility
Authorization/rule freshness reads inside an existing data transaction consume transaction-creation rate admission. Internal background transactions sharing that limiter can amplify queuing. The default rate limit is zero, so this is not a slowdown claim for every SQL statement. Admission also transfers prepaid eligibility to a later new transaction; simply deleting Wait could bypass transaction rate limiting.
Acceptance criteria
- After BEGIN and an actual table read on one connection, 30 SELECT 1 statements no longer queue as new transactions; compare 10/s and unlimited configurations.
- Preserve autocommit, new/explicit transactions, permission changes, cancellation, pause/close, and single-use/reuse semantics without bypass or double charging.
- Reuse valid A/B and CI evidence and check ordinary short-query cost. Do not add per-statement probe SQL or a periodic repair path.
Describe implementation you've considered
Separate read-only snapshot acquisition from actual transaction-creation quota within the existing txn client/statement-admission owner. Preserve cross-CN permission/rule freshness, charge each real new transaction exactly once, and remove superseded eligibility state and branches.
Additional information
Existing investigation and validation limits
At main 57e7871, a real local single-CN cluster with txn.limit-per-second=10 takes about 17.10s for 30 SELECT 1 statements after a transactional table read; 4.2 takes about 2.81ms. Unlimited controls take about 4.73ms/3.56ms. Repeated controls and the business connection's stack confirm limiter waiting. KILL waits during pause on both branches and is not counted as a new regression.
main investigation snapshot: pkg/frontend/mysql_cmd_executor.go:7307; pkg/txn/client/client.go:958
4.2 baseline snapshot: pkg/txn/client/client.go:1014
The named probes are local diagnostic overlays, not committed repository tests. Their names identify the investigation; they cannot be selected directly from an ordinary checkout. Implement the smallest maintained contract regressions and reuse relevant CI/validation proportionally. Temporary evidence commits are not required.
Activity
[-][Subtask]: D06 [4.2→main] 分清授权只读快照与事务创建配额,修复显式事务内逐语句限速[/-][+][Subtask]: D06 [4.2-to-main] Separate authorization snapshot reads from transaction-creation rate admission[/+]