Skip to content

Add RAM cache promotion path from last_open_read hit#13061

Draft
masaori335 wants to merge 2 commits intoapache:masterfrom
masaori335:asf-master-fix-mem-cache-1
Draft

Add RAM cache promotion path from last_open_read hit#13061
masaori335 wants to merge 2 commits intoapache:masterfrom
masaori335:asf-master-fix-mem-cache-1

Conversation

@masaori335
Copy link
Copy Markdown
Contributor

Depends on #13060 cleanup change. This PR is going to be rebased when it's merged. Please look at the last commit.


Summary

Prior to this change, when a cache object was served via the last_open_read hit path in CacheVC::handleRead, it was never promoted to the RAM cache. Only objects going through handleReadDone (disk reads) were eligible for RAM cache promotion. This meant that frequently-accessed objects could be repeatedly fetched from disk even when they should have been promoted to RAM cache.

This change adds a RAM cache put call in the last_open_read hit path, using the same _ram_cache_cutoff_check logic that governs promotion in handleReadDone. The cutoff check helper was extracted in a prior cleanup commit to enable this reuse.

Changes:

  • Extract _ram_cache_cutoff_check() as a private method on CacheVC
  • In CacheVC::handleRead, after a last_open_read RAM hit, call stripe->ram_cache->put() if the object passes the cutoff check, with http_copy_hdr derived from handleReadDone behavior.

@masaori335 masaori335 added this to the 11.0.0 milestone Apr 6, 2026
@masaori335 masaori335 requested review from moonchen and zwoop April 6, 2026 02:49
@masaori335 masaori335 self-assigned this Apr 6, 2026
@masaori335 masaori335 force-pushed the asf-master-fix-mem-cache-1 branch from ca2e620 to 7f35854 Compare April 6, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant