Repository navigation
perf: reduce race UT configuration copy and fixture costs - #29561
Merged
XuPeng-SH merged 2 commits intoOct 2, 2026
Merged
Conversation
XuPeng-SH
force-pushed
the
codex/ut-race-cost-20261001
branch
from
October 1, 2026 20:14
8aab180 to
a0f3068
Compare
2 tasks done
XuPeng-SH
marked this pull request as ready for review
October 1, 2026 20:18
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? |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #29562 — race UT CPU, allocation and fixture-cost optimization.
The issue remains open until the actual CI acceptance target is demonstrated.
What this PR does / why we need it:
HAKeeper health checks repeatedly deep-copy thousands of configuration fields through reflection. Race profiles show this consumes substantial CPU and allocations throughout embedded tests. Implement the existing
deepcopyhook forConfigData, preserving detached maps/items/unknown protobuf bytes and nil/empty values. Keep the surrounding StateQuery ownership and execution path unchanged; add real-dispatch isolation tests and a benchmark populated through actual service configs and heartbeats.Move the private two-CN view restore/restart test from the upgrade package into the existing multicn package. It now uses normal exclusive fixture admission instead of keeping its two CNs live alongside the upgrade package's shared CN. Preserve its SQL, identity, prepared-plan, restore and restart assertions, including partial-start cleanup ownership.
Reduce sequence-placement source data from 64 to two rows per UNION branch after a public physical-plan probe showed identical normalized scope structure on both coordinators. Preserve repeated per-row advancement, cross-CN continuity, every value/persisted-state assertion, and all separate concurrency/lock/cancellation tests. Correct the AP control comment to describe planning classification, without claiming a remote scan.
Validation and performance
Acceptance still pending: reduce the actual CI race-UT wall time by at least ten minutes while lowering overall CPU/memory. Local measurements do not prove this target. Keep cache seeding disabled: the bounded local registry import timed out with zero entries published and completed cleanup. This PR adds no cache, scheduler, timeout extension, skipped tests or shortened stress rounds.
Design and independent final implementation review use actual
gpt-6.1-solwithxhighreasoning. Final implementation review: PASS, no blocking findings. Incremental configured vet and golangci-lint v2.6.2 (built with Go 1.26.4): PASS, 0 issues.