Repository navigation
fix(compile): preserve prepared TP expression reuse - #32862
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? |
|
Queue requested — the merge queue status continues in this comment ↓. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 66c30224be48bd5c1324bc435ad588cefe269ae0
Assessment: approve
The prepared-TP policy restores existing executor reuse while preserving accounting for retaining operators. Capturing the policy for runtime clones is justified and introduces no new lifecycle mechanism. No actionable defects remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed the complete three-file delta, affected owners and consumers, linked issues and all three discussion entries.
-
Current-input native builds and source, formatting and provenance audits passed; source remains unchanged.
-
Five focused roots and both owning packages passed normal and race runs. Each focused root also passed 100 race repetitions.
-
Public MySQL prepared tests passed, including changing bindings, NULLs, error recovery and two-round teardown.
-
Reversed-order component benchmarks reduced prepared-TP allocations from 154 to 85 per execution; AP remained at 154.
-
validation-reconciliation.json matches 23 successful execution receipts to frozen source fingerprints, commands and retained logs.
Limitations:
-
Original-scale 129 and full TPCC qualification were not run; general performance recovery is not established.
-
The component comparison uses an all-owner policy control, not an exact predecessor binary.
-
Frozen CI supplied no relevant package validation. Author-reported Darwin performance and lint results were not independently certified.
🚫 Left the queue · pull request dequeued2 h 14 min in the queue, with no time running CI. So far
Reason Pull request #32862 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.
To get back in the queue
Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
What type of PR is this?
Which issue(s) this PR fixes:
issue #32840
Related follow-up: issue #32857. Disk-budget sampling remains tracked by issue #32818.
Please keep #32840 open until the original 129 workload has qualified the candidate. This PR does not claim that all #32492 overhead, ordinary text-protocol TP overhead, or the original-scale regression is already resolved.
What this PR does / why we need it:
#32492 enrolled TableScan, Filter and Projection in statement allocation-account ownership. For a cached prepared TP Compile, closing the account requires those operators to Free their expression executors and buffers during Reset. The next execution reconstructs them, losing the existing ResetForNextQuery reuse contract. Installing TableScan.OutputAllocation also enables additional accounted/reader-filter paths.
This patch restores the pre-#32492 ownership scope for these three operators only in prepared TP execution:
reusesTPFlatExecutors()gate; preserve the TP check defensively even though prepared AP is currently rejected.Relative to pre-#32492, this restores legacy flat-operator ownership. Relative to current main, it deliberately narrows the newly added statement-account coverage for prepared TP. It is not a rollback of all reader/blockio/kernel/dictionary changes, nor a claim that every allocation remains statement-accounted.
Tests added
Tested with
Validation was performed on base
e1160015bb5895c1677d5fc1496c4bee440592b3plus this exact patch. Upstream main at publication check is28ffd6ae678744b6ff68bc239daefe9ad9ac1325; its three later commits do not touch the three changed files. CI must validate the merge with current main.Passed:
Real MySQL prepared-protocol smoke also passed changing bindings/NULL/reversed ranges, invalid JSON followed by a valid rebind, and concurrent UPDATE result checks. Existing full compile race evidence remains relevant; this final review centralized an equivalent predicate and added deterministic tests.
Local performance evidence
Separate unprofiled and profile-instrumented, order-reversed suites used identical tools and byte-verified seed copies within each suite. Every scalar query result was checked and all queries succeeded.
Unprofiled mean QPS, two runs per version/case:
Prepared range COUNT improves 22.2% over the child and reaches 98.1% of parent locally. The separate profiled suite reaches approximately 99% of parent and shows no TableScan.Free samples on the prepared candidate path. These are bounded local measurements, not original-scale acceptance.
The text-range residual is deliberately left for #32857. The small unprofiled point-read delta is inconclusive; its known Statfs cost is not a separate new issue.
Scope and merge qualification