Skip to content

test(gc): make deleter concurrency check deterministic - #26644

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-26643-1a93ca15
Aug 3, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-26643-1a93ca15

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Aug 3, 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:

issue #26643

What this PR does / why we need it:

Root cause

TestDeleterConcurrentDelete simulated S3 latency with a 10 ms sleep in every
Delete call, then required the complete four-batch operation to finish in less
than 35 ms. That wall-clock threshold measured runner scheduling delay as well
as concurrency. In the reported CI failure, all four calls overlapped and
finished within about 1 ms of each other, all 20 files were deleted exactly
once, but a runner pause extended every call to about 40-41 ms and the test
failed at 42.3 ms.

Changes

  • Add an optional, context-aware barrier to the existing file-service mock.
  • Make the concurrent deletion test hold every batch at the barrier until all
    four Delete calls have entered it. A serial or under-concurrent
    implementation therefore cannot pass.
  • Retain exact assertions for four batches, 20 deleted files, and one deletion
    per file. The 10-second context is only a hang guard for a real concurrency
    regression; successful execution has no timing assertion.

Production code is unchanged.

Issue-to-test proof

TestDeleterConcurrentDelete directly proves #26643: four batch calls must be
simultaneously in flight before any call can complete. As a negative control,
temporarily setting the test to one worker produced the expected context
deadline at the barrier; restoring four workers passed 100 repetitions.

BVT is not applicable because this is an internal goroutine scheduling contract
with no SQL-visible behavior.

Validation

After rebasing onto main at
acfb8ef77ccbb41637dbe719c7b544d2ecf012f6 (including the merged fix for the
previous unrelated blocker #26649), the PR diff remains limited to
pkg/vm/engine/tae/db/gc/v3/deleter_test.go and the following checks passed:

  • GOWORK=off go list -mod=readonly ./pkg/vm/engine/tae/db/gc/v3
  • GOWORK=off go build -mod=readonly ./pkg/vm/engine/tae/db/gc/v3 with the repository CGo include/library paths
  • GOWORK=off go vet -mod=readonly ./pkg/vm/engine/tae/db/gc/v3 with the repository CGo include/library paths
  • .agents/skills/mo-dev/scripts/mo-cgo-test -run '^TestDeleterConcurrentDelete$' -count=100 -timeout=180s ./pkg/vm/engine/tae/db/gc/v3
  • .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s ./pkg/vm/engine/tae/db/gc/v3
  • Focused race measurement: T=0s, B=30s, adaptive N=100
  • .agents/skills/mo-dev/scripts/mo-cgo-test -race -run '^TestDeleterConcurrentDelete$' -count=100 -timeout=30s ./pkg/vm/engine/tae/db/gc/v3
  • .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30s ./pkg/vm/engine/tae/db/gc/v3
  • MORPC_GC_IDLE_INTERVAL=1ms .agents/skills/mo-dev/scripts/mo-cgo-test -race -run '^TestIndependentControlBackendPreservesSlowDataRequest$' -count=100 -timeout=180s ./pkg/common/morpc
  • GitHub Actions runs 30826562985 and 30826561149: all completed checks successful, skipped, or neutral
  • git merge-tree --write-tree HEAD origin/main against fa6c57cbfaba17d705ebc673bd49c06bf156e4d5: no conflict
  • git diff --check

Residual risk

There is no production compatibility or performance impact. If deletion
concurrency regresses, this test now fails after the 10-second hang guard rather
than producing a false performance failure under runner load.

@gouhongshen

gouhongshen commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

The branch is now rebased onto acfb8ef77ccbb41637dbe719c7b544d2ecf012f6, which includes merged PR #26651 and resolves the unrelated MORPC failure tracked by #26649. Fresh CI is running on the new PR head.

The remaining unresolved failures from workflow run 30807956392 are unrelated to this PR, whose diff only changes pkg/vm/engine/tae/db/gc/v3/deleter_test.go:

Run 30807956392 reached attempt 2 and will not be rerun again.

@XuPeng-SH
XuPeng-SH merged commit e601597 into matrixorigin:main Aug 3, 2026
5 of 6 checks passed
@mergify mergify Bot added dequeued and removed queued labels Aug 3, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…26644)

## 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:

issue matrixorigin#26643

## What this PR does / why we need it:

### Root cause

`TestDeleterConcurrentDelete` simulated S3 latency with a 10 ms sleep in
every
`Delete` call, then required the complete four-batch operation to finish
in less
than 35 ms. That wall-clock threshold measured runner scheduling delay
as well
as concurrency. In the reported CI failure, all four calls overlapped
and
finished within about 1 ms of each other, all 20 files were deleted
exactly
once, but a runner pause extended every call to about 40-41 ms and the
test
failed at 42.3 ms.

### Changes

