Repository navigation
Description
Summary
TPCC benchmark shows a 25% performance regression in tpmC for 10-warehouse workload after commit 522224799.
Bisect Result
Binary search successfully identified the first bad commit:
| Field | Value |
|---|---|
| First bad commit | 522224799 |
| Last good commit | 3a8d66954 |
| Test | TPCC: warehouse=10, terminals=10 |
| Baseline tpmC | 6097.17 |
| Bad commit tpmC | 4568.1 |
| Regression | -25.08% |
| Threshold | 25% |
Regression Details
Iteration History
| Iteration | Commit | Verdict | tpmC | Delta vs Baseline |
|---|---|---|---|---|
| suspect | efe2379 | bad | 4261.7 | -30.10% |
| 1 | 25abedd | bad | 4405.96 | -27.74% |
| 2 | 0fcd615 | good | 6041.19 | -0.92% |
| 3 | 3a8d669 | good | 6047.22 | -0.82% |
| 4 | 5222247 | bad | 4483.84 | -26.46% |
| 5 | 5222247 | bad | 4568.1 | -25.08% (confirmed) |
Bad Commit Analysis
Commit: 522224799
PR: #25562
Author: Cao Kai
Date: 2026-07-10 10:06:39 UTC
Message: fix(frontend): force recompile on each prepared execute to prevent hang
Original Fix: Fixed prepared UPDATE...JOIN hanging on second execution through binary protocol (COM_STMT_EXECUTE). The fix forces recompilation of the scope tree on every prepared statement execution to avoid stale state in hashbuild operators.
Side Effect: The forced recompilation on every execution introduces significant overhead, causing a 25% performance drop in TPCC workloads which heavily use prepared statements.
Root Cause
The commit changed initExecuteStmtParam to always release and recreate the compiled scope tree (prepareStmt.compile) on every execution, even when no schema change is detected. This was necessary to fix the hang caused by stale operator state, but the recompilation overhead is too high for TPCC's high-frequency prepared statement execution pattern.
Impact
- TPCC 10-warehouse: 6097.17 → 4568.1 tpmC (-25.08%)
- Affected workload: Any workload using prepared statements with high frequency
- Severity: High (S1) - significant performance regression in core benchmark
Expected Behavior
TPCC performance should remain within 5% of baseline after the prepared statement hang fix.
Suggested Fix
Optimize the scope tree recompilation to reduce overhead:
-
Lightweight recompilation: Instead of full
FreeOperator+Release+ recreate, implement a lighter reset that only clears stale state (e.g., hashbuild ctr, dispatch channels) without full recompilation -
Selective recompilation: Only recompile when necessary (e.g., detect actual stale state rather than always recompiling)
-
Cache optimization: Keep the compiled scope tree but add a fast path to reset only the problematic operators (hashbuild, dispatch)
-
Alternative approach: Fix the root cause of stale state in hashbuild operators instead of forcing recompilation
Environment
- Branch: main
- Cluster: TKE, 3 CNs + 1 DN
- CN memory limit: 55 GiB
- Test duration: 5 minutes
Related
- Original fix PR: #25562
- Bisect workflow: run 29136123182
- Bisect summary: job 86516186410
Activity
fix(frontend/compile): reset PipelineEdge terminal state on compiled …
fix(frontend/compile): reset PipelineEdge terminal state on compiled …
fix(frontend/compile): reset PipelineEdge terminal state on compiled …
Ariznawlll commentedon Jul 12, 2026
恢复了
fix(frontend/compile): reset PipelineEdge terminal state on compiled …
fix(frontend/compile): reset PipelineEdge terminal state on compiled …
fix(frontend/compile): reset PipelineEdge terminal state on compiled …