Repository navigation
Description
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, namespacemo-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
- Run nightly distributed TP regression on 4.0-dev image
matrixone-dev/matrixone:commit-0931b6c69. - Use CN memory limit 55Gi, FileService memory cache 12Gi, GOMEMLIMIT 25000MiB.
- Run TPCC with 1000 warehouses and 1000 terminals.
- 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
LeftHandCold commentedon May 22, 2026
Fix PR: #24535
LeftHandCold commentedon May 22, 2026
Observability PR: #24538
fix: keep cache pressure target under high RSS (#24543)