{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/306","repository_url":"https://api.github.com/repos/Microsoft/VFSForGit","labels_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/306/comments","events_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/306/events","html_url":"https://github.com/Microsoft/VFSForGit/issues/306","id":364106364,"node_id":"MDU6SXNzdWUzNjQxMDYzNjQ=","number":306,"title":"`gvfs clone` may fail due to prefetch packfile \"gaps\"","user":{"login":"derrickstolee","id":570044,"node_id":"MDQ6VXNlcjU3MDA0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/570044?v=4","gravatar_id":"","url":"https://api.github.com/users/derrickstolee","html_url":"https://github.com/derrickstolee","followers_url":"https://api.github.com/users/derrickstolee/followers","following_url":"https://api.github.com/users/derrickstolee/following{/other_user}","gists_url":"https://api.github.com/users/derrickstolee/gists{/gist_id}","starred_url":"https://api.github.com/users/derrickstolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrickstolee/subscriptions","organizations_url":"https://api.github.com/users/derrickstolee/orgs","repos_url":"https://api.github.com/users/derrickstolee/repos","events_url":"https://api.github.com/users/derrickstolee/events{/privacy}","received_events_url":"https://api.github.com/users/derrickstolee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-26T16:08:11Z","updated_at":"2018-09-26T16:36:30Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The prefetch packfiles use timestamps to signal \"this is what the cache server knew about at this time\". When a client prefetches, they contact _a_ cache server with their latest timestamp and the server responds with a list of packfiles. As we call different cache servers, we can get into a state where there are \"gaps\": some commits and trees never exist in a prefetch pack.\r\n\r\nIn a normal enlistment, these gaps can be refilled on-demand. However, at clone time we may be directed to an existing shared object cache, see that the cache has the commit and root tree that we expect, but be missing a tree that is reachable from that root tree. As we attempt to run a `git checkout`, we will fail to find that object and we don't have the read-object hook available.\r\n\r\nThis is a very odd data shape that has always been possible, but it is more likely to be hit now that we have background prefetch (we are more likely to satisfy `CommitAndRootTreeExists()` for the latest ref).\r\n\r\nOne fix is to run `git rev-list --objects <root-tree-hash>` instead of just checking if the objects exist. If that command succeeds, then we can continue without downloading the initial packfile. This will take less time than the `git checkout` step, so may be reasonable.\r\n\r\nAnother fix is to always download that initial packfile. This is likely not the best solution because we rarely _need_ that data a second time, and we would be slowing down clones that are usually \"trivial\"."},"comment":{"url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/comments/424785258","html_url":"https://github.com/Microsoft/VFSForGit/issues/306#issuecomment-424785258","issue_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/306","id":424785258,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDc4NTI1OA==","user":{"login":"sanoursa","id":8729434,"node_id":"MDQ6VXNlcjg3Mjk0MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/8729434?v=4","gravatar_id":"","url":"https://api.github.com/users/sanoursa","html_url":"https://github.com/sanoursa","followers_url":"https://api.github.com/users/sanoursa/followers","following_url":"https://api.github.com/users/sanoursa/following{/other_user}","gists_url":"https://api.github.com/users/sanoursa/gists{/gist_id}","starred_url":"https://api.github.com/users/sanoursa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanoursa/subscriptions","organizations_url":"https://api.github.com/users/sanoursa/orgs","repos_url":"https://api.github.com/users/sanoursa/repos","events_url":"https://api.github.com/users/sanoursa/events{/privacy}","received_events_url":"https://api.github.com/users/sanoursa/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T16:36:30Z","updated_at":"2018-09-26T16:36:30Z","author_association":"CONTRIBUTOR","body":"My point is, the issue is not with prefetch. Prefetch contains full trees, so background prefetch is not at fault here. The root cause is that an existing repo could touch just the root tree object, not download the full set of trees, and then a subsequent clone attempt will fail in this manner."}}
{"actor":{"display_login":"sanoursa"}}