Expand missing prefetch mitigation usage#1905
Open
tyrielv wants to merge 5 commits intomicrosoft:masterfrom
Open
Expand missing prefetch mitigation usage#1905tyrielv wants to merge 5 commits intomicrosoft:masterfrom
tyrielv wants to merge 5 commits intomicrosoft:masterfrom
Conversation
Currently, the mitigation to download commit packs when we encounter missing trees during git history traversal only applies if PrefetchHasBeenDone() is false. This means that if cache servers are not providing the full up-to-date commit graph we won't apply the mitigation. - Remove PrefetchHasBeenDone() check from ShouldDownloadCommitPack and UpdateTreesForDownloadedCommits so the commit pack download mitigation applies regardless of whether prefetch has been done, protecting against cases where prefetch pack cache servers are not up-to-date. - Add LruCache<TKey, TValue> to GVFS.Common - Replace Dictionary<string, string> treesWithDownloadedCommits in InProcessMount with LruCache capped at 4000 (10 times the threshold per commit pack) entries to prevent unbounded growth since we are no longer limiting to only the period before first prefetch
Contributor
Author
|
Thought: A dedicated class for handling this caching could pull more of the logic into it than the LruCache currently has. The LruCache is using LRU on the tree level, but it would make more sense for it to be on the commit level. |
Contributor
Author
I implemented this. |
73581bf to
a90175f
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.
Currently, the mitigation to download commit packs when we encounter missing trees during git operations only applies if PrefetchHasBeenDone() is false.
This means that if cache servers are not providing the full up-to-date commit graph we won't apply the mitigation.