feat: support cache file manually eviction by filename for full file cache#1137
Merged
lihuiba merged 3 commits intoalibaba:release/0.9from Mar 4, 2026
Merged
feat: support cache file manually eviction by filename for full file cache#1137lihuiba merged 3 commits intoalibaba:release/0.9from
lihuiba merged 3 commits intoalibaba:release/0.9from
Conversation
lihuiba
reviewed
Mar 3, 2026
| } | ||
| if (err) { | ||
| ERRNO e; | ||
| LOG_ERROR("truncate(0) failed, name: `, ret: `, error code: `", filePath, |
Collaborator
There was a problem hiding this comment.
simply
LOG_ERRNO_RETURN("truncate(0) failed, name: ", filePath);(note its ERRNO, not ERROR)
and it will output errno and error message as well.
Contributor
Author
There was a problem hiding this comment.
Just output the error log here, no need to return.
|
|
||
| if (err) { | ||
| ERRNO e; | ||
| LOG_ERROR("truncate(0) failed, name : `, ret : `, error code : `", fileName, err, e); |
Contributor
Author
There was a problem hiding this comment.
no need to return.
| return false; | ||
| if (err) { | ||
| ERRNO e; | ||
| LOG_ERROR("unlink failed, name : `, ret : `, error code : `", iter->first, err, e); |
Contributor
Author
There was a problem hiding this comment.
no need to return.
EricHuangqx
approved these changes
Mar 3, 2026
photonlibos
pushed a commit
that referenced
this pull request
Mar 4, 2026
…cache (#1137) * feat: support file eviction by filename
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.
What does this PR do?
This PR adds support for evicting specific cache files by filename through the
evict(std::string_view filename)API.This feature allows users to manually evict specific cached files without waiting for the automatic LRU eviction, providing better control over cache management.
Key Changes
fs/cache/full_file_cache/cache_pool.cppevict(std::string_view filename)method to evict a specific cache file by its pathafterFtrucate()to clean up and optionally unlink the filefs/cache/test/cache_test.cpp