Repository navigation
perf(optools): add opt-in bounded race UT waves - #29795
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? |
8f8df6b to
c656a71
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review — no blocking findings
Reviewed all 15 changed files at c656a714d8c4be5bf93f11a593572af25b784b2e against base/merge-base a6e19ccf7761016d95e788f4fc0c546dbea7dac9. This was a direct review without subagents.
Recommendation: merge the opt-in bounded-concurrency capability. Full CI performance acceptance remains unproven. This review is submitted as COMMENT because the authenticated account is also the PR author.
Design and correctness
- The implementation reuses the existing dispatcher, admission manager, and SQL executor. It introduces no duplicate execution or transaction state machine.
- Cross-process admission and explicit same-process cluster borrowing are independent permissions. Enabling the process pool no longer implicitly permits an additional local cluster. The last borrower retains the original slot and lock mode until release.
- Admission remains owned by the cluster lifecycle. Incomplete service cleanup retains ownership; unproven process drainage preserves failure status 125 and diagnostic artifacts. Preparation fallback remains before execution, with no replay after runtime failure.
- Metadata fencing preserves the operation owner's deadline through lock acquisition and Commit; only an unbounded caller receives the existing fallback. Unknown Commit outcomes and catalog errors still propagate. The redundant restore-test retry policy was removed.
- The report oracle now rejects missing fields, unknown packages, duplicate events, incorrect actions, malformed JSON, and incomplete expected coverage.
Both actionable original review comments are resolved in source: the redundant parallel-versus-batch comparison and the duplicate lock-nil guard have been removed.
QA and validation
Qualified existing normal/race, focused repetition, and incremental static-check evidence was reconciled with the final revision. The rebase-sensitive complete embed normal/race runs passed, with 337 named passing events in each. Incremental coverage is 35/39 modified blocks, 89.74%, under the unchanged 75% threshold.
At this exact head, CI run 37987161273 has passing SCA, Ubuntu UT, coverage, COMPOSE/PESSIMISTIC multi-CN BVT, PROXY multi-CN BVT, and CI Required checks. Skipped jobs are not counted as passing evidence.
This review additionally ran a temporary Go-overlay challenge against the real dispatcher: two distinct process groups were confirmed simultaneously alive, both ignored TERM, and then the outer runner was canceled. The race-mode probe passed in 6.21 seconds: both groups were gone, the third command never started, status 143 was preserved, and artifacts were removed after drainage. No database cluster was started for this probe. One non-blocking suggestion to retain that scenario is attached inline.
Increment and performance assessment
| Area | Added | Removed |
|---|---|---|
| Implementation, including test infrastructure | 183 | 22 |
| Tests | 713 | 69 |
| Documentation | 75 | 1 |
The test increment was reviewed independently: it reuses existing fixtures, uses a subprocess where process-global admission requires isolation, and keeps malformed-report cases as cheap table-driven checks. No new real multi-CN framework is introduced.
Serial execution remains the default. There is still no matched successful full-wave serial/pool comparison for elapsed time, CPU, and peak memory, so this review does not establish an overall CI saving or resource reduction. Those measurements remain necessary before enabling the pool by default or claiming the broader performance goal is complete.
| func TestEmbeddedPrebuiltOuterCancellationKillsResistantGroup(t *testing.T) { | ||
| script := embeddedSetup + ` | ||
| for _, parallel := range []string{"1", "2"} { | ||
| for _, drain := range []string{"complete", "failed"} { |
There was a problem hiding this comment.
Non-blocking test improvement: retain a cancellation case with two simultaneously live, TERM-resistant worker groups.
This matrix varies parallelism, but the fixture keeps only package a blocked; b and c can finish immediately. It therefore does not directly assert cleanup of two live execution owners in the pooled mode.
I ran a temporary race-mode probe using the same harness: wait for readiness from two distinct live groups, make both ignore TERM, cancel the outer runner, then check both groups are gone, c never started, status 143 is preserved, and artifacts are cleaned. It passed in 6.21 seconds; no implementation failure was reproduced.
Consider replacing the existing parallel=2/drain=complete case with this scenario, retaining the serial and failed-drain cases. Replacing the case avoids adding another expensive cancellation fixture.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #29562; follow-up to #29760.
What this PR does / why we need it:
Rebased onto main
a6e19ccf7761. Adds optional bounded overlap to the existing race-UT dispatcher. Serial execution remains the default; opting into two processes retains complete package/root coverage and explicit same-process cluster isolation.Design and behavior
WithConcurrentTestClustersfails before services start in both serial and pooled execution. Explicit borrowers retain the original slot/lock until the last lease releases; no extra manager, state machine or cached configuration is added.1|2; two issues processes require four batches. Arithmetic-overflow inputs fail before preparation. Make tests separate configuration stdout from Git diagnostics and use real detached, untagged, shallow Git metadata.Verification
gpt-6.1-solwithxhighreasoning; review artifacts remain outside tracked source.Performance and scope
No new real cluster fixture, service setup, retry, goroutine or persistent state is introduced by the permission/oracle correction. Pure report cases and synthetic startup callbacks cover its boundaries. Serial defaults remain unchanged. Historical subset timings motivate the optional pool but do not establish successful matched full-job wall-time, CPU or peak-memory savings; those measurements are required before default adoption.
Separate #29802 owns the root cancellation follow-up. This PR preserves existing cancellation and failed-drain contracts. Remote CI for the newly published revision must be evaluated separately from local and historical evidence.