Skip to content

fix: keep meta cache out of rss pressure eviction - #24648

Merged
XuPeng-SH merged 3 commits into
matrixorigin:4.0-devfrom
LeftHandCold:fix/rss-pressure-data-cache-only-4dev
May 27, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:4.0-devfrom
LeftHandCold:fix/rss-pressure-data-cache-only-4dev

Conversation

@LeftHandCold

@LeftHandCold LeftHandCold commented May 27, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Refs #24644

What this PR does / why we need it:

This PR implements Step 1 and Step 2 of the RSS cache pressure optimization plan:

  • keep objectio meta cache out of RSS forced eviction
  • stop setting RSS pressure admission targets on objectio meta cache
  • keep RSS pressure eviction focused on fileservice memory/data caches
  • allow pressure admission for data cache ghost hits by evicting cold data first
  • keep cold one-shot data rejected under pressure to avoid scan pollution
  • move memory cache pressure admission decisions into DataCache/FifoCache so the real SHARED memory cache write path can use ghost-hit admission
  • update tests for memory-cache-only RSS eviction, fifocache ghost admission, and MemCache-level ghost admission

The meta cache still keeps its normal configured capacity and normal eviction. This change only removes meta cache from the RSS pressure eviction/admission path.

For data cache pressure, the old behavior rejected a write in MemCache.Update when used + newEntry > target. That controlled memory, but it also prevented the lower-level cache from recognizing ghost hits. The new behavior lets DataCache/FifoCache decide admission: cold entries are still rejected under pressure, while ghost-hit entries can evict cold data first and then be admitted while keeping usage near the target.

This PR intentionally does not include Step 3. RSS pressure state-machine changes, TTL removal, and RSS hysteresis should be handled in a separate PR because they affect pressure enter/exit semantics, eviction cadence, admission target lifetime, and OOM risk handling.

In the 2026-05-26 nightly regression run, sysbench_delete_pk_10_10000000 / vuser=1000 dropped from the previous baseline. During the affected window, RSS pressure reduced:

  • SHARED memory cache from about 11.66GiB to 9.60GiB
  • objectio meta cache from about 1.63GiB to 1.60GiB

The meta eviction saved only about 29MiB, but pressure admission later caused about 0.85M meta admission skips and a large number of repeated objectio/dedup load failures. For this workload, meta cache is small but high value, while SHARED data cache is the meaningful RSS elasticity source.

Testing:

  • GOCACHE=/private/tmp/mo-gocache-rss-meta go test ./pkg/fileservice/fifocache -run 'TestCachePressureAdmission|TestEvictToTargetWithWait' -count=1
  • GOCACHE=/private/tmp/mo-gocache-rss-meta go test ./pkg/fileservice -run 'TestMemoryCachePressureAdmission|TestMemoryCacheEvictToCapacityPercent' -count=1
  • GOCACHE=/private/tmp/mo-gocache-rss-meta go test ./pkg/cnservice -run TestMakeRSSCacheEvictorEvictsMemoryCacheOnly -count=1
  • GOCACHE=/private/tmp/mo-gocache-rss-meta go test ./pkg/vm/engine/disttae -run '^$' -count=0
  • git diff --check

Copilot AI review requested due to automatic review settings May 27, 2026 09:46
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes objectio meta cache from RSS pressure-driven forced eviction and admission-skip paths in both the CN service and the disttae workspace engine, addressing observed dedup load penetration during sysbench regression. RSS pressure now elastically targets only the fileservice memory (data) cache, while meta cache retains its normal capacity-based eviction.

Changes:

  • In makeRSSCacheEvictor (CN) and makeWorkspaceRSSCacheEvictor (disttae), stop calling objectio.SetMetaCachePressureTargetPercent / objectio.EvictCacheToCapacityPercent; drop the goroutine fan-out/sync.WaitGroup and the objectio import; only the memory cache is evicted.
  • Rename and trim the related CN test to TestMakeRSSCacheEvictorEvictsMemoryCacheOnly, removing the meta evictor stub.
  • Add docs/rfcs/rss-cache-pressure-optimization.md documenting the regression and the 3-step optimization plan.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/cnservice/server.go Strip meta cache pressure target + eviction from RSS evictor; remove objectio import and evictMetaCacheToCapacityPercent var.
pkg/cnservice/server_test.go Rename test; remove meta evictor stubbing and the meta-started assertion.
pkg/vm/engine/disttae/engine.go Same trimming in the workspace RSS evictor; remove objectio import.
docs/rfcs/rss-cache-pressure-optimization.md New RFC describing the regression context and 3-step plan.

@mergify mergify Bot added kind/enhancement kind/documentation Improvements or additions to documentation kind/test-ci labels May 27, 2026
@LeftHandCold
LeftHandCold force-pushed the fix/rss-pressure-data-cache-only-4dev branch from 68c1e59 to 3594605 Compare May 27, 2026 09:59
@LeftHandCold
LeftHandCold force-pushed the fix/rss-pressure-data-cache-only-4dev branch from 3594605 to 19b5de0 Compare May 27, 2026 10:06
@LeftHandCold
LeftHandCold requested a review from xzxiong as a code owner May 27, 2026 14:15
@CLAassistant

CLAassistant commented May 27, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ LeftHandCold
✅ XuPeng-SH
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

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/documentation Improvements or additions to documentation kind/enhancement kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants