{"action":"created","comment":{"url":"https://api.github.com/repos/tikv/tikv/pulls/comments/225017147","pull_request_review_id":164523818,"id":225017147,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTAxNzE0Nw==","diff_hunk":"@@ -467,6 +468,17 @@ impl<T: Transport, C: PdClient> Store<T, C> {\n             warn!(\"set thread priority for raftstore failed, error: {:?}\", e);\n         }\n \n+        {\n+            // entry_gc thread\n+            let (tx, rx) = mpsc::channel();\n+            self.entry_gc_sender = Some(tx);\n+            thread::spawn(move || loop {\n+                if rx.recv().is_err() {","path":"src/raftstore/store/fsm/store.rs","position":19,"original_position":17,"commit_id":"b35e35b7e960ac937da6896d780cfd31340c9773","original_commit_id":"4d8ad6a9816993cd8c015941be5d173af7b0d154","user":{"login":"solotzg","id":9016847,"node_id":"MDQ6VXNlcjkwMTY4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/9016847?v=4","gravatar_id":"","url":"https://api.github.com/users/solotzg","html_url":"https://github.com/solotzg","followers_url":"https://api.github.com/users/solotzg/followers","following_url":"https://api.github.com/users/solotzg/following{/other_user}","gists_url":"https://api.github.com/users/solotzg/gists{/gist_id}","starred_url":"https://api.github.com/users/solotzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solotzg/subscriptions","organizations_url":"https://api.github.com/users/solotzg/orgs","repos_url":"https://api.github.com/users/solotzg/repos","events_url":"https://api.github.com/users/solotzg/events{/privacy}","received_events_url":"https://api.github.com/users/solotzg/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-10-15T00:40:33Z","updated_at":"2018-10-15T00:40:33Z","html_url":"https://github.com/tikv/tikv/pull/3671#discussion_r225017147","pull_request_url":"https://api.github.com/repos/tikv/tikv/pulls/3671","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/tikv/tikv/pulls/comments/225017147"},"html":{"href":"https://github.com/tikv/tikv/pull/3671#discussion_r225017147"},"pull_request":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3671"}},"in_reply_to_id":224998474},"pull_request":{"url":"https://api.github.com/repos/tikv/tikv/pulls/3671","id":222659690,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNjU5Njkw","html_url":"https://github.com/tikv/tikv/pull/3671","diff_url":"https://github.com/tikv/tikv/pull/3671.diff","patch_url":"https://github.com/tikv/tikv/pull/3671.patch","issue_url":"https://api.github.com/repos/tikv/tikv/issues/3671","number":3671,"state":"open","locked":false,"title":"Optimize time cost of on_raft_gc_log_tick;","user":{"login":"solotzg","id":9016847,"node_id":"MDQ6VXNlcjkwMTY4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/9016847?v=4","gravatar_id":"","url":"https://api.github.com/users/solotzg","html_url":"https://github.com/solotzg","followers_url":"https://api.github.com/users/solotzg/followers","following_url":"https://api.github.com/users/solotzg/following{/other_user}","gists_url":"https://api.github.com/users/solotzg/gists{/gist_id}","starred_url":"https://api.github.com/users/solotzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solotzg/subscriptions","organizations_url":"https://api.github.com/users/solotzg/orgs","repos_url":"https://api.github.com/users/solotzg/repos","events_url":"https://api.github.com/users/solotzg/events{/privacy}","received_events_url":"https://api.github.com/users/solotzg/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for contributing to TiKV! Please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\n\r\n## What have you changed? (mandatory)\r\n\r\nPlease explain **IN DETAIL** what the changes are in this PR and why they are needed:\r\n- Optimize time cost of on_raft_gc_log_tick by using another thread to reclaim memory of Entry.\r\n- 0.99 histogram_quantile of `tikv_raftstore_event_duration_bucket` reduces from maximum 64ms to 25.5ms.\r\n- AVG of `tikv_raftstore_event_duration` reduces from maximum 21.8ms to 11.5ms.\r\n- May bring more memory fragmentation.\r\n\r\n## What are the type of the changes? (mandatory)\r\n\r\nThe currently defined types are listed below, please pick one of the types for this PR by removing the others:\r\n- Improvement\r\n\r\n## How has this PR been tested? (mandatory)\r\n- stress test\r\n- detail in [pingcap-jira-TIKV-1611](https://internal.pingcap.net/jira/browse/TIKV-1611) \r\n\r\n## Does this PR affect documentation (docs/docs-cn) update? (mandatory)\r\n\r\n## Does this PR affect tidb-ansible update? (mandatory)\r\n\r\n## Refer to a related PR or issue link (optional)\r\n- Based on [PR 3657](https://github.com/tikv/tikv/pull/3657)\r\n\r\n## Benchmark result if necessary (optional)\r\n\r\n## Add a few positive/negative examples (optional)\r\n\r\n","created_at":"2018-10-13T16:17:30Z","updated_at":"2018-10-15T00:40:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1566706bcd01d288f546a3cf382e7edeeddceab","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":429262718,"node_id":"MDU6TGFiZWw0MjkyNjI3MTg=","url":"https://api.github.com/repos/tikv/tikv/labels/C:%20Raft","name":"C: Raft","color":"d1fad7","default":false},{"id":305526947,"node_id":"MDU6TGFiZWwzMDU1MjY5NDc=","url":"https://api.github.com/repos/tikv/tikv/labels/T:%20Enhancement","name":"T: Enhancement","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tikv/tikv/pulls/3671/commits","review_comments_url":"https://api.github.com/repos/tikv/tikv/pulls/3671/comments","review_comment_url":"https://api.github.com/repos/tikv/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tikv/tikv/issues/3671/comments","statuses_url":"https://api.github.com/repos/tikv/tikv/statuses/b35e35b7e960ac937da6896d780cfd31340c9773","head":{"label":"solotzg:_entry_gc","ref":"_entry_gc","sha":"b35e35b7e960ac937da6896d780cfd31340c9773","user":{"login":"solotzg","id":9016847,"node_id":"MDQ6VXNlcjkwMTY4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/9016847?v=4","gravatar_id":"","url":"https://api.github.com/users/solotzg","html_url":"https://github.com/solotzg","followers_url":"https://api.github.com/users/solotzg/followers","following_url":"https://api.github.com/users/solotzg/following{/other_user}","gists_url":"https://api.github.com/users/solotzg/gists{/gist_id}","starred_url":"https://api.github.com/users/solotzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solotzg/subscriptions","organizations_url":"https://api.github.com/users/solotzg/orgs","repos_url":"https://api.github.com/users/solotzg/repos","events_url":"https://api.github.com/users/solotzg/events{/privacy}","received_events_url":"https://api.github.com/users/solotzg/received_events","type":"User","site_admin":false},"repo":{"id":152034043,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIwMzQwNDM=","name":"tikv","full_name":"solotzg/tikv","private":false,"owner":{"login":"solotzg","id":9016847,"node_id":"MDQ6VXNlcjkwMTY4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/9016847?v=4","gravatar_id":"","url":"https://api.github.com/users/solotzg","html_url":"https://github.com/solotzg","followers_url":"https://api.github.com/users/solotzg/followers","following_url":"https://api.github.com/users/solotzg/following{/other_user}","gists_url":"https://api.github.com/users/solotzg/gists{/gist_id}","starred_url":"https://api.github.com/users/solotzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solotzg/subscriptions","organizations_url":"https://api.github.com/users/solotzg/orgs","repos_url":"https://api.github.com/users/solotzg/repos","events_url":"https://api.github.com/users/solotzg/events{/privacy}","received_events_url":"https://api.github.com/users/solotzg/received_events","type":"User","site_admin":false},"html_url":"https://github.com/solotzg/tikv","description":"Distributed transactional key-value database, originally created to complement TiDB","fork":true,"url":"https://api.github.com/repos/solotzg/tikv","forks_url":"https://api.github.com/repos/solotzg/tikv/forks","keys_url":"https://api.github.com/repos/solotzg/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solotzg/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solotzg/tikv/teams","hooks_url":"https://api.github.com/repos/solotzg/tikv/hooks","issue_events_url":"https://api.github.com/repos/solotzg/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/solotzg/tikv/events","assignees_url":"https://api.github.com/repos/solotzg/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/solotzg/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/solotzg/tikv/tags","blobs_url":"https://api.github.com/repos/solotzg/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solotzg/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solotzg/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/solotzg/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solotzg/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/solotzg/tikv/languages","stargazers_url":"https://api.github.com/repos/solotzg/tikv/stargazers","contributors_url":"https://api.github.com/repos/solotzg/tikv/contributors","subscribers_url":"https://api.github.com/repos/solotzg/tikv/subscribers","subscription_url":"https://api.github.com/repos/solotzg/tikv/subscription","commits_url":"https://api.github.com/repos/solotzg/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/solotzg/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/solotzg/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/solotzg/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/solotzg/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/solotzg/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solotzg/tikv/merges","archive_url":"https://api.github.com/repos/solotzg/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solotzg/tikv/downloads","issues_url":"https://api.github.com/repos/solotzg/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/solotzg/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/solotzg/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/solotzg/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solotzg/tikv/labels{/name}","releases_url":"https://api.github.com/repos/solotzg/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/solotzg/tikv/deployments","created_at":"2018-10-08T07:09:17Z","updated_at":"2018-10-13T11:19:20Z","pushed_at":"2018-10-15T00:39:47Z","git_url":"git://github.com/solotzg/tikv.git","ssh_url":"git@github.com:solotzg/tikv.git","clone_url":"https://github.com/solotzg/tikv.git","svn_url":"https://github.com/solotzg/tikv","homepage":"https://tikv.org","size":16958,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tikv:master","ref":"master","sha":"8b649eba7388fb878301b5ae92062c1c90f7d4aa","user":{"login":"tikv","id":41004122,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDA0MTIy","avatar_url":"https://avatars2.githubusercontent.com/u/41004122?v=4","gravatar_id":"","url":"https://api.github.com/users/tikv","html_url":"https://github.com/tikv","followers_url":"https://api.github.com/users/tikv/followers","following_url":"https://api.github.com/users/tikv/following{/other_user}","gists_url":"https://api.github.com/users/tikv/gists{/gist_id}","starred_url":"https://api.github.com/users/tikv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tikv/subscriptions","organizations_url":"https://api.github.com/users/tikv/orgs","repos_url":"https://api.github.com/users/tikv/repos","events_url":"https://api.github.com/users/tikv/events{/privacy}","received_events_url":"https://api.github.com/users/tikv/received_events","type":"Organization","site_admin":false},"repo":{"id":48833910,"node_id":"MDEwOlJlcG9zaXRvcnk0ODgzMzkxMA==","name":"tikv","full_name":"tikv/tikv","private":false,"owner":{"login":"tikv","id":41004122,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDA0MTIy","avatar_url":"https://avatars2.githubusercontent.com/u/41004122?v=4","gravatar_id":"","url":"https://api.github.com/users/tikv","html_url":"https://github.com/tikv","followers_url":"https://api.github.com/users/tikv/followers","following_url":"https://api.github.com/users/tikv/following{/other_user}","gists_url":"https://api.github.com/users/tikv/gists{/gist_id}","starred_url":"https://api.github.com/users/tikv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tikv/subscriptions","organizations_url":"https://api.github.com/users/tikv/orgs","repos_url":"https://api.github.com/users/tikv/repos","events_url":"https://api.github.com/users/tikv/events{/privacy}","received_events_url":"https://api.github.com/users/tikv/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tikv/tikv","description":"Distributed transactional key-value database, originally created to complement TiDB","fork":false,"url":"https://api.github.com/repos/tikv/tikv","forks_url":"https://api.github.com/repos/tikv/tikv/forks","keys_url":"https://api.github.com/repos/tikv/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tikv/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tikv/tikv/teams","hooks_url":"https://api.github.com/repos/tikv/tikv/hooks","issue_events_url":"https://api.github.com/repos/tikv/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/tikv/tikv/events","assignees_url":"https://api.github.com/repos/tikv/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/tikv/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/tikv/tikv/tags","blobs_url":"https://api.github.com/repos/tikv/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tikv/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tikv/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/tikv/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tikv/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/tikv/tikv/languages","stargazers_url":"https://api.github.com/repos/tikv/tikv/stargazers","contributors_url":"https://api.github.com/repos/tikv/tikv/contributors","subscribers_url":"https://api.github.com/repos/tikv/tikv/subscribers","subscription_url":"https://api.github.com/repos/tikv/tikv/subscription","commits_url":"https://api.github.com/repos/tikv/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/tikv/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/tikv/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/tikv/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/tikv/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/tikv/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tikv/tikv/merges","archive_url":"https://api.github.com/repos/tikv/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tikv/tikv/downloads","issues_url":"https://api.github.com/repos/tikv/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/tikv/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/tikv/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/tikv/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tikv/tikv/labels{/name}","releases_url":"https://api.github.com/repos/tikv/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/tikv/tikv/deployments","created_at":"2015-12-31T04:51:32Z","updated_at":"2018-10-14T18:06:02Z","pushed_at":"2018-10-15T00:39:49Z","git_url":"git://github.com/tikv/tikv.git","ssh_url":"git@github.com:tikv/tikv.git","clone_url":"https://github.com/tikv/tikv.git","svn_url":"https://github.com/tikv/tikv","homepage":"https://tikv.org","size":16937,"stargazers_count":3799,"watchers_count":3799,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":528,"mirror_url":null,"archived":false,"open_issues_count":261,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":528,"open_issues":261,"watchers":3799,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3671"},"html":{"href":"https://github.com/tikv/tikv/pull/3671"},"issue":{"href":"https://api.github.com/repos/tikv/tikv/issues/3671"},"comments":{"href":"https://api.github.com/repos/tikv/tikv/issues/3671/comments"},"review_comments":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3671/comments"},"review_comment":{"href":"https://api.github.com/repos/tikv/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3671/commits"},"statuses":{"href":"https://api.github.com/repos/tikv/tikv/statuses/b35e35b7e960ac937da6896d780cfd31340c9773"}},"author_association":"NONE"}}
{"actor":{"display_login":"solotzg"}}