{"action":"created","comment":{"url":"https://api.github.com/repos/ngaut/faketikv/pulls/comments/196292815","pull_request_review_id":129815732,"id":196292815,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjI5MjgxNQ==","diff_hunk":"@@ -58,20 +58,27 @@ func NewMVCCStore(db *badger.DB, dataDir string) *MVCCStore {\n \tif err != nil {\n \t\tlog.Fatal(err)\n \t}\n-\tstore.wg.Add(3)\n+\t// run all the workers\n \tgo store.writeDBWorker.run()\n \tgo store.writeLockWorker.run()\n-\trbGCWorker := rollbackGCWorker{store: store}\n-\tgo rbGCWorker.run()\n+\tgo func() {\n+\t\trbGCWorker := rollbackGCWorker{store: store}\n+\t\trbGCWorker.run()\n+\t}()\n+\n+\t// mark worker count\n+\tstore.wg.Add(3)\n+\n \treturn store\n }\n \n func (store *MVCCStore) Close() error {\n \tclose(store.closeCh)\n \tstore.wg.Wait()\n+\n \terr := store.dumpLockStore()\n \tif err != nil {\n-\t\tlog.Error(err)\n+\t\tlog.Fatal(err)","path":"tikv/mvcc.go","position":28,"original_position":28,"commit_id":"bf14957bf6041f34edf20ba696d0b7871db662be","original_commit_id":"bf14957bf6041f34edf20ba696d0b7871db662be","user":{"login":"coocood","id":891222,"node_id":"MDQ6VXNlcjg5MTIyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/891222?v=4","gravatar_id":"","url":"https://api.github.com/users/coocood","html_url":"https://github.com/coocood","followers_url":"https://api.github.com/users/coocood/followers","following_url":"https://api.github.com/users/coocood/following{/other_user}","gists_url":"https://api.github.com/users/coocood/gists{/gist_id}","starred_url":"https://api.github.com/users/coocood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coocood/subscriptions","organizations_url":"https://api.github.com/users/coocood/orgs","repos_url":"https://api.github.com/users/coocood/repos","events_url":"https://api.github.com/users/coocood/events{/privacy}","received_events_url":"https://api.github.com/users/coocood/received_events","type":"User","site_admin":false},"body":"We need to close the DB later.","created_at":"2018-06-19T04:40:45Z","updated_at":"2018-06-19T04:40:45Z","html_url":"https://github.com/ngaut/faketikv/pull/39#discussion_r196292815","pull_request_url":"https://api.github.com/repos/ngaut/faketikv/pulls/39","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ngaut/faketikv/pulls/comments/196292815"},"html":{"href":"https://github.com/ngaut/faketikv/pull/39#discussion_r196292815"},"pull_request":{"href":"https://api.github.com/repos/ngaut/faketikv/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/ngaut/faketikv/pulls/39","id":195708622,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NzA4NjIy","html_url":"https://github.com/ngaut/faketikv/pull/39","diff_url":"https://github.com/ngaut/faketikv/pull/39.diff","patch_url":"https://github.com/ngaut/faketikv/pull/39.patch","issue_url":"https://api.github.com/repos/ngaut/faketikv/issues/39","number":39,"state":"open","locked":false,"title":"Make code more clear","user":{"login":"ngaut","id":878009,"node_id":"MDQ6VXNlcjg3ODAwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/878009?v=4","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-19T04:25:42Z","updated_at":"2018-06-19T04:40:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0dc5f953dde8fc53ae7564c0a575b7e109b46690","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ngaut/faketikv/pulls/39/commits","review_comments_url":"https://api.github.com/repos/ngaut/faketikv/pulls/39/comments","review_comment_url":"https://api.github.com/repos/ngaut/faketikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ngaut/faketikv/issues/39/comments","statuses_url":"https://api.github.com/repos/ngaut/faketikv/statuses/bf14957bf6041f34edf20ba696d0b7871db662be","head":{"label":"ngaut:tiny-refactor","ref":"tiny-refactor","sha":"bf14957bf6041f34edf20ba696d0b7871db662be","user":{"login":"ngaut","id":878009,"node_id":"MDQ6VXNlcjg3ODAwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/878009?v=4","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"repo":{"id":130486705,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0ODY3MDU=","name":"faketikv","full_name":"ngaut/faketikv","owner":{"login":"ngaut","id":878009,"node_id":"MDQ6VXNlcjg3ODAwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/878009?v=4","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngaut/faketikv","description":"A fun project for evaluating some new optimizations quickly, do not use it","fork":false,"url":"https://api.github.com/repos/ngaut/faketikv","forks_url":"https://api.github.com/repos/ngaut/faketikv/forks","keys_url":"https://api.github.com/repos/ngaut/faketikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngaut/faketikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngaut/faketikv/teams","hooks_url":"https://api.github.com/repos/ngaut/faketikv/hooks","issue_events_url":"https://api.github.com/repos/ngaut/faketikv/issues/events{/number}","events_url":"https://api.github.com/repos/ngaut/faketikv/events","assignees_url":"https://api.github.com/repos/ngaut/faketikv/assignees{/user}","branches_url":"https://api.github.com/repos/ngaut/faketikv/branches{/branch}","tags_url":"https://api.github.com/repos/ngaut/faketikv/tags","blobs_url":"https://api.github.com/repos/ngaut/faketikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngaut/faketikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngaut/faketikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngaut/faketikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngaut/faketikv/statuses/{sha}","languages_url":"https://api.github.com/repos/ngaut/faketikv/languages","stargazers_url":"https://api.github.com/repos/ngaut/faketikv/stargazers","contributors_url":"https://api.github.com/repos/ngaut/faketikv/contributors","subscribers_url":"https://api.github.com/repos/ngaut/faketikv/subscribers","subscription_url":"https://api.github.com/repos/ngaut/faketikv/subscription","commits_url":"https://api.github.com/repos/ngaut/faketikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngaut/faketikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngaut/faketikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngaut/faketikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngaut/faketikv/contents/{+path}","compare_url":"https://api.github.com/repos/ngaut/faketikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngaut/faketikv/merges","archive_url":"https://api.github.com/repos/ngaut/faketikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngaut/faketikv/downloads","issues_url":"https://api.github.com/repos/ngaut/faketikv/issues{/number}","pulls_url":"https://api.github.com/repos/ngaut/faketikv/pulls{/number}","milestones_url":"https://api.github.com/repos/ngaut/faketikv/milestones{/number}","notifications_url":"https://api.github.com/repos/ngaut/faketikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngaut/faketikv/labels{/name}","releases_url":"https://api.github.com/repos/ngaut/faketikv/releases{/id}","deployments_url":"https://api.github.com/repos/ngaut/faketikv/deployments","created_at":"2018-04-21T15:28:12Z","updated_at":"2018-06-19T03:24:46Z","pushed_at":"2018-06-19T04:25:42Z","git_url":"git://github.com/ngaut/faketikv.git","ssh_url":"git@github.com:ngaut/faketikv.git","clone_url":"https://github.com/ngaut/faketikv.git","svn_url":"https://github.com/ngaut/faketikv","homepage":null,"size":122,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"ngaut:master","ref":"master","sha":"ffdb6aa48fc33d3bd66b4268d35ac2a8f91ec063","user":{"login":"ngaut","id":878009,"node_id":"MDQ6VXNlcjg3ODAwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/878009?v=4","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"repo":{"id":130486705,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0ODY3MDU=","name":"faketikv","full_name":"ngaut/faketikv","owner":{"login":"ngaut","id":878009,"node_id":"MDQ6VXNlcjg3ODAwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/878009?v=4","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngaut/faketikv","description":"A fun project for evaluating some new optimizations quickly, do not use it","fork":false,"url":"https://api.github.com/repos/ngaut/faketikv","forks_url":"https://api.github.com/repos/ngaut/faketikv/forks","keys_url":"https://api.github.com/repos/ngaut/faketikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngaut/faketikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngaut/faketikv/teams","hooks_url":"https://api.github.com/repos/ngaut/faketikv/hooks","issue_events_url":"https://api.github.com/repos/ngaut/faketikv/issues/events{/number}","events_url":"https://api.github.com/repos/ngaut/faketikv/events","assignees_url":"https://api.github.com/repos/ngaut/faketikv/assignees{/user}","branches_url":"https://api.github.com/repos/ngaut/faketikv/branches{/branch}","tags_url":"https://api.github.com/repos/ngaut/faketikv/tags","blobs_url":"https://api.github.com/repos/ngaut/faketikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngaut/faketikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngaut/faketikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngaut/faketikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngaut/faketikv/statuses/{sha}","languages_url":"https://api.github.com/repos/ngaut/faketikv/languages","stargazers_url":"https://api.github.com/repos/ngaut/faketikv/stargazers","contributors_url":"https://api.github.com/repos/ngaut/faketikv/contributors","subscribers_url":"https://api.github.com/repos/ngaut/faketikv/subscribers","subscription_url":"https://api.github.com/repos/ngaut/faketikv/subscription","commits_url":"https://api.github.com/repos/ngaut/faketikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngaut/faketikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngaut/faketikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngaut/faketikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngaut/faketikv/contents/{+path}","compare_url":"https://api.github.com/repos/ngaut/faketikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngaut/faketikv/merges","archive_url":"https://api.github.com/repos/ngaut/faketikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngaut/faketikv/downloads","issues_url":"https://api.github.com/repos/ngaut/faketikv/issues{/number}","pulls_url":"https://api.github.com/repos/ngaut/faketikv/pulls{/number}","milestones_url":"https://api.github.com/repos/ngaut/faketikv/milestones{/number}","notifications_url":"https://api.github.com/repos/ngaut/faketikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngaut/faketikv/labels{/name}","releases_url":"https://api.github.com/repos/ngaut/faketikv/releases{/id}","deployments_url":"https://api.github.com/repos/ngaut/faketikv/deployments","created_at":"2018-04-21T15:28:12Z","updated_at":"2018-06-19T03:24:46Z","pushed_at":"2018-06-19T04:25:42Z","git_url":"git://github.com/ngaut/faketikv.git","ssh_url":"git@github.com:ngaut/faketikv.git","clone_url":"https://github.com/ngaut/faketikv.git","svn_url":"https://github.com/ngaut/faketikv","homepage":null,"size":122,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ngaut/faketikv/pulls/39"},"html":{"href":"https://github.com/ngaut/faketikv/pull/39"},"issue":{"href":"https://api.github.com/repos/ngaut/faketikv/issues/39"},"comments":{"href":"https://api.github.com/repos/ngaut/faketikv/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/ngaut/faketikv/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/ngaut/faketikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ngaut/faketikv/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/ngaut/faketikv/statuses/bf14957bf6041f34edf20ba696d0b7871db662be"}},"author_association":"OWNER"}}
{"actor":{"display_login":"coocood"}}