-
Notifications
You must be signed in to change notification settings - Fork 461
Download all trees for non-prefetched commits when root tree is downloaded #1848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
derrickstolee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting heuristic.
This will have a change not only for that one-time setup where the prefetch is happening in the background (via #1849) but also for any time that a user checks out a recently-updated remote branch but the cache server prefetch packfiles have not included them yet.
This will also affect any time that a user runs file history before a prefetch is complete, leading to many overlapping packfile downloads full of trees where most are shared.
I'm concerned enough about these long-term behavior changes that I don't want to sign off on this right away. The code does what is advertised, but I'm concerned about these longer-term issues.
Very good point - I didn't think about how it takes time for recent updates to make it to the prefetch packfiles.
I intentional wanted to include history operations (I considered putting this in checkout hook instead of get-object hook), but that's a very good point about the level of duplication between them. I'm going to do some more analysis of my problem scenarios and modify this proposal. |
- limit to once per 5 minutes - disable if any prefetch of commit graph has already succeeded
|
@tyrielv would you mind upgrading the GitHub workflows to use |
I've started taking a look (see #1851), but it seems neither |
This pull request will help mitigate the slower performance of prefetching the commit graph by improving the experience of common operations if run before the initial prefetch has completed - for example,
git checkoutorgit log.Changes:
TryGitIsBlobreplaced withTryGetObjectTypeso that we can distinguish trees and commits separately with the same number of loads.CommitAndTreeRootExistsadded an out parameter to make the tree root id available to caller so it doesn't have to be loaded again.InProcessMountwill track when a commit has been requested by the git read-object hook, and if the tree for the commit is also requested then it will use the batch API to download all the trees for the commit at once instead of waiting for individual tree requests to come from git.