- Add an optional, context-aware barrier to the existing file-service
mock.
- Make the concurrent deletion test hold every batch at the barrier
until all
  four `Delete` calls have entered it. A serial or under-concurrent
  implementation therefore cannot pass.
- Retain exact assertions for four batches, 20 deleted files, and one
deletion
per file. The 10-second context is only a hang guard for a real
concurrency
  regression; successful execution has no timing assertion.

Production code is unchanged.

### Issue-to-test proof

`TestDeleterConcurrentDelete` directly proves matrixorigin#26643: four batch calls
must be
simultaneously in flight before any call can complete. As a negative
control,
temporarily setting the test to one worker produced the expected context
deadline at the barrier; restoring four workers passed 100 repetitions.

BVT is not applicable because this is an internal goroutine scheduling
contract
with no SQL-visible behavior.

### Validation

After rebasing onto `main` at
`acfb8ef77ccbb41637dbe719c7b544d2ecf012f6` (including the merged fix for
the
previous unrelated blocker matrixorigin#26649), the PR diff remains limited to
`pkg/vm/engine/tae/db/gc/v3/deleter_test.go` and the following checks
passed:

- `GOWORK=off go list -mod=readonly ./pkg/vm/engine/tae/db/gc/v3`
- `GOWORK=off go build -mod=readonly ./pkg/vm/engine/tae/db/gc/v3` with
the repository CGo include/library paths
- `GOWORK=off go vet -mod=readonly ./pkg/vm/engine/tae/db/gc/v3` with
the repository CGo include/library paths
- `.agents/skills/mo-dev/scripts/mo-cgo-test -run
'^TestDeleterConcurrentDelete$' -count=100 -timeout=180s
./pkg/vm/engine/tae/db/gc/v3`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s
./pkg/vm/engine/tae/db/gc/v3`
- Focused race measurement: `T=0s`, `B=30s`, adaptive `N=100`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -run
'^TestDeleterConcurrentDelete$' -count=100 -timeout=30s
./pkg/vm/engine/tae/db/gc/v3`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30s
./pkg/vm/engine/tae/db/gc/v3`
- `MORPC_GC_IDLE_INTERVAL=1ms .agents/skills/mo-dev/scripts/mo-cgo-test
-race -run '^TestIndependentControlBackendPreservesSlowDataRequest$'
-count=100 -timeout=180s ./pkg/common/morpc`
- GitHub Actions runs `30826562985` and `30826561149`: all completed
checks successful, skipped, or neutral
- `git merge-tree --write-tree HEAD origin/main` against
`fa6c57cbfaba17d705ebc673bd49c06bf156e4d5`: no conflict
- `git diff --check`

### Residual risk

There is no production compatibility or performance impact. If deletion
concurrency regresses, this test now fails after the 10-second hang
guard rather
than producing a false performance failure under runner load.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…26644)

## 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:

issue matrixorigin#26643

## What this PR does / why we need it:

### Root cause

`TestDeleterConcurrentDelete` simulated S3 latency with a 10 ms sleep in
every
`Delete` call, then required the complete four-batch operation to finish
in less
than 35 ms. That wall-clock threshold measured runner scheduling delay
as well
as concurrency. In the reported CI failure, all four calls overlapped
and
finished within about 1 ms of each other, all 20 files were deleted
exactly
once, but a runner pause extended every call to about 40-41 ms and the
test
failed at 42.3 ms.

### Changes

- Add an optional, context-aware barrier to the existing file-service
mock.
- Make the concurrent deletion test hold every batch at the barrier
until all
  four `Delete` calls have entered it. A serial or under-concurrent
  implementation therefore cannot pass.
- Retain exact assertions for four batches, 20 deleted files, and one
deletion
per file. The 10-second context is only a hang guard for a real
concurrency
  regression; successful execution has no timing assertion.

Production code is unchanged.

### Issue-to-test proof

`TestDeleterConcurrentDelete` directly proves matrixorigin#26643: four batch calls
must be
simultaneously in flight before any call can complete. As a negative
control,
temporarily setting the test to one worker produced the expected context
deadline at the barrier; restoring four workers passed 100 repetitions.

BVT is not applicable because this is an internal goroutine scheduling
contract
with no SQL-visible behavior.

### Validation

After rebasing onto `main` at
`acfb8ef77ccbb41637dbe719c7b544d2ecf012f6` (including the merged fix for
the
previous unrelated blocker matrixorigin#26649), the PR diff remains limited to
`pkg/vm/engine/tae/db/gc/v3/deleter_test.go` and the following checks
passed:

- `GOWORK=off go list -mod=readonly ./pkg/vm/engine/tae/db/gc/v3`
- `GOWORK=off go build -mod=readonly ./pkg/vm/engine/tae/db/gc/v3` with
the repository CGo include/library paths
- `GOWORK=off go vet -mod=readonly ./pkg/vm/engine/tae/db/gc/v3` with
the repository CGo include/library paths
- `.agents/skills/mo-dev/scripts/mo-cgo-test -run
'^TestDeleterConcurrentDelete$' -count=100 -timeout=180s
./pkg/vm/engine/tae/db/gc/v3`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s
./pkg/vm/engine/tae/db/gc/v3`
- Focused race measurement: `T=0s`, `B=30s`, adaptive `N=100`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -run
'^TestDeleterConcurrentDelete$' -count=100 -timeout=30s
./pkg/vm/engine/tae/db/gc/v3`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30s
./pkg/vm/engine/tae/db/gc/v3`
- `MORPC_GC_IDLE_INTERVAL=1ms .agents/skills/mo-dev/scripts/mo-cgo-test
-race -run '^TestIndependentControlBackendPreservesSlowDataRequest$'
-count=100 -timeout=180s ./pkg/common/morpc`
- GitHub Actions runs `30826562985` and `30826561149`: all completed
checks successful, skipped, or neutral
- `git merge-tree --write-tree HEAD origin/main` against
`fa6c57cbfaba17d705ebc673bd49c06bf156e4d5`: no conflict
- `git diff --check`

### Residual risk

There is no production compatibility or performance impact. If deletion
concurrency regresses, this test now fails after the 10-second hang
guard rather
than producing a false performance failure under runner load.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…26644)

