Skip to content

test: retire dead async worker and remove clock waits - #29679

Merged
XuPeng-SH merged 23 commits into
mainfrom
codex/quality-29249-remove-dead-asyncpool-20261008
Oct 8, 2026
Merged

XuPeng-SH merged 23 commits into
mainfrom
codex/quality-29249-remove-dead-asyncpool-20261008

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Refs #29249 (ongoing test-quality work; this PR does not close the tracking issue).

What this PR does / why we need it:

Remove disconnected implementation and test scaffolding, and replace clock waits with observable behavior without weakening the retained oracles.

  • Remove the unused Go async worker pool and private merge simulator, along with their disconnected tests. Retain the real thread-pool executor and production merge scheduler; move the existing clock implementation without changing its behavior.
  • Remove commented-out, skipped diagnostic scaffolding and orphan helpers where they have no active test value. Preserve active checkpoint, GC, replay, transaction and restart checks; re-enable meaningful non-voting replica and delete/restart tests.
  • Exercise exporter contents directly and lifecycle separately. In the collector test, assert threshold-triggered SQL publication before stopping, then assert pending-buffer drainage after graceful stop. Both waits are bounded and cleanup is registered immediately.
  • Synchronize asynchronous tests on their actual completion/publication oracles, including jobs, backend creation and logtail cancellation. Keep main's canonical GC tests from test(morpc): synchronize client gc tests #29674 intact, including unregistered-client, idle-close and failure-cleanup assertions.
  • Keep prebuild tests independent of host free disk while retaining a separate low-disk rejection check and real child-process cleanup assertions.

Final delta against main: 26 files, +483/-4914 lines. No SQL, protocol or persistent-data-format changes. Existing data compatibility is unchanged; mixed-version operation is not part of this change.

Validation

  • Complete delivery-diff selection: 16 affected/direct-consumer packages, including packages containing deleted tests and the real scheduler's owning DB consumer. Normal UT and race UT both passed (15 test packages; 3,372 test/subtest pass events each, five existing skips). Both use -short -tags matrixone_test -count=1 with the repository CGo wrapper; the testutil support package is compiled but contains no tests. The skipped tests are not claimed as validated.
  • Incremental formatting/diff checks, go vet, the repository-pinned molint, and configured golangci-lint 2.14.0 against the final main base.
  • Collector and auto-create tests: 100 race-mode repetitions each.
  • Independent white-box negative controls: disabling threshold publication fails the pre-stop assertion; disabling shutdown drainage fails the post-stop assertion. Both terminate with cleanup rather than hanging.
  • Design and final complete-change review use gpt-6.1-sol with xhigh reasoning. Local terminal evidence is recorded independently of remote CI.

Removing fixed waits reduces avoidable test delay, but this PR does not claim a measured whole-suite or production performance improvement. Remote CI is not used as a substitute for the local gates.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added kind/test-ci kind/refactor Code refactor labels Oct 8, 2026
@matrix-meow matrix-meow added the size/L Denotes a PR that changes [500,999] lines label Oct 8, 2026
@matrix-meow matrix-meow added size/XL Denotes a PR that changes [1000, 1999] lines and removed size/L Denotes a PR that changes [500,999] lines labels Oct 8, 2026
@matrix-meow matrix-meow removed the size/XL Denotes a PR that changes [1000, 1999] lines label Oct 8, 2026

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-review conclusion: not approvable yet

Reviewed 21db6ad against PR base f20f5ca147c44b012343d0f48dfcd84b6a5986a1, and cross-checked freshly verified main dce60631f8c857ae730a4d2f328df5962e4f2a8d. No subagents. This is a COMMENT review because the authenticated reviewer is also the PR author; GitHub does not allow self-REQUEST_CHANGES.

The cleanup/reuse direction is reasonable. I read the complete 27-file delta and traced the changed ownership boundaries. I found one P2 test-oracle defect (inline below), not a demonstrated new production correctness defect. There is also an integration blocker with latest main.

Integration blocker: preserve #29674 when resolving the conflict

The PR currently reports CONFLICTING / DIRTY. Main has already merged #29674, which changes the same MORPC GC tests. Its useful independent checks include zero factory calls for an unregistered client, unconditional idle-backend removal/Close assertions, and manager/client cleanup registered before fatal assertions. This branch overlaps those edits but does not contain those stronger checks. Rebase/integrate the canonical main version rather than selecting this older fixture wholesale during conflict resolution; then revalidate the integrated changes. This is overlap in test responsibility, not a second production GC implementation.

Design, deletions, and QA

  • Implementation files: +54/-1517. The unused Go AsyncWorkerPool and private merge simulator have no product consumers. Existing ThreadPoolExecutor and C++ cuVS worker ownership remain intact. The real scheduler Clock is relocated without changed semantics; the private resource-controller fixture stays test-only. No new production state machine/storage/execution path.
  • Tests/test support: +434/-3428. Commented/permanently skipped diagnostics and orphan private fixtures are distinct from active coverage. Retained GCCatalog1/GCCatalog3 and checkpoint/replay tests provide actual drop/GC/replay assertions. The two new replacement tests exercise different conflict mechanisms (destination-key collision and competing predecessor); TestDelete4 checks committed updates across restart. Exporter content checks are stronger than the old timing-dependent early return. The collector rewrite needs the inline correction.
  • Repository documentation: no changed files. Refresh the PR description: it still claims TestUpdate was removed, a 100ms unregistered-client wait was retained, and 26 changed files; these do not match the final head.
Unhappy-path lens Reviewed ownership / outcome
Q1 cleanup Client creation/cleanup retain existing owners; ticker cancellation joins the existing done channel; TAE temporary batches/transactions have close/rollback paths. Preserve #29674's failure-path fixture cleanup during integration.
Q2 termination Exact create-state completion and actual job execution replace timing guesses. Collector SQL/Stop waits need bounded failure diagnostics with the corrected live oracle.
Q3 growth Existing fixed workers, bounded channels, and fixture ownership are retained; no new unbounded production queue or cache is introduced.

Validation evidence

  • Exact-head UT/race job, SCA, pessimistic BVT and proxy BVT passed. Skipped jobs are not counted as validation.
  • Supported native prerequisites rebuilt successfully; git diff --check passed. User worktree changes were untouched; all mutations were external review-only overlays.
  • Normal collector/exporter/StartStop tests passed. Five changed MORPC scenarios each passed -race -count=3 (15 named case executions).
  • TestDelete4 and the two new replacement tests each passed -count=3 at GOMAXPROCS=1 (9 named case executions); exact-head CI also ran these with race enabled.
  • Non-voting replica test passed 3/3; deliberately ignoring StartNonVotingReplica failed its separate metadata-file oracle. That concern was rejected.
  • Collector counterfactual failure/pass evidence is detailed inline. This is a test-quality regression, not evidence that the unchanged production collector is currently broken.

CI's TestDelete4 took 8.77s; no business-workload or total-CI speedup is established by these checks. At the reviewed head there were zero human review threads and zero prior submitted reviews, so there is no outstanding historical human finding to claim was resolved.

Required before approval: restore the collector's independent live-publication oracle, integrate latest main without losing #29674's checks, and validate the resulting head.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final repair review: PASS for the complete delivery diff against main dce6063 (delivery SHA256 958b0b7408d5bb09d859bde83e29b22b0b32d2c5aa1f15198ebf4e5bb6b4e028).

The P2 collector oracle gap is fixed: live three-row m1 SQL is asserted before Stop, and pending two-row m2 drainage is asserted after a bounded graceful join. Cleanup is registered immediately and retains the original stop handle. Independently disabling live threshold publication or shutdown drainage now fails at the corresponding assertion with cleanup completed. Rebase retains main's #29674 GC tests byte-for-byte and reuses its backend publication helper.

Local complete-scope normal and race UT both terminated with exit 0: 15 tested packages passed, plus the no-test testutil support package compiled; 3,372 test/subtest pass events and five existing skips per mode. Collector and auto-create also passed 100 race repetitions each. Formatting, diff check, go vet, repository-pinned molint and configured incremental golangci-lint 2.14.0 passed.

Design and final overall model gates both used gpt-6.1-sol / xhigh; final review session 01a11a2d-1f3d-7051-a42d-e1abed72b8a7 found no confirmed material blocker across the complete 26-file scope. Validation is Darwin arm64 CPU with -short; skipped tests, new BVT and whole-suite speedup are not claimed. The pre-existing rawhist accounting issue is outside this test-oracle repair; m2 proves drainage, not rawhist threshold semantics.

This is a submitted COMMENT review because GitHub does not permit approving one's own PR. Remote CI has not been awaited.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep re-review: approvable; no confirmed blocking finding

Reviewed head aa3fa678d293fb704dfaea6ca51b634a04176133 against freshly verified main/merge-base dce60631f8c857ae730a4d2f328df5962e4f2a8d. No subagents and no source changes. This is a COMMENT review because the authenticated user is the PR author; it is not a GitHub APPROVE.

The design is proportionate: remove disconnected implementations and inactive scaffolding, retain the active owners, and use the existing completion/publication paths. No duplicate production state machine, storage or execution path is introduced. The full 26-file change map was reconciled with the previous review; source identity and relevant dependencies are unchanged. Implementation is +54/-1517, tests/support +429/-3397, repository documentation unchanged. The clock relocation preserves behavior and its production consumers; the retained tests distinguish the two transaction-conflict mechanisms and committed state across restart.

Historical comments

All actionable findings are closed by source and evidence, not merely by thread state:

  • Live collector threshold publication is asserted before Stop, with bounded receives and immediate cleanup; pending-buffer drainage has a separate post-Stop oracle.
  • Main #29674's canonical GC test file is byte-identical to main. Auto-create reuses the existing backend publication helper.
  • The merge conflict and stale PR-description claims are resolved. The sole actionable review thread is resolved; no other outstanding human finding was present.

Additional QA challenge

I disabled only the SQL collector's timer by replacing its NewConstantClock(c.opts.flushInterval) with NewConstantClock(0) in an external Go overlay. The retained TestMetric stopped at metric_test.go:83, waiting for the first INSERT, and the 45-second guard terminated the run with exit 1. The healthy same-head control passes in normal mode (16.07s) and race mode (16.40s). Thus low-volume periodic publication still has real integration coverage through InitMetric/exporter/SQL collector; the suspected coverage-loss finding is rejected. This older integration test uses a coarse package timeout for failure diagnostics.

Together with the existing independent threshold-disabled and drain-disabled controls, the tests distinguish live threshold flush, graceful drainage and periodic low-volume publication.

Unhappy-path check Verified closure
Ownership Immediate collector cleanup retains the first Stop handle; existing GC cleanup and TAE rollback/batch/iterator ownership remain intact.
Termination Collector receives/joins are bounded; the finite fixture cannot fill its worker queues; backend publication and ticker completion use their actual owners.
Growth Existing bounded channels/pools and finite fixtures; no new production queue/cache/worker owner.

Validation and cost

Reused exact-source normal and race results: 15 tested packages passed plus testutil compiled, with 3,372 test/subtest pass events and five existing skips per mode. Incremental formatting, vet, pinned molint and configured golangci-lint passed. Collector and auto-create each retain 100 successful race repetitions.

New focused race checks completed with exit 0: exporter Start/Stop, concurrent job Schedule/Stop, both modified GC-ticker tests, and non-voting replica startup each passed 100/100; TestDelete4 passed 22/22. Counts were derived from the existing race-body durations with a 30-second budget per test.

Recovered TestDelete4 costs about 1.29s normal / 1.34s race locally; the two deterministic conflict tests each cost below 0.1s. No whole-CI or production-workload speedup is established. No SQL/wire/persistent-format change requires additional compatibility or BVT proof here. Darwin arm64 CPU/-short and existing skips remain explicit limits. The unchanged rawhist accounting defect remains outside this test-cleanup scope.

Remote CI is still running and has not been counted as passed. Code review has no remaining blocker; merge still requires the repository's CI gates.

This branch had an error being deployed

1 failed deployment
ci — c0c16328 Deployed Oct 8, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor Code refactor kind/test-ci size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants