Repository navigation
test: start lifecycle budgets at launch and order account cleanup - #30980
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: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Incremental review of exact head f45b5d1bdd608ec61381210a954b66ce540b96ef (base be663676872edf6d42695bba41757af0a3251758). The two changed tests keep their independent scenario cleanup, register tenant-pool shutdown before DROP ACCOUNT, and start the operation contexts after blocker/session setup. The authorization helper now reports SQL errors through the active child test; controlled session timestamps replace the fixed sleeps and preserve exact TIMESTAMP(6) assertions. I found no additional actionable issue in this diff.
Validation boundary: this workspace has no MatrixOne checkout or Go executable, so I did not run tests. The repeated test runs and fault-injection overlays described in the PR/comment are author-reported; full package/race/BVT and new-head CI remain unverified here. Linked issues #29232, #28154 and #28599 are closed and already assigned to Ariznawlll; no issue changes were needed.
f45b5d1 to
148b049
Compare
|
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: 148b0494bb992e2f0753946180c15531e336f347
Assessment: approve
Reviewed the complete five-file delta and affected lifecycle owners. The changes coherently scope operation deadlines and cleanup, preserve SQL assertions and concurrency barriers, and reuse existing fixtures and cleanup policy. No actionable defects found. Costs are confined to bounded test timers and cleanup-verification queries; production paths are unchanged.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Isolation preflight, native provenance/input equivalence, formatting, diff checks and owning-package go vet passed.
-
All five affected roots passed under -race -short -tags=matrixone_test -count=1: 55 terminal test cases, no skips or race reports; execution took 53.245 seconds.
-
Separate same-process race repetitions passed: authorization ×2, table restore ×2, borrowed CREATE/MERGE ×8 and LOAD ×2.
-
Canceled-body early-FailNow overlay produced the expected exit 1. Both snapshot/PITR cleanups succeeded; tenant shutdown, account-absence verification and root shutdown completed before callback return.
-
Commands, source fingerprints, exit receipts and retained logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/b36cabe3a0b948b38878d9f9/attempt-1/validation-reconciliation.json. Source remains unchanged.
Limitations:
-
Full package/repository suites and BVT were not rerun. Frozen Ubuntu UT and arm64 SCA results remained pending; author summaries were not treated as independently verified receipts.
-
Validation covers the stated test-lifecycle changes, not resolution of the underlying service slowdown or a measured CI speedup.
148b049 to
7a69ce9
Compare
|
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: 7a69ce96b8e28aabff8653850964328b2fe7ee5d
Assessment: approve
Reviewed all seven changed test files and affected lifecycle owners. Deadline and cleanup boundaries preserve assertions, reuse existing fixtures, and correctly order resource release. The relocated admission test retains coverage. No actionable findings remain. Production SQL paths are unchanged; no performance improvement is claimed.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Isolation preflight and repository native-artifact provenance checks passed.
-
Exact-head race run passed eight roots and 60 visible root/subtest cases across all three affected packages, without skips or race reports.
-
Coverage comparison retained all 117 baseline-covered production blocks; the candidate covered 131.
-
Owning-package go vet, formatting, whitespace and clean-source checks passed.
-
Reconciled retained canceled-body cleanup evidence against its receipt, log, overlay and unchanged source inputs.
-
Commands, source fingerprints, exits and artifact hashes are recorded in /home/xupeng/.local/state/mo-bot/jobs/e81cf93bdb9cd88c51351ea3/attempt-1/validation-reconciliation.json.
Limitations:
-
Full repository tests and BVT were not run; frozen Ubuntu UT and arm64 SCA were pending.
-
Configured golangci-lint success is author-reported, not independently rerun.
-
The broader service slowdown and catalog-cleanup issues are not established as fixed by these test-only changes.
What type of PR is this?
Which issue(s) this PR fixes:
Refs #29249
Refs #30879
What this PR does / why we need it:
Give test operations and cleanup their own lifecycle boundaries, while retaining the SQL, concurrency barriers, data/catalog assertions, and shared cluster fixtures.
Start blocking-operation budgets at launch. Four lifecycle operation contexts previously consumed their 15/20-second budgets during BEGIN/INSERT, holder DDL, or session/hook preparation. Start those contexts after preparation; retain the scenario deadlines and original operation durations. Register holder rollback immediately, and cancel/release/join launched work before closing its connection or restoring hooks. Remove the unnecessary nil-channel state. The original failure is run 39957567226.
Separate independent SQL scenario budgets. In run 39974241565, LOAD failed after the CHECK/duplicate scenarios had consumed part of its shared two-minute context; later checks then cascaded on a closed connection. The borrowed CREATE/MERGE test similarly shared one minute across CTAS and several independent MERGE transactions. Reset the existing two-minute/one-minute budgets between these sequential scenario families, cancelling each prior phase only after its synchronous work/transaction is finished. No query retries or sleeps are added.
Complete account cleanup before releasing shared fixture admission. The authorization-epoch and table-restore fixtures run their LIFO cleanup inside a scenario subtest. Close tenant connections/pools before DROP ACCOUNT, retain the root connection until account-absence verification, and reuse the existing
testutils.SQLCleanupTimeoutpolicy (DROP ACCOUNT: two minutes; other statements: 30 seconds). Snapshot and PITR cleanup each get an independent budget and both are attempted on failure. Account absence is checked with a separate verification context. The table-restore fixture's old combined 30-second cleanup expired at DROP ACCOUNT in the same CI run.Keep synthetic admission tests out of the runner-wide cluster queue. Move the completed-error startup rollback assertions into the existing private admission-process fixture and verify that a subsequent owner can start. Remove the standalone fixture and its concurrency waiver. A held-global-admission probe blocks the original test but allows the consolidated test to finish; no additional cluster/helper process is introduced.
Preserve native coverage and isolate view replay budgets. Forward Go's existing
test.gocoverdirargument to the isolated helper so child execution contributes to the final coverage profile. The unchanged helper previously lost these child counters. Give each existing ViewCheckOption replay/recreation round its own original 120-second context, including the catalog-empty teardown oracle; do not let the preceding round consume that budget. Preserve both rounds and all SQL/metadata assertions.These are test ownership/budget fixes. The new failure sites were unchanged by the original PR, but a matching clean-base failure has not been reproduced locally. This PR does not claim to explain or fix the underlying Raft/service slowdown, or to close #30879's original sequential catalog-cleanup report. HAKeeper/bootstrap #30867 and Linux watcher cancellation #30757 remain separate investigations.
Validation
Rebased onto freshly fetched main
7f586371fceffa96c9146cc57614738e80b0c95e.Linux/amd64, Go 1.27.1, repository-native artifacts, controlled 8-CPU/16-GiB container. Final local validation is on
7a69ce96b8e28aabff8653850964328b2fe7ee5d:Incremental owning-package
go vetand configuredgolangci-lintpass; 0 lint issues. Format and diff checks pass.Before the final main update, actual
go test -json -race -short -tags=matrixone_test -count=1passed all five SQL issue roots and all 55 selected root/subtest terminal cases, with no skips or race reports. Test execution: 69.947 seconds. Roots:TestStatementAuthorizationEpochAcrossCatalogCommit,TestIssue29399TableRestoreRetainsDatabaseOwnership,TestIssue29400CopyAlterRetainedGatePromotionFastFails,TestBorrowedCreateAdmissionPreservesCallerWrites,TestIssue30345LoadIgnoreCheckConstraints.Private overlay cancels the table-restore body context and forces
t.Fatalimmediately after opening the tenant pool. The sole reported error is the intentional injected failure; snapshot/PITR cleanup, tenant shutdown, DROP ACCOUNT and account-absence verification still complete before shared admission releases. The overlay is excluded from this PR.After the final rebase, incremental
go vetand configuredgolangci-lintpass for all three affected packages (pkg/embed,pkg/tests/issues,pkg/tests/sqlintegration), with 0 issues. A fresh-race -count=1run passes all seven selected roots / 59 terminal root/subtest cases across those packages, with no skips or race reports. This covers the five SQL roots above plusTestClusterAdmissionAtStartand both rounds ofTestViewCheckOptionCanonicalization.The private admission handoff and direct inner cases also pass with race detection, including five repetitions: 46 terminal cases. This preserves the original rollback assertions and verifies admission reuse.
Native coverage comparison on the rebased source exercises both isolated helper consumers. The baseline's 116 covered production blocks are all retained; the final profile covers 133 blocks. Before forwarding
test.gocoverdir, moving rollback into the subprocess lost 94 previously covered blocks; that defect is corrected in this delivery. This is a focused profile comparison, not a full-repository coverage percentage claim.The original author also reported macOS normal/race runs, same-process repetitions, and early-fatal overlays for the original two roots. The Linux evidence above is new and covers the rebased five-root scope.
Only Go tests change. No production behavior, storage/wire format or BVT cases change; no new cluster fixtures. The existing isolated test helper now forwards the native coverage directory; the standalone rollback test moves into a retained named subtest with all prior assertions. Full local repository racing/BVT were not run. No CI wall-time reduction or reproduction of the underlying service slowdown is claimed from these focused checks. Large raw diffs in the two account tests are mostly indentation from the cleanup-owning subtest.