Add RAM cache promotion path from last_open_read hit#13061
Draft
masaori335 wants to merge 2 commits intoapache:masterfrom
Draft
Add RAM cache promotion path from last_open_read hit#13061masaori335 wants to merge 2 commits intoapache:masterfrom
masaori335 wants to merge 2 commits intoapache:masterfrom
Conversation
ca2e620 to
7f35854
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 throughhandleReadDone(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:
CacheVC::handleRead, after a last_open_read RAM hit, callstripe->ram_cache->put()if the object passes the cutoff check, withhttp_copy_hdrderived from handleReadDone behavior.