## 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:

issue matrixorigin#26643

## What this PR does / why we need it:

### Root cause

`TestDeleterConcurrentDelete` simulated S3 latency with a 10 ms sleep in
every
`Delete` call, then required the complete four-batch operation to finish
in less
than 35 ms. That wall-clock threshold measured runner scheduling delay
as well
as concurrency. In the reported CI failure, all four calls overlapped
and
finished within about 1 ms of each other, all 20 files were deleted
exactly
once, but a runner pause extended every call to about 40-41 ms and the
test
failed at 42.3 ms.

### Changes

- Add an optional, context-aware barrier to the existing file-service
mock.
- Make the concurrent deletion test hold every batch at the barrier
until all
  four `Delete` calls have entered it. A serial or under-concurrent
  implementation therefore cannot pass.
- Retain exact assertions for four batches, 20 deleted files, and one
deletion
per file. The 10-second context is only a hang guard for a real
concurrency
  regression; successful execution has no timing assertion.

Production code is unchanged.

### Issue-to-test proof

`TestDeleterConcurrentDelete` directly proves matrixorigin#26643: four batch calls
must be
simultaneously in flight before any call can complete. As a negative
control,
temporarily setting the test to one worker produced the expected context
deadline at the barrier; restoring four workers passed 100 repetitions.

BVT is not applicable because this is an internal goroutine scheduling
contract
with no SQL-visible behavior.

### Validation

After rebasing onto `main` at
`acfb8ef77ccbb41637dbe719c7b544d2ecf012f6` (including the merged fix for
the
previous unrelated blocker matrixorigin#26649), the PR diff remains limited to
`pkg/vm/engine/tae/db/gc/v3/deleter_test.go` and the following checks
passed:

- `GOWORK=off go list -mod=readonly ./pkg/vm/engine/tae/db/gc/v3`
- `GOWORK=off go build -mod=readonly ./pkg/vm/engine/tae/db/gc/v3` with
the repository CGo include/library paths
- `GOWORK=off go vet -mod=readonly ./pkg/vm/engine/tae/db/gc/v3` with
the repository CGo include/library paths
- `.agents/skills/mo-dev/scripts/mo-cgo-test -run
'^TestDeleterConcurrentDelete$' -count=100 -timeout=180s
./pkg/vm/engine/tae/db/gc/v3`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s
./pkg/vm/engine/tae/db/gc/v3`
- Focused race measurement: `T=0s`, `B=30s`, adaptive `N=100`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -run
'^TestDeleterConcurrentDelete$' -count=100 -timeout=30s
./pkg/vm/engine/tae/db/gc/v3`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30s
./pkg/vm/engine/tae/db/gc/v3`
- `MORPC_GC_IDLE_INTERVAL=1ms .agents/skills/mo-dev/scripts/mo-cgo-test
-race -run '^TestIndependentControlBackendPreservesSlowDataRequest$'
-count=100 -timeout=180s ./pkg/common/morpc`
- GitHub Actions runs `30826562985` and `30826561149`: all completed
checks successful, skipped, or neutral
- `git merge-tree --write-tree HEAD origin/main` against
`fa6c57cbfaba17d705ebc673bd49c06bf156e4d5`: no conflict
- `git diff --check`

### Residual risk

There is no production compatibility or performance impact. If deletion
concurrency regresses, this test now fails after the 10-second hang
guard rather
than producing a false performance failure under runner load.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants