Donot override cache atime when scanning from local disk #5692
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.
Scanning from disk overwrites
size
andatime
of existing cache items in memory:size
is overwritten by the physical size of the file, which includes the logical size plus the CRC footer. However, when adding cache in other places, we use the logical size. I suppose it's better to be consistent on which size to use.The granularity of file system's
atime
is relatively coarse (relatime), and some even have atime disabled (noatime). However,atime
recorded in memory has finer granularity and is more accurate in most cases. Overwritingatime
in memory blindly would cause the expire eviction strategy not working as expected.