Repository navigation
Reduce idle startup allocations in embedded race UT - #29067
Merged
XuPeng-SH merged 4 commits intoSep 17, 2026
Merged
Conversation
XuPeng-SH
requested review from
LeftHandCold,
aptend,
fengttt,
iamlinjunhong and
jiangxinmeng1
as code owners
September 17, 2026 11:23
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? |
XuPeng-SH
commented
Sep 17, 2026
XuPeng-SH
left a comment
Contributor
Author
There was a problem hiding this comment.
Deep review(head 862652d)
结论:未发现本次变更引入的可证实 P0/P1/P2 阻断问题。由于这是作者自有 PR,本次提交 COMMENT,不提交 APPROVE。
已检查全部 9 个 changed files 及实现、测试、benchmark 和设计文档:
- idle WAL 不再创建 payload;首次 append 的精确长度、独占 checkout、提交后归还及关闭后归还路径保持正确。
- embedded testing CN 的零值默认限制在 testing 场景,显式配置、回调覆盖和动态新增 CN 路径未受影响。
- trace 背压测试先解除阻塞并等待 producer,再关闭 service;CSV 顺序和 release-marker 顺序仍有断言。
- FIFO 仅移除 map 预分配 hint,锁、淘汰回调、ghost 和 pending accounting 保持不变。
- 未发现本次变更新增的泄漏、double cleanup、race、死锁或测试选择削弱。
验证:指定 head 的 Linux race UT、UT coverage、BVT、SCA 和 CI Required 已通过。PR 中的 100 次 focused race 与性能数据属于作者报告;本次未独立重跑,且其整包性能基线不是严格的当前 base/head 受控对比,因此不把 RSS/耗时降幅作为独立证明。
资源优化的容量边界也保持明确:testing trace 队列从默认 1,000,000 降为 1024,但高负载下仍可增长,并非新的硬上限。
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 #28419. This addresses unnecessary allocation in the existing single-runner race UT workload; it does not claim to resolve every timeout covered by that issue.
What this PR does / why we need it:
Remove unused startup allocations instead of adding runners or weakening tests. A real single-CN race-test profile retained 532 MiB of Go heap, including roughly 204 MiB of eagerly allocated WAL records, 92 MiB of disabled transaction-trace queues, and 101 MiB from FIFO cache construction.
Changes
WithTestingmode, before scenario callbacks. Explicit overrides, added CNs and non-testing defaults retain their intended behavior. Tracing remains enabled-capable with blocking backpressure, not dropped events.No changes to runner count, scheduling/concurrency, admission, CN topology, package selection, timeouts, race instrumentation or coverage collection. No tests or assertions removed.
Local measurements
macOS/arm64, Go 1.26.4, base
e66c9da813ccbb8b9d1eedbdc40b619b7ee5dff3; prebuilt race executables separate execution from compilation.pkg/tests/issues: wall timepkg/tests/issues: peak RSSThe full issues run executes the identical multiset of 549 test/subtest names. Candidate passes. The clean-base run fails
TestAutoIDCachePublicLifecyclewith peer-CNno such tableatauto_id_cache_test.go:186; other tests continue. This unrelated baseline failure is not claimed fixed by these changes.These are single local observations, not controlled repeated Linux CI trials; some auxiliary checks overlapped the measurements. The observed full-package wall/RSS reductions are about 30%/36%, but no equivalent full-CI speedup is promised. Startup wall time itself is essentially unchanged. Heap excludes native/race-runtime memory and is not RSS. Dense cache warm-up may pay map growth; fully used WAL pools can approach the old memory footprint.
Validation
fifocache,logservicedriver,txn/trace,fileservice,objectio.go vet, incrementalgolangci-lint, andgit diff --check.Design and limitations: UT_STARTUP_ALLOCATION.md. Independent GPT-6 medium design/review performed; complete local evidence retained in the task record. CI is not awaited or represented as passed.