Skip to content

[Bug]: CN RSS OOM under TPCC 1000 due to cache and PK conflict IO pressure #24534

Closed

Description

@LeftHandCold

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

4.0-dev

Commit ID

0931b6c / nightly image matrixone-dev/matrixone:commit-0931b6c69

Other Environment Information

  • Hardware parameters: nightly regression distributed TP CN, CN memory limit 55Gi, FileService memory cache 12Gi, GOMEMLIMIT 25000MiB
  • OS type: Kubernetes nightly regression environment
  • Others: run matrixorigin/mo-nightly-regression/actions/runs/26235643230, namespace mo-branch-commit-0931b6c69-20260521

Actual Behavior

During TPCC 1000 warehouses / 1000 terminals, one CN (nightly-regression-dis-tp-cn-l67b9) reached the cgroup memory limit and was OOMKilled. Prometheus showed old-container RSS peaking around 53.99GiB and working set around 54.27GiB before restart. Client logs then reported rpc stream closed, connection reset to the CN lockservice endpoint, and lock table bind changed.

This is not a pure Go heap leak. Under a 55Gi cgroup limit, the 12Gi FileService memory cache is resident RSS, leaving about 43Gi for Go heap, mpool, object metadata/BloomFilter cache, logtail replay, PK conflict checks, and query batches. Current RSS scavenging only calls debug.FreeOSMemory() and does not force FileService memory cache or objectio metadata cache to make room. In addition, PKPersistedBetween only throttles the final block column read, while object metadata/BloomFilter candidate discovery and tombstone reads can run concurrently under high TPCC write concurrency.

Expected Behavior

CN should survive TPCC 1000/1000 without OOM. Under RSS pressure, memory caches should be able to give back capacity before cgroup OOM, and PK conflict-check IO should be bounded across metadata/BloomFilter/block/tombstone read paths.

Steps to Reproduce

  1. Run nightly distributed TP regression on 4.0-dev image matrixone-dev/matrixone:commit-0931b6c69.
  2. Use CN memory limit 55Gi, FileService memory cache 12Gi, GOMEMLIMIT 25000MiB.
  3. Run TPCC with 1000 warehouses and 1000 terminals.
  4. Observe CN RSS/working set near 54Gi and one CN OOMKilled around the TPCC failure window.

Additional information

The proposed fix adds real target-based cache pressure eviction for FileService memory cache and objectio metadata cache, triggers it from CN RSS scavenging at high RSS watermarks, and moves PKPersistedBetween semaphore acquisition to cover changed create/delete object metadata/BloomFilter discovery, block reads, and tombstone reads.

Validation used in the fix branch:

go test ./pkg/fileservice/fifocache ./pkg/fileservice ./pkg/objectio ./pkg/common/rscthrottler -count=1
go test ./pkg/cnservice ./pkg/vm/engine/disttae -run TestNonExistent -count=0

Activity

  1. LeftHandCold commented on May 22, 2026

    @LeftHandCold
    CollaboratorAuthor

    Fix PR: #24535

  2. LeftHandCold commented on May 22, 2026

    @LeftHandCold
    CollaboratorAuthor

    Observability PR: #24538

  3. self-assigned this
    on May 24, 2026
  4. ghost added a commit that references this issue on May 25, 2026
    58c90b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions