Repository navigation
perf(test): accelerate race batches and fix checkpoint and fixture ownership - #30426
Conversation
Avoid sharing a one-second deadline across the committed resume barrier and subsequent state queries. Preserve the separate controlled cancellation test. Fixes #30336.
Remove redundant NTILE table teardown from the shared session, assert bounded database cleanup, isolate schema-commit scenario sessions, and observe metadata readiness against query termination and the test lifetime. Join cancelled queries using an independent cleanup context. Fixes #30357. Fixes #30229.
…nder A Bash read can defer a trapped TERM until input arrives. Publishing that input from the same handler creates a cycle. Let the signal sender release the controlled read, check stop intent before PID publication, and retain exact child termination and reaping assertions for TERM and INT. Fixes #30323.
Recognize wrapped syscall.ECONNRESET in the existing managed-client retry classifier. Preserve caller deadlines and generation ownership. Extend existing replacement, terminal-error and cancellation oracles; run retry deadline cases on the standard synctest clock. Related to #30372.
… own deadlines Fixes #30422. Preserve the existing per-operation limits and all gate, cleanup, and result assertions; avoid consuming a later scenario budget in earlier subtests.
Fixes #30412. Reuse ObjectPersisted to prevent a checkpoint from publishing an empty carrier as a durable file. Preserve legacy forced-persisted nodes and persisted create/drop records. Add a deterministic checkpoint-before-first-append restart regression and retain bounded, fail-fast backup test ownership.
Fixes #30425. The incremental metadata can outlive its GC-deleted index; use the finished same-boundary global index already validated by checkpoint publication. Preserve pending-intent exclusion, legacy recovery and streaming fail-closed continuity checks.
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: 7e102fe257df3ab206a742145c9e76eb127801d2
Assessment: request_changes
Reviewed the complete 22-file delta and surrounding owners/callers. The checkpoint, retry, fixture and cleanup changes coherently reuse existing responsibilities, and functional/race validation passed. One material validation requirement remains: the concurrency increase also affects an ordinary embedded-test wave absent from the supplied performance evidence.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
Makefile:616: Default Linux CI now requests eight tasks, setting UT_EMBEDDED_PACKAGE_PARALLEL=4. The ordinary embedded wave also consumes this value for both Go package parallelism and cluster admission.
Impact: Validation requirement: this doubles concurrency for additional real cluster owners without evidence establishing their combined resource behavior on the eight-CPU, 16-GiB runner. Supply matched two-versus-four-worker ordinary-wave runs with terminal receipts, selected scope, wall/CPU measurements, aggregate peak memory and OOM telemetry, or retain its previous two-worker limit while enabling four for the measured batches. No OOM or slowdown is asserted.
Evidence: optools/run_ut.sh:2560–2574 applies the shared setting to ordinary_scope. Executed dependency discovery identified arrowload, partition, shard, sqlintegration/multicn, testutils and upgrade in that wave; their allowlisting avoids serial fallback. The PR's measurements cover only embed, dml, issues/isolated and sqlintegration, plus the separate issues shard. TestEmbeddedAuditedBatchScopeAndFailure/four-workers-ordinary uses mocked example packages and verifies dispatch only. See embedded-owner-inventory.log and its receipt in validation-index.json.
Validation:
-
Reconciled command, frozen-source fingerprint, exit and retained-log evidence in /home/xupeng/.local/state/mo-bot/jobs/2eaa38877fa3ec083b46f90e/attempt-1/validation-index.json. The final audit passed; source remained unchanged.
-
Private-/tmp and loopback preflight passed. Native prerequisites were built through repository Make rules; source, exported inputs and native artifact hashes were verified.
-
Passed 18 CI scope tests, shell syntax, diff/format checks and go vet for all ten changed Go packages.
-
Passed full race suites for optools, logservice, logtail, checkpoint, backup, merge and db. Full RPC initially encountered two read-only-working-directory failures; the unchanged race binary subsequently passed through test-exec from the diagnostic directory.
-
Passed focused production regressions, four checkpoint/replay consumer regressions and five changed public SQL roots. Adaptive race repetitions passed for retry, checkpoint, backup, RPC, lifecycle and harness paths.
-
Both checkpoint regressions failed as expected with their respective base functions overlaid and passed on the candidate. These are function-level before/after controls, not full-base suite runs.
Limitations:
-
No constrained ordinary-wave benchmark, complete CI run or separate distributed BVT was performed. Public SQL validation covered changed roots rather than every test in those packages.
-
local_validation was empty; linked issue bodies and raw author performance/coverage artifacts were not supplied. The reported approximately 33% wall-time reduction and 15–20% CPU increase concern four batched owners and were not independently verified.
-
The initial native-setup failure receipt remains, but its log was superseded during recovery; it is excluded from product-validation claims.
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #30420 (native-reset fix on main: #30426) and #28452 (related HAKeeper transport recovery). Related: #32825 and its [failed UT run](https://github.com/matrixorigin/matrixone/actions/runs/44011324458/job/133798814581). ## What this PR does / why we need it: A native connection reset can escape HAKeeper recovery during ID allocation, making an operation such as CREATE DATABASE fail. Recognize wrapped `ECONNRESET` and the relevant typed backend connection errors in the existing retry path; preserve the MORPC backend-creation timeout sentinel as a non-retryable result. Keep client ownership in the managed client: closing it now ends admission and wakes retry waiters, and a late failure only resets the client generation that actually failed. This prevents a retry from recreating a client after `Close` and prevents a stale failure from closing its replacement. Honor cancellation before issuing cached IDs or publishing a newly constructed client, and pass the caller context through reverse-proxy discovery while retaining discovery's own RPC options. For callers with an explicit MORPC backend-wait deadline, newly retryable transport failures return their original error after the current failed attempt rather than starting another HAKeeper-level dial. Existing EOF/NoHAKeeper retry behavior is preserved. An already-running synchronous dial or client cleanup can still overrun a caller or backend-wait deadline; this PR does not claim a hard end-to-end timeout. Lost allocation responses can still produce ID gaps, and the initiating server-side reset in the reported CI run is not established. Validation on 10.222.1.57, Linux/amd64, Go 1.26.4 and matching CPU CGo libraries: - Reproduced retry after `Close` and late-generation failure; regression coverage exercises terminal close, concurrent callers, cleanup errors, context cancellation and recovery, including a real MORPC backend-creation timeout. - `pkg/logservice` in normal and race modes (`-short -tags matrixone_test -count=1`): 307 passing root tests / 463 named passes, zero failures and one existing skip in each mode. Each of 17 changed/new roots also passed 100 race repetitions. - Existing three-CN `TestTableFeatures` passed with race and its original topology and assertions; existing MORPC backend-wait and HAKeeper ID-state-machine controls passed under race. - Formatting/diff checks, vet, pinned molint and incremental golangci-lint passed for the owner and direct constructor/consumer closure (nine packages). The logservice suites used isolated user/network namespaces after a pre-existing host listener prevented an unrelated Gossip test from binding its port; no test assertion or port was changed. Cached ID admission adds a context/close check under the existing lock; a single-CPU microbenchmark measured roughly 2 ns/op extra and zero allocations, not an end-to-end throughput measurement. CI for the updated head is pending.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30412
Fixes #30420
Fixes #30422
Fixes #30425
Fixes #30357
Fixes #30336
Fixes #30323
Fixes #30229
Related: #29249, #30372, #30322, #30424.
What this PR does / why we need it:
Reduce race-test wall time without removing behavioral coverage
Fix production failures at existing responsibility boundaries
Measured performance and resource tradeoffs
Sequential matched runs on the same eight-CPU, 16-GiB/no-swap budget, two versus four embedded slots:
This saves 167.250 seconds (~33%) for those owners, not a measured whole-CI reduction. Peak PSS for the four-slot owners was 4.59–7.24 GiB, with no OOM; aggregate CPU increased roughly 15–20%. Existing two-to-four-worker issues batching is now reachable from the real workflow configuration. Whole-CI savings require the new CI result and must not be inferred by summing overlapping package times.
The original backup regression dropped from approximately 61 seconds to 1.37 seconds when the deleted-index retry disappeared. Temporary storage also changed between those observations, so this is not presented as a matched throughput benchmark or added to the CI estimate.
Validation
Scope and remaining incidents
This PR does not assert that every historical assigned UT incident is solved. #30309 and #30209 did not reproduce under their focused controls, and the cause of the peer reset in #30372 is not established by fixing its retry classification. The older per-resource cleanup correction for #30322 already exists on main; this PR additionally fixes shared execution-deadline ownership. External Maven resolution (#30333) and authorization work (#30273) are outside this change. These issues are not closed by this PR.
Related initial-admission incident #30424
The native-reset retry correction also applies to the transport failures observed in #30424, which fails during initial CN admission, and #30372, which fails final withdrawal. This is a recovery improvement, not a claim that either incident is fully fixed.
A local diagnostic probe pauses real HAKeeper Raft stepping without injecting an RPC error or closing a socket. An expired heartbeat response makes the synchronous server handler fail and close its connection; a concurrent request whose own deadline remains valid receives native ECONNRESET. This occurred in 14/14 race runs, and heartbeats recovered after releasing the Raft barrier. With only the added ECONNRESET classification removed, the managed client returns the reset; with this PR it reconnects/retries and succeeds after Raft resumes. The MORPC server source is identical on both reported CI heads and this PR.
The original AutoID restart test passed locally under a two-CPU, 8-GiB/no-swap limit. The probe establishes a timeout-to-reset propagation mechanism; it does not reproduce or identify the original cause of the CI Raft stalls. If the stall lasts beyond the startup/withdrawal deadline, retrying cannot restore progress. Keep #30424 and #30372 open for that investigation; neither is a closing reference in this PR.