{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments/245046042","pull_request_review_id":189071658,"id":245046042,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTA0NjA0Mg==","diff_hunk":"@@ -27,6 +27,20 @@ protected override void PerformMaintenance()\n                 this.Context.FileSystem.TryDeleteFile(multiPackIndexLockPath);\r\n \r\n                 this.RunGitCommand((process) => process.WriteMultiPackIndex(this.Context.Enlistment.GitObjectsRoot));\r\n+\r\n+                GitProcess.Result verifyResult = this.RunGitCommand((process) => process.VerifyMultiPackIndex(this.Context.Enlistment.GitObjectsRoot));\r\n+\r\n+                if (verifyResult.ExitCodeIsFailure)\r\n+                {\r\n+                    EventMetadata metadata = this.CreateEventMetadata();\r\n+                    metadata[\"MultiPackIndexVerifyOutput\"] = verifyResult.Output;\r\n+                    metadata[\"MultiPackIndexVerifyErrors\"] = verifyResult.Errors;\r\n+                    string multiPackIndexPath = Path.Combine(this.Context.Enlistment.GitPackRoot, \"multi-pack-index\");\r\n+                    metadata[\"TryDeleteFileResult\"] = this.Context.FileSystem.TryDeleteFile(multiPackIndexPath);\r\n+                    activity.RelatedError(metadata, \"multi-pack-index is corrupt after write. Deleting and rewriting.\");\r\n+\r\n+                    this.RunGitCommand((process) => process.WriteMultiPackIndex(this.Context.Enlistment.GitObjectsRoot));\r","path":"GVFS/GVFS.Common/Maintenance/PostFetchStep.cs","position":27,"original_position":27,"commit_id":"0772173195646adc542afac05e11de21d486003d","original_commit_id":"0772173195646adc542afac05e11de21d486003d","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},"body":"The examples we've seen all have the problem that the multi-pack-index or commit-graph files were corrupted, and the problem persisted only because we continued to trust that data when we write a new one. Deleting the file and rewriting (based on the .pack and .idx files) has always fixed the issue.\r\n\r\nIf the rewrite did not fix the issue, then we would see failures from the same enlistment multiple times in a row. I plan to set alerts for any user hitting this even once, so we would be ready to intervene if this happens repeatedly.","created_at":"2019-01-03T16:01:14Z","updated_at":"2019-01-03T16:01:15Z","html_url":"https://github.com/Microsoft/VFSForGit/pull/658#discussion_r245046042","pull_request_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments/245046042"},"html":{"href":"https://github.com/Microsoft/VFSForGit/pull/658#discussion_r245046042"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658"}},"in_reply_to_id":245029169},"pull_request":{"url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658","id":241845506,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxODQ1NTA2","html_url":"https://github.com/Microsoft/VFSForGit/pull/658","diff_url":"https://github.com/Microsoft/VFSForGit/pull/658.diff","patch_url":"https://github.com/Microsoft/VFSForGit/pull/658.patch","issue_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/658","number":658,"state":"open","locked":false,"title":"[RFC] Verify commit-graph and multi-pack-index after writing","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},"body":"Run the `git commit-graph verify` and `git multi-pack-index verify` commands after any command that would change those files. If these fail, then delete the corrupt file and rewrite.\r\n\r\nWe've had issues with users data in the past, and this gives us a way to automatically detect and repair these scenarios. The immediate rewrite _should_ work since we will regenerate from the other Git data. Issues we've seen in the past are related to trusting the content in these files and carrying that data forward to future versions of the file.\r\n\r\n_This PR is labeled as [RFC] so I can get opinions on whether this is a good idea or not._","created_at":"2019-01-02T20:55:42Z","updated_at":"2019-01-03T16:01:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"599a365afa00d2681c28ed9ba1d79e6564da8e40","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658/commits","review_comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658/comments","review_comment_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/658/comments","statuses_url":"https://api.github.com/repos/Microsoft/VFSForGit/statuses/0772173195646adc542afac05e11de21d486003d","head":{"label":"derrickstolee:verify-maintenance","ref":"verify-maintenance","sha":"0772173195646adc542afac05e11de21d486003d","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},"repo":{"id":144722858,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ3MjI4NTg=","name":"VFSForGit","full_name":"derrickstolee/VFSForGit","private":false,"owner":{"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},"html_url":"https://github.com/derrickstolee/VFSForGit","description":"Virtual File System for Git: Enable Git at Enterprise Scale","fork":true,"url":"https://api.github.com/repos/derrickstolee/VFSForGit","forks_url":"https://api.github.com/repos/derrickstolee/VFSForGit/forks","keys_url":"https://api.github.com/repos/derrickstolee/VFSForGit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/derrickstolee/VFSForGit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/derrickstolee/VFSForGit/teams","hooks_url":"https://api.github.com/repos/derrickstolee/VFSForGit/hooks","issue_events_url":"https://api.github.com/repos/derrickstolee/VFSForGit/issues/events{/number}","events_url":"https://api.github.com/repos/derrickstolee/VFSForGit/events","assignees_url":"https://api.github.com/repos/derrickstolee/VFSForGit/assignees{/user}","branches_url":"https://api.github.com/repos/derrickstolee/VFSForGit/branches{/branch}","tags_url":"https://api.github.com/repos/derrickstolee/VFSForGit/tags","blobs_url":"https://api.github.com/repos/derrickstolee/VFSForGit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/derrickstolee/VFSForGit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/derrickstolee/VFSForGit/git/refs{/sha}","trees_url":"https://api.github.com/repos/derrickstolee/VFSForGit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/derrickstolee/VFSForGit/statuses/{sha}","languages_url":"https://api.github.com/repos/derrickstolee/VFSForGit/languages","stargazers_url":"https://api.github.com/repos/derrickstolee/VFSForGit/stargazers","contributors_url":"https://api.github.com/repos/derrickstolee/VFSForGit/contributors","subscribers_url":"https://api.github.com/repos/derrickstolee/VFSForGit/subscribers","subscription_url":"https://api.github.com/repos/derrickstolee/VFSForGit/subscription","commits_url":"https://api.github.com/repos/derrickstolee/VFSForGit/commits{/sha}","git_commits_url":"https://api.github.com/repos/derrickstolee/VFSForGit/git/commits{/sha}","comments_url":"https://api.github.com/repos/derrickstolee/VFSForGit/comments{/number}","issue_comment_url":"https://api.github.com/repos/derrickstolee/VFSForGit/issues/comments{/number}","contents_url":"https://api.github.com/repos/derrickstolee/VFSForGit/contents/{+path}","compare_url":"https://api.github.com/repos/derrickstolee/VFSForGit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/derrickstolee/VFSForGit/merges","archive_url":"https://api.github.com/repos/derrickstolee/VFSForGit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/derrickstolee/VFSForGit/downloads","issues_url":"https://api.github.com/repos/derrickstolee/VFSForGit/issues{/number}","pulls_url":"https://api.github.com/repos/derrickstolee/VFSForGit/pulls{/number}","milestones_url":"https://api.github.com/repos/derrickstolee/VFSForGit/milestones{/number}","notifications_url":"https://api.github.com/repos/derrickstolee/VFSForGit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/derrickstolee/VFSForGit/labels{/name}","releases_url":"https://api.github.com/repos/derrickstolee/VFSForGit/releases{/id}","deployments_url":"https://api.github.com/repos/derrickstolee/VFSForGit/deployments","created_at":"2018-08-14T13:18:49Z","updated_at":"2018-08-14T13:18:53Z","pushed_at":"2019-01-03T14:23:05Z","git_url":"git://github.com/derrickstolee/VFSForGit.git","ssh_url":"git@github.com:derrickstolee/VFSForGit.git","clone_url":"https://github.com/derrickstolee/VFSForGit.git","svn_url":"https://github.com/derrickstolee/VFSForGit","homepage":"https://gvfs.io/","size":4085,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"a4c9c8363258723cde198218e583fcd9765c26b7","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":80058269,"node_id":"MDEwOlJlcG9zaXRvcnk4MDA1ODI2OQ==","name":"VFSForGit","full_name":"Microsoft/VFSForGit","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/VFSForGit","description":"Virtual File System for Git: Enable Git at Enterprise Scale","fork":false,"url":"https://api.github.com/repos/Microsoft/VFSForGit","forks_url":"https://api.github.com/repos/Microsoft/VFSForGit/forks","keys_url":"https://api.github.com/repos/Microsoft/VFSForGit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/VFSForGit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/VFSForGit/teams","hooks_url":"https://api.github.com/repos/Microsoft/VFSForGit/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/VFSForGit/events","assignees_url":"https://api.github.com/repos/Microsoft/VFSForGit/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/VFSForGit/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/VFSForGit/tags","blobs_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/VFSForGit/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/VFSForGit/languages","stargazers_url":"https://api.github.com/repos/Microsoft/VFSForGit/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/VFSForGit/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/VFSForGit/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/VFSForGit/subscription","commits_url":"https://api.github.com/repos/Microsoft/VFSForGit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/VFSForGit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/VFSForGit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/VFSForGit/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/VFSForGit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/VFSForGit/merges","archive_url":"https://api.github.com/repos/Microsoft/VFSForGit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/VFSForGit/downloads","issues_url":"https://api.github.com/repos/Microsoft/VFSForGit/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/VFSForGit/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/VFSForGit/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/VFSForGit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/VFSForGit/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/VFSForGit/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/VFSForGit/deployments","created_at":"2017-01-25T21:10:29Z","updated_at":"2019-01-03T14:12:09Z","pushed_at":"2019-01-03T15:59:58Z","git_url":"git://github.com/Microsoft/VFSForGit.git","ssh_url":"git@github.com:Microsoft/VFSForGit.git","clone_url":"https://github.com/Microsoft/VFSForGit.git","svn_url":"https://github.com/Microsoft/VFSForGit","homepage":"https://vfsforgit.org/","size":4117,"stargazers_count":4454,"watchers_count":4454,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":305,"mirror_url":null,"archived":false,"open_issues_count":156,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":305,"open_issues":156,"watchers":4454,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658"},"html":{"href":"https://github.com/Microsoft/VFSForGit/pull/658"},"issue":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/issues/658"},"comments":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/issues/658/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/pulls/658/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/VFSForGit/statuses/0772173195646adc542afac05e11de21d486003d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"derrickstolee"}}