Repository navigation
perf(test): reduce race UT issues runtime and memory pressure - #30216
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? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 1ae2858b382e8249e7b419969c1e45ca74b7f176
Assessment: request_changes
Reviewed the complete six-file delta and affected owners. The design coherently reuses existing scheduling, admission, deadline and cleanup paths. No implementation defect was confirmed, but the resource-validation gate for enabling pooled execution remains open.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
- P2
Makefile:612: Default race UT now runs eight issues batches with two concurrent cluster processes.
Impact: Validation requirement: the documented resource-adoption gate is not independently verifiable. Passing scheduler harness tests does not establish complete real-workload coverage or acceptable CPU and memory costs.
Evidence: The PR reports 179 roots, 1548 terminal results and improved combined resource usage at base a33dcfb, while acknowledging increased standalone issues peak memory. However, evidence.json.local_validation is empty, and no raw workload/resource logs, commands, native-input fingerprints or terminal receipts are supplied. Recover those artifacts and establish compatibility with this head, or repeat the bounded serial-versus-eight-batch comparison, checking inventory equivalence, CPU, memory peaks/occupancy and limit/OOM events. A full CI rerun is not required to close this finding.
Validation:
-
Preflight passed. Full optools tests passed in normal and race modes: 73 root tests and 290 terminal results each, without failures or skips.
-
Focused race repetitions passed: TestIssuesBatchesUseBoundedProcessPool ×100; TestIssuesRootDispatchDrainsHeartbeat ×25.
-
go vet ./optools, shell syntax and git diff --check passed.
-
Commands, logs, exit receipts and clean frozen-head fingerprints were reconciled in /home/xupeng/.local/state/mo-bot/jobs/7ab0c171f8213bdbcfe65408/attempt-1/validation-audit.json. Source remained unchanged.
Limitations:
-
Real MatrixOne workload and resource measurements remain author-reported; local checks exercised the scheduler harness.
-
The supplied CI snapshot contains unfinished substantive checks. Pending CI alone is not the finding.
-
Linked issue #29562's body was absent from the frozen evidence; its contract was assessed through the PR description and design document.
|
mo-bot work · Commit: Review in progress. |
|
Updated in f730068. This addresses the confirmed fixture-isolation and fileservice oracle defects; it also extends the same bounded batching owner to embed/isolated/upgrade without dropping roots or topology. For the evidence-accessibility request in #30216 (review): commands, unmodified terminal-event records, resource counters/PSS samples, source/native fingerprints and terminal receipts are now readable at https://gist.github.com/XuPeng-SH/5d49ae8334646c2c67b538e21e40cccc . Historical and current revisions are explicitly separated. Local-only paths are no longer the only evidence supplied. Current complete matched comparison is still running; its raw terminals/resources and final results will be appended there. No new timing gain or reviewer approval is claimed while that gate is pending. The latest c477 CI run confirms race UT, SCA and both enabled multi-CN BVT jobs passed. The real Coverage failure is the fuzz raw-Data assertion. Coverage merge's log states the required producer failed, and CI Required reports UT Coverage failure; these are dependent red checks, not three independent defects. The cache contract is now tested directly: a deterministic full async queue skips seed write cache-fill, then a cold read succeeds with correct CachedData. Restoring the old assertion makes this fail with raw_len=0, expected_len=3, cached_matches=true. The corrected root keeps all 8 workers x128 operations and releases the vector on errors/assertion failure. The exact queue saturation trigger of the original CI incident is still unproven. Full fileservice normal/race, optools normal/race, targeted CI-scope coverage, isolation repetitions and incremental SCA all pass. New-head CI and the additional full-scope local comparison are pending; PR body lists the scope precisely. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: f73006879c9846c65fbb0dfdd2c5b24b959f9de0
Assessment: request_changes
Reviewed all 18 changed files and their callers. Reusing the existing batching, deadline, admission and cleanup owners is sound; the fixture and cache-oracle corrections preserve their contracts. One required validation gate remains open for the expanded default.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
- P2
optools/run_ut.sh:2543: Default Make execution now splits embed, issues/isolated and upgrade into four batches with two concurrent processes.
Impact: Validation requirement: the expanded default lacks the required complete-wave inventory and resource comparison. Historical savings do not establish the CPU, memory or fixture-generation costs of concurrently batching these additional packages. This is an unmet adoption gate, not an observed production regression.
Evidence: The reconciled historical candidate executed these three packages once each. The frozen PR and published archive README explicitly mark the current ten-package comparison pending. docs/design/pr29760-race-ut-critical-path.md:101 and :143 require that comparison before default adoption. Complete the original-versus-current issues-plus-ten-package comparison, including compilation, with identical cache conditions, eight CPUs, 16 GiB and no swap; retain matching terminal inventories and CPU/PSS/cgroup measurements satisfying the documented limits. Alternatively, keep these three packages on the ordinary path until the gate passes.
Validation:
-
Preflight passed. Current-head optools normal and race runs each passed 75 roots and 318 terminal tests using the supplied test-exec. Receipts 1792021176439009645-3.json and 1792021262263253242-3.json match retained logs, commands, clean-source fingerprints and exit 0.
-
Shell syntax, changed-Go formatting and diff checks passed; 737 published input hashes matched the frozen checkout.
-
Independently reconciled historical terminal maps: 475 roots and 2,636 terminal tests in both arms. Recomputed savings: 454.06 seconds, 13.38% CPU, 15.42% cgroup peak and 16.65% PSS occupancy. These measurements cover the older scheduling policy.
-
Evidence reconciliation and review scope are retained in /home/xupeng/.local/state/mo-bot/jobs/e0c601ad86ce4e57ec58f931/attempt-1/review-record.json and author-evidence-audit.json. Source remains unchanged.
Limitations:
-
No fresh native MatrixOne suite or complete resource comparison was run locally. Published narrower test results do not close the expanded-policy gate.
-
Historical full-Make evidence lacks its complete raw terminal inventory. Current CI was unfinished in the frozen snapshot; pending CI alone is not the finding.
|
Final follow-up c10856f addresses the remaining expanded-default gate from review5526158928 using the stated alternative: embed/isolated/upgrade remain ordinary; dispatcher and selection tests exactly match validated c477. The original issues/DML/SQL optimization and all CI/fixture fixes remain. The matched incremental experiment completed successfully with identical297roots/1091terminals/15existing skips, no failure/duplicate/max/OOM: wall1016.10→826.21s, PSS occupancy−20.70%, CPU+2.32%. Because the CPU objective and the expanded original-versus-current adoption gate were not met, this experiment is not adopted and its savings are not added to historical PR savings. No experimental switch or parallel scheduler was introduced. Final optools normal/race each75roots315terminals PASS; full embed normal123roots408terminals PASS; full fileservice normal/race and targeted CI-instrumented Coverage plus incremental SCA PASS. The one local runner build failure from inherited obsolete CGO linker flags is archived; explicit gcc/cleared flags rerun passed without source changes. The accessible evidence archive now also includes all historical full-Make raw terminal events (gzip/base64 with decode instructions and original report SHA), closing the missing complete terminal inventory limitation: https://gist.github.com/XuPeng-SH/5d49ae8334646c2c67b538e21e40cccc . See final-delivery.json and final-source-inputs.json for final-head scope. New CI and independent reviewer confirmation are pending; no whole-CI ten-minute claim is made. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: c10856f4e943feed62ec40a9102f40e79873227b
Assessment: approve
Reviewed all 18 changed files, affected owners and review concerns. The design reuses existing scheduling, deadline and cleanup implementations while preserving test coverage. The expanded batching policy was withdrawn, and recovered evidence closes the earlier adoption-validation gaps. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-8e48-7622-ad17-b605f08450ce · slot 1 · generation 0
Validation:
-
Audited 80 published artifacts, verified 79 artifact hashes and 737 source hashes against this head. Final dispatcher and Make policy match c477; historical frozen function bodies match after documented native-flag adaptation.
-
Reconciled retained results: final optools normal/race each 75 roots and 315 terminal results; embed normal 123/408; fileservice normal/race each 423/930; focused coverage 3/11. Existing skips remain explicit.
-
Recomputed historical comparison: identical 475 roots and 2,636 terminal results, including 15 skips; wall time decreased 26.44%, CPU 13.38%, cgroup peak 15.42% and PSS occupancy 16.65%, with no memory-limit/OOM events. Current final-policy embedded baseline completed 297 roots and 1,091 terminals.
-
Recovered complete historical Make terminal inventory: 430 passing packages, 80 packages without tests, 74,128 passing test terminals and 73 skips; no duplicate or failed terminals. Reconciled prior c477 CI results for unchanged closures.
-
Local shell syntax, formatting, diff and evidence checks passed. Clean-head, command and exit receipts 1792022233309177932-4.json and 1792022554060482740-4.json match retained logs. Detailed records: /home/xupeng/.local/state/mo-bot/jobs/e8b84a4c243f60eea8b423be/attempt-1/validation-audit.json and review-record.json.
Limitations:
-
No fresh native suite was executed locally; compatible retained author and CI evidence was reused. Historical full Make and performance results are not new-head full-suite measurements.
-
Final-head substantive CI was unfinished in the frozen snapshot. Whole-CI timing and the original cache failure's queue-saturation trigger remain unverified.
-
Linked issue #29562's body was unavailable; its contract was assessed through the frozen PR description and design.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #29562.
What this PR does / why we need it:
Latest delivered update:
c10856f4e943feed62ec40a9102f40e79873227bTestFuzzingDiskS3:ToCacheDatamakesCachedDataauthoritative and permits rawData=nil. Require nonnil CachedData and compare all expected bytes; defer vector release before Read, including error/FailNow. A deterministic full-async-queue seed write and cold read reproduce the old assertion failure in0.03s (raw_len=0, expected_len=3, cached_matches=true); the corrected test keeps8workers x128operations. No production buffer retention/copy. Queue saturation as the trigger of the original CI incident remains unproven.Shorten long race-test process lifetimes at the existing dispatcher, partitioner,
cluster admission, shared deadline and cleanup owners:
go test -race -p1command. The real SQL TestMain executes for discovery and every batch, closes the canonical fixture and propagates cleanup failures.UT_EMBEDDED_BATCHES=1restores the original complete-scope embedded command; direct script defaults remain conservative.Fix test-quality defects exposed during the work: CDCNoPrimaryKeyRejected retained account PITR and could make a later wide-table ALTER fail. Its existing deferred cleanup now removes CDC/PITR before the database, including early assertion failure. DML's table equality oracle now checks streaming errors after iteration. The complete local Make run also exposed inherited scheduler settings in the mock harness and host-timezone-dependent logger/path expectations. The common harness now starts from real runner defaults plus explicit case overrides; existing admission cases inject hostile parent settings. Time oracles use explicit zones, retaining UTC and adding negative/half-hour offsets and a prior-day path boundary. No production SQL/storage behavior, data, topology, assertions or CI coverage/BVT selection is removed.
Measured cumulative result for this PR (before the latest rebase)
Both policies execute issues plus all ten embedded packages, including compilation and teardown. Same kernel/base
1ae2858b382e8249e7b419969c1e45ca74b7f176, source7f6510b86d001baa0249f86c034d810a8855b0c5, Go 1.27.1/Linux amd64, GCC 14.2, identical initial caches, actual eight-CPU quota, 16 GiB aggregate limit and swap disabled. Both policies include the fixture correction and run sequentially.The complete changed wave saves 454.06 seconds (7m34s, 26.44%). CPU falls 13.38%, cgroup peak 15.42%, PSS occupancy 16.65% and anonymous-memory occupancy 14.64%. PSS peak is nearly flat (-0.89% in this pair). Neither arm has memory-limit/OOM events. No universal OOM or flakiness guarantee is claimed.
All 475 roots / 2636 terminal tests match: 2621 pass and the same 15 existing skips, with no new skips, failed roots, duplicate terminals or malformed JSON. Only four runtime PITR timestamp names are normalized. All eleven package selections exit successfully. This is the original-versus-combined PR difference counted once; earlier compilation proxies or older merged optimizations are not added again.
These figures cover the changed critical wave, not the entire CI job. The actual CI ten-minute target remains unverified. The interrupted 8-GiB baseline hit its memory limit and is excluded; the final pair uses CI's actual 16-GiB budget.
Coverage UT visibility correction
The coverage job exposed an unsupported cross-session visibility assumption in
TestIssue29148PreparedOwnerPolicyLifecycle: after ADD RULE committed on CN0,the migrated reader on CN1 could still select a pre-commit logtail snapshot.
The second failed SET ROLE already invalidates its cache; invalidation alone
does not establish visibility of another session's commit.
For the two migrated cases, capture the writer's nonempty committed timestamp
and reuse the existing bounded
testutils.WaitLogtailAppliedbefore that SETROLE. Retain all five cases, migration RPC checks, old/new row results,
NeedReprepare and explicit recreation/cleanup. Same-CN cases retain their
existing RC commit barrier. Production consistency semantics are unchanged.
Validation
TestIssue29148PreparedOwnerPolicyLifecyclecases in normal mode (7.390s), Coveragesetmode with the same 506-package instrumentation scope as CI (10.909s; profile generated), and race (17.892s, plus the adaptive count=1 confirmation at 11.516s). Fresh full optools race: 75 roots / 315 passing terminal tests (61.760s). Incremental gofmt/vet/configured lint/shell/diff checks pass for all six changed Go packages, 0 issues. The coverage command executes the affected root only; no fresh complete-repository Coverage/BVT/full-Make rerun is claimed.pr30216-coverage-failure-20261014/design.json, final overall review inpr30216-coverage-failure-20261014/final-review.json. Current validation receipts and source fingerprints:pr30216-coverage-failure-20261014/validation-results.json.Previous delivered source:
c477e5612c1453a1b84b44e4c581025a1fdb8016, rebased onto main678b72b9292cd5e9e26c90b469e575322bb0f617. The historical full Make run below used explicit batch count4before this rebase and the new test-only visibility correction; the current focused checks validate the correction on the new base.37511213693c1e5ee302f0688447e09c3ff70fdc:make ut SKIP_TEST= UT_SHARD=all UT_PARALLEL=8 UT_EMBEDDED_BATCHES=4, 32m18.42s, Make exit 0, 430 passing packages plus 80 packages without tests; 27,735 passing roots and 74,128 passing root/subtest terminals, 73 existing skipped terminals. No failed, duplicate or malformed test terminals. Peak cgroup memory 7.19 GiB, memory-limit/OOM events and swap use zero; owned scope drained and inactive. The first attempt failed three test packages; its diagnostics are preserved and the fixes were included before this successful full rerun. Final Make default4is the same explicitly exercised policy1rollback cases, and renewed five-package vet/lint/format/shell/diff checks, 0 issues-count=2 -shuffle=20261014, all four pass and the actual TestMain exits successfully. This exact CDC->wide sequence failed before the cleanup fix.1ae2858bremain applicable to unchanged production behavior. No new full local BVT run is claimed.final-delivery-review.jsonEvidence and reproduction
Accessible terminal/resource evidence is linked in the latest update above. Full local diagnostic reports and independent-review artifacts are also indexed at:
/home/xupeng/.codex/issue-to-pr/matrixone/ut-race-stage3-20261014/evidence-index.json.The index points to the exact source manifest and native hashes, frozen commands,
both complete raw JSON reports and package receipts, cgroup CPU/memory counters,
PSS samples, inventory comparison, case-isolation trace, SCA logs and full Make UT inputs/results. Native hashes were captured before the subsequent full Make rebuilt the isolated worktree's own native installation; the borrowed worktree was not modified.
To reproduce the two policies through the full runner, use separate identical caches and run sequentially under eight CPUs, 16 GiB and no swap: