Repository navigation
perf(optools): bound race UT critical path safely - #29760
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? |
359de51 to
1c35457
Compare
Request changes: close the design contract before approvalThis change materially changes the race-UT execution and ownership model: it batches roots under a shared deadline, adds cancellation/report handoff paths, and introduces opt-in cross-process cluster admission with two slots. Please link the exact reviewed design revision and record its approval before implementation approval. There is also a direct mismatch with the existing design contract: Local checks completed: |
|
Resolved the previous P2 design-contract review finding and simplified the implementation.
Issues batching savings remain historical scoped measurements; the current paired scheduling-copy benchmark confirms reduced copy work. Neither is a claim that the entire CI job has reached 600 seconds. No merge or CI rerun is requested by this update. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of e855f9f991649077eca1330bef5a89cda02a3c6a: no unresolved material blockers; recommend approval on code/design grounds.
All actionable existing comments are resolved. The CDC durable-progress regression and redundant retirement state are closed. The implementation uses the existing updater, executor and cleanup owners: map identity is the sole retirement state, ACK/owner changes retain revision invalidation, and delayed readers cannot republish retired results or remove replacement observations. SQL remains outside the updater mutex; rereads are bounded by one additional SELECT and the original deadline. Tracking follows outstanding reads rather than retaining idle-key history.
Reviewed implementation, tests and documentation separately. Existing tests use durable-result/error oracles and explicit interleaving barriers, including two-reader retirement/reuse, observation-only eviction, cancellation, backend failure and repeated conflicts. Design v4 matches the implementation. The unchanged runner, projection/WAL, admission and engine-fixture closures retain the previous complete review and valid evidence.
Verified the committed full-diff fingerprint against validation: CDC owning package 474 root tests PASS in each mode, normal 8.938s and race 10.494s, count=1, no failures/skips. Configured incremental static checks pass; lint reports zero issues. No redundant test rerun was needed for this review.
This recommendation does not certify full current-head CI. The whole-job 600-second performance goal remains unproven; historical batching/copy measurements support only their measured scope.
What type of PR is this?
Which issue(s) this PR fixes:
Related #29562
Fixes #29752
What this PR does / why we need it:
Reduce retained race UT work and scheduling copies while preserving runnable coverage, failure diagnostics and CDC replay correctness.
Design:
pr29760-design-v4, bounded execution at existing owners. It replaces v2's invalid assumption that generation/timestamp comparison proves a cached checkpoint durable. No API, catalog, persisted-format or dependency change.Performance and complexity
Prior author measurements for issues-only serial batching: wall 515.1 → 407.8 s, CPU 792.2 → 512.7 s, sampled peak RSS 3.42 → 2.26 GiB. Prior paired scheduling-copy measurement with two CNs/3,770 config items: full 251,021 ns / 561,424 B / 3,893 allocations; projection 8,095 ns / 9,848 B / 107 allocations. These are package/copy measurements, not a whole-job or TP-throughput claim.
CDC normal reads and claims retain their existing SQL count; checkpoint flush adds no SELECT. Only an overlapping publication causes one extra SELECT. Tracking stores no progress tuple or idle-key history and is bounded by outstanding calls. SQL and fence callbacks remain outside the updater mutex.
Validation
Final revision
e855f9f991649077eca1330bef5a89cda02a3c6a, including the CDC retirement-state cleanup, merge baseb6fa8cc; Go 1.27.1, darwin/arm64 CPU, fresh native build with verified provenance, repository CGo runner,count=1for normal/race. Selections are named and non-empty.Deterministic guarded-SQL A/B reproduced the regression: durable 100/local optimistic 200; both typed read and replacement claim returned 200 before the repair and 100 with the baseline. Fixed tests assert returned and installed 100, including after claim-loss eviction.
Complete CDC owning package: PASS normal 8.938 s / race 10.494 s, 474 roots, no failures/skips. Prior repair evidence for five exact concurrency roots individually repeated 100 times under race: PASS; retained as historical stress evidence. The representation cleanup refreshes complete owning-package normal/race. Covers lower-timestamp/new-generation ACK, ACK followed by guarded no-op, owner replacement, retirement/reuse, observation-only eviction, deletion, cancellation, unrelated-key publication and bounded repeated conflict.
Two-barrier retirement/reuse proves the old reader's release preserves an outstanding replacement observation. Original legacy ACK and scratch controls remain green.
Semantically unchanged consumer evidence reused: six frontend admission/recovery controls: PASS normal/race. Real
TestCDCGenerationReplacementOnMO: PASS normal 129.871 s / race 123.802 s.Full HAKeeper and protobuf owning packages: PASS normal/race. LogService: 16 focused normal roots and complete 361-root owning package race PASS. Three directly affected engine fixture consumers PASS normal/race.
Unchanged exact-head
optoolsand cluster-admission complete race, plus a real four-process batch probe: retained PASS evidence. Original-head Linux UT, coverage, configured SCA and compose BVT completed successfully; this evidence applies to unchanged closures, not the new CDC repair.Complete delivery diff's 10-package incremental closure: formatting, vet, pinned molint and configured golangci-lint 2.14.0 PASS. CDC static checks refreshed after final retirement-state cleanup; lint 0 issues. Existing off-diff molint diagnostics are unchanged.
git diff --checkclean.Prior CDC repair gpt-6.1-sol / xhigh design session
01a11f9f-c469-7a63-be78-f3b489af1d8eand overall review/reconciliation session01a11fda-1171-74b3-9124-c2b3ba3a5f4a: PASS, no unresolved material blockers. The review's optional identity-release test suggestion was implemented and revalidated.Retirement-state cleanup removes the redundant
retiredflag and retirement-only revision increment; map identity already rejects detached readers. Admission/refcounts, ACK invalidation, SQL counts and errors are preserved. No new tests or abstractions. Actual gpt-6.1-sol / xhigh v4 design session01a11ffd-0e30-7023-a940-fd129e8bd155and final overall reconciliation session01a12004-4d73-7763-b900-dc27c763635b: PASS.Records:
~/.codex/issue-to-pr/matrixone/pr29760-cdc-takeover/(design, overall review, final source fingerprint, complete scope and terminal validation logs).CI triggered by the repair commit is separate and remains pending. The deterministic probe proves a component regression; it does not claim a reproduced live data-loss incident. Whole-job performance remains unmeasured.