Repository navigation
test: stabilize user lock cleanup cap accounting - #26400
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head e809af9. The accounting-only test now suppresses worker startup while inspecting transient retained state, snapshots every userLevelLocks invariant under the mutex, and performs fail-fast assertions only after unlocking. I checked all failure points: runUserLevelLockTest defers the generation-aware reset, the synthetic started-without-done state is handled safely, and no cleanup goroutine crosses into the next test generation. The focused test passes count=200, race x100, and coverage x100; the full function package and go vet pass, git diff --check is clean, the head merges cleanly with current main, and the latest CI checks are green. No blocking issue found.
Merge Queue Status
This pull request spent 15 minutes 51 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
## 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: Fixes matrixorigin#26397 ## What this PR does / why we need it: `TestActiveUserLevelLockOwnersBoundRetainedCloseCleanupGrowth` verifies retained cleanup admission accounting, but it started the asynchronous cleanup worker while asserting transient global-map state. The worker could consume the entry before the assertion. The failed assertion also ran while holding `userLevelLocks`. Because `require.Len` terminates the test goroutine, the mutex remained locked and the deferred reset blocked until the package-wide ten-minute timeout. This change: - keeps the retained cleanup worker stopped while this accounting-only test observes capacity invariants; - snapshots protected state under the mutex and performs every assertion after unlocking; - restores the worker state before leaving the test. Production user-level-lock behavior is unchanged. Validation: - focused test: `-count=100` - focused race test: `-race -count=30` - focused coverage test: `-cover -count=100` - full `pkg/sql/plan/function` test package Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## 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: Fixes matrixorigin#26397 ## What this PR does / why we need it: `TestActiveUserLevelLockOwnersBoundRetainedCloseCleanupGrowth` verifies retained cleanup admission accounting, but it started the asynchronous cleanup worker while asserting transient global-map state. The worker could consume the entry before the assertion. The failed assertion also ran while holding `userLevelLocks`. Because `require.Len` terminates the test goroutine, the mutex remained locked and the deferred reset blocked until the package-wide ten-minute timeout. This change: - keeps the retained cleanup worker stopped while this accounting-only test observes capacity invariants; - snapshots protected state under the mutex and performs every assertion after unlocking; - restores the worker state before leaving the test. Production user-level-lock behavior is unchanged. Validation: - focused test: `-count=100` - focused race test: `-race -count=30` - focused coverage test: `-cover -count=100` - full `pkg/sql/plan/function` test package Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## 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: Fixes matrixorigin#26397 ## What this PR does / why we need it: `TestActiveUserLevelLockOwnersBoundRetainedCloseCleanupGrowth` verifies retained cleanup admission accounting, but it started the asynchronous cleanup worker while asserting transient global-map state. The worker could consume the entry before the assertion. The failed assertion also ran while holding `userLevelLocks`. Because `require.Len` terminates the test goroutine, the mutex remained locked and the deferred reset blocked until the package-wide ten-minute timeout. This change: - keeps the retained cleanup worker stopped while this accounting-only test observes capacity invariants; - snapshots protected state under the mutex and performs every assertion after unlocking; - restores the worker state before leaving the test. Production user-level-lock behavior is unchanged. Validation: - focused test: `-count=100` - focused race test: `-race -count=30` - focused coverage test: `-cover -count=100` - full `pkg/sql/plan/function` test package Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26397
What this PR does / why we need it:
TestActiveUserLevelLockOwnersBoundRetainedCloseCleanupGrowthverifies retainedcleanup admission accounting, but it started the asynchronous cleanup worker
while asserting transient global-map state. The worker could consume the entry
before the assertion.
The failed assertion also ran while holding
userLevelLocks. Becauserequire.Lenterminates the test goroutine, the mutex remained locked and thedeferred reset blocked until the package-wide ten-minute timeout.
This change:
observes capacity invariants;
unlocking;
Production user-level-lock behavior is unchanged.
Validation:
-count=100-race -count=30-cover -count=100pkg/sql/plan/functiontest package