Remove file field from CacheFileReference#51520
Merged
DaveCTurner merged 1 commit intoelastic:feature/searchable-snapshotsfrom Jan 28, 2020
Merged
Conversation
`CacheFileReference#file` is a path to a file that doesn't exist, for use as a cache key, but whose parent directory is the location of the actual cache file. This commit replaces it with the path to the cache directory itself, and computes the cache key when it is needed.
Collaborator
|
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
tlrx
approved these changes
Jan 28, 2020
Member
tlrx
left a comment
There was a problem hiding this comment.
LGTM, thanks for taking care of this.
tlrx
added a commit
that referenced
this pull request
Jan 31, 2020
Today cache files are identified in cache using a string representing an absolute path to a file on disk. This path is a sub directory of the current shard data path and as such already contains identification bits like the current index id and the shard id. It also contains the snapshot id that is passed at CacheDirectory creation time. While this has been done for quick prototyping and already been improved in #51520, it feels wrong to rely on a path converted to a string as cache keys. Instead we should have a distinct CacheKey object to identify CacheFile in cache. Relates #50693
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.
CacheFileReference#fileis a path to a file that doesn't exist, for use as acache key, but whose parent directory is the location of the actual cache file.
This commit replaces it with the path to the cache directory itself, and
computes the cache key when it is needed.
Relates #50693.