Repository navigation
test: reduce CDC discovery waits and partition fixture footprint - #29836
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? |
Final overall review — actual gpt-6.1-sol / xhighPASS for local PR publication; no unresolved material blockers. Reviewed
This is an explicit resource tradeoff. Linux final-head capacity and whole CI duration are pending; #29562's ten-minute/lower-RAM acceptance is not established. No production or workflow changes are included. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head aaa02d071bcc81a71b06166824d757b0facaec24 against main@64b715a8234e272794185e2acc98ad58a8346c65.
This is a focused test-runtime change. The CDC fixtures still register through taskservice/catalog and call the production detector scan, matching and callback; the barrier-based cases join the callback before restoring hooks or cleanup. The two-CN source-generation contract remains multi-CN. The partition helper is only used by SQL/catalog partition tests, and the shard/distributed contracts remain in their separate package, so reducing its shared cluster from three CNs to one does not remove the coverage owned here. The one-second task fetch interval is test-only and leaves heartbeat/capacity settings intact.
Exact-head CI Required, Ubuntu UT, SCA, coverage, and pessimistic/PROXY multi-CN BVT are green. I found no confirmed correctness, lifecycle, or product-performance blocker in this delta. This review is COMMENT only because the PR is self-authored.
Deep review of
|
P2 cancellation finding resolved; final review PASSFix in The fix removes all newly introduced manual scan/readiness helpers and synchronous/deferred joins. A callback waiting on the real paused CN can no longer block the test control flow from reaching its owner’s cleanup. Four private suites use the existing periodic scan at 1s, preserving default 15s scanning, 5s retry and injection precedence elsewhere. First reset cannot be overwritten by lazy singleton initialization; captured private detectors are closed on exit. All original data, errors, generation/identity/epoch, two-CN source-lock, EndTs/late-table and rollback/replay oracles remain. No new shutdown machinery or CI/workflow edits. Validation:
Matched native timed full embed race: 442.54→316.61s (-28.46%), CPU 249.15→206.85s (-16.98%), peak RSS 3,332,685,824→3,979,542,528 bytes (+19.41% / 617 MiB). The four CDC roots account for 123.52s of the 125.93s package saving. The RSS increase is an explicitly accepted publication tradeoff, not a lower-memory result. Footprint is a different metric; no cause of the RSS increase or final Linux headroom is established. Actual New-head CI has not been validated. The earlier exact-head Linux PASS is historical evidence for this update. There is no matched Linux whole-job baseline or proof of the 600-second/lower-RAM goal; #29562 remains a Related reference, not a goal-completion claim. |
Deep review —
|
| 指标 | 上一 head aaa02d | 当前 head 2ae7dce |
|---|---|---|
| UT 步骤 real(包含该步骤的构建/调度) | 70m59.976s | 67m6.708s |
| pkg/embed | 539.26s | 559.52s |
| 四个被优化 CDC roots 合计 | 183.09s | 181.25s |
这两个 CI 样本都已包含本 PR 的优化,不是优化前后基线;且 embed 本次更慢,不能从全量步骤下降推导出稳定、因果上的 Linux 提速。PR 正文的“新 head CI pending/unvalidated”现已过时;本评论提供最新状态。
建议:本 PR 可作为有明确边界的局部优化推进;不要据此宣称全量 racing 已达 600 秒或整体内存已下降。
## What type of PR is this? - [x] Improvement - [x] Test and CI ## Which issue(s) this PR fixes: Related to #29562; follow-up to merged #29836. This does not close the overall UT racing runtime goal. ## What this PR does / why we need it: The parallel INTERSECT fixture currently performs a TN flush after each of its 32 single-row INSERTs. Those RPCs are unnecessary for the contract: each table needs exactly 16 physical objects/blocks, followed by real two-CN parallel scans. Use the existing CN workspace force-flush point only around construction. Each autocommit INSERT writes one object. Keep all physical-layout, remote-plan/mcpu, duplicate/NULL multiplicity, operand-reversal and empty-result assertions. Acquire the point without overwriting another owner, remove it before inspecting/querying the fixture, and preserve the previously enabled fault registry and unrelated points. One test file changes. No production, CI/workflow configuration, fixture topology, readiness deadlines, or test coverage changes. ### Validation Darwin/arm64, Go 1.27.1, GOMAXPROCS=8, repository CGo test wrapper, short, tags=matrixone_test, count=1: - Whole `pkg/tests/dml` normal (`-vet=all`) and race: all original 44 root tests and leaf names pass, no skips. - Incremental golangci-lint: 0 issues; repository molint, gofmt and diff checks pass. - Actual fixture restoration challenged with an initially disabled/enabled registry, unrelated points, conflicting ownership, cancellation and FailNow. Restoration was checked before outer cleanup. Temporary evidence probes/hooks are excluded from this PR. - Actual gpt-6.1-sol/xhigh design and final overall review: PASS (exact delivered scope; same session 01a1288f-57a2-7d70-9b24-61c3122b076d).. ### Local race measurements Matched whole-package binary measurements with `/usr/bin/time -l`, identical base/native inputs/flags and no contending tests/static scans: | Metric | Before | After | |---|---:|---:| | Whole DML wall | 120.62 s | 104.62 s (−13.27%) | | INTERSECT root | 18.45 s | 1.10 s (−94.04%) | | Whole DML CPU | 110.58 s | 110.00 s | | Peak RSS | 2,298,560,512 B | 1,827,487,744 B | | Peak footprint | 2,691,207,224 B | 2,624,540,536 B | An additional temporal-concurrency candidate was measured and discarded: its small variable incremental benefit did not justify the added executor/session machinery. The delivered change is byte-identical to the measured INTERSECT-only variant. These are local observations; Linux CI runtime and memory improvements remain to be measured. No claim that the whole CI racing target is complete. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Related #29562; follow-up to #29807. This improves a measured part of UT racing. The full ten-minute CI and lower-memory goal is not established.
What this PR does / why we need it:
Use the existing CDC execution path
Four private CDC generation/ACK/EndTs/setup-diagnostic suites spend time waiting for task polling and table discovery. Reuse their existing fixture owner, configure task fetch before CN construction, and select a 1s periodic table scan during test reset. Default production and other test resets retain 15s scanning, 5s retry, and the existing fault-injection precedence. Close the captured private detector on scenario exit. First-use reset also consumes the existing singleton initialization so the next Get cannot replace the configured detector.
Remove the previously introduced manual scan/readiness helpers and synchronous/deferred joins. Those waits could block cleanup while a callback waited on the real paused CN, because its context belongs to the task/CN rather than the test helper. Tests now observe the existing periodic callback through their original bounded SQL/data/error waits; task/CN teardown remains the cancellation owner. No added shutdown coordinator, active-routine access, registry or state machine.
Preserve passive-before-active fixture reuse, real two-CN source locks, EndTs crossing and late-table rejection, generation replacement, target identity/epoch checks, rollback/replay, and transient/permanent diagnostics. All original scenario oracles remain. No CI/workflow, canonical public takeover cadence, GC or production lifecycle changes. One immutable private scan-period field is read when constructing the existing ticker; the optional reset override is test-only.
Reduce partition fixture footprint
All current partition SQL/metadata/index/affected-row scenarios use CN0. Reuse the same shared fixture with one CN rather than three, preserving LOG/TN, deadlines, all assertions and both full 100K-row S3 scenarios. Dedicated shard topology is unchanged. Historical 3/1/1/3-CN controls showed lower one-CN RSS but mixed timings, so no stable partition wall gain is claimed.
Final validation
Base
64b715a8234e272794185e2acc98ad58a8346c65; final content fingerprintb02dec280d06d4c6240f9b06e8ed9c402a51df9647161481eb678cb1315ea871. Four changed files: a narrow detector test seam, provider UT, private embed tests and partition fixture.-short -tags=matrixone_test -count=1 -vet=all: PASS, 259.204s; 113 PASS and two unchanged skips. Complete embed short race: PASS, 316.616s; same roots/skips.Matched native measurement
Darwin/arm64, Go1.27.1, GOMAXPROCS=8, matching independently built CGo. Complete
pkg/embed -short -race -count=1; test-binary/usr/bin/time -lexcludes compilation. No contending tests/static checks. Same 115 roots, 113 passing and the same two existing skips.Whole-package wall improves 125.93s / 28.46%; CPU improves 16.98%. Four affected CDC roots total 221.00 → 97.48s, accounting for 123.52s of the improvement. Peak RSS rises 19.41% / 617 MiB; the suggested 5% target was missed. Peak footprint falls 8.18%, a separate metric that does not cancel the RSS increase. This is an explicit accepted resource tradeoff; its cause and final Linux headroom are not established.
These native samples do not establish equivalent Linux CI savings or whole-job memory improvement. The previous manual-scan implementation measured 348.87s / CPU225.72s / RSS3627581440 on this base and is superseded by the cancellation-safe periodic path. Earlier-base manual trials also showed RSS 17–18% above their controls; a bounded teardown GC trial worsened RSS and was withdrawn. Those results remain historical evidence rather than being silently replaced.
Limits and review
The previous head
aaa02dpassed Linux racing, with actual workload 70m59.976s, embed 539.26s, max embedded anonymous memory 6.04GB and no OOM. Its ARM SCA and preflight also passed. That is previous-head validation, not proof of this update. No matched Linux baseline establishes a causal whole-job reduction. New-head CI is pending; no live CI action or workflow change was made.Changing canonical fixture cadence globally failed a real takeover test and was withdrawn. The delivered interval override stays within the four private suites. The verified P2 cancellation finding is addressed by deleting the blocking path and validated with actual paused-CN cancellation and child FailNow/next-fixture probes; probes were removed before final package validation to avoid daily fixture cost.
Required actual
gpt-6.1-sol/xhighdesign and final overall review: PASS, no unresolved material blocker for PR publication, including cancellation, original oracles, existing ownership, test quality and the explicit resource tradeoff. Session01a126c6-4ae9-77b1-955a-47697a1f06fc; exact final content fingerprint above reviewed. Final commit2ae7dce80b01796c65717a99e2325e37220a4a79has the same validated content. Final-head Linux CI remains unvalidated; the broader 600-second/lower-memory goal remains unproved.