{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/comments/202876617","pull_request_review_id":137656389,"id":202876617,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjg3NjYxNw==","diff_hunk":"@@ -250,6 +261,12 @@ impl<S: Snapshot> MvccTxn<S> {\n                     }\n                     None => {\n                         let ts = self.start_ts;\n+\n+                        // collapse previous rollback if exist.\n+                        if self.collapse_rollback {","path":"src/storage/mvcc/txn.rs","position":51,"original_position":52,"commit_id":"60f563d38aedf1ad7dce3184d7739be854e6b056","original_commit_id":"c643a2800f2b3ede01c493b5277ecd32e327c6b7","user":{"login":"zhangjinpeng1987","id":19700528,"node_id":"MDQ6VXNlcjE5NzAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/19700528?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangjinpeng1987","html_url":"https://github.com/zhangjinpeng1987","followers_url":"https://api.github.com/users/zhangjinpeng1987/followers","following_url":"https://api.github.com/users/zhangjinpeng1987/following{/other_user}","gists_url":"https://api.github.com/users/zhangjinpeng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjinpeng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjinpeng1987/subscriptions","organizations_url":"https://api.github.com/users/zhangjinpeng1987/orgs","repos_url":"https://api.github.com/users/zhangjinpeng1987/repos","events_url":"https://api.github.com/users/zhangjinpeng1987/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjinpeng1987/received_events","type":"User","site_admin":false},"body":"I have asked @GregoryIan, and he said there is no problem.","created_at":"2018-07-17T02:11:01Z","updated_at":"2018-07-17T02:11:01Z","html_url":"https://github.com/pingcap/tikv/pull/3290#discussion_r202876617","pull_request_url":"https://api.github.com/repos/pingcap/tikv/pulls/3290","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments/202876617"},"html":{"href":"https://github.com/pingcap/tikv/pull/3290#discussion_r202876617"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/3290"}},"in_reply_to_id":201569292},"pull_request":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/3290","id":199986226,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTg2MjI2","html_url":"https://github.com/pingcap/tikv/pull/3290","diff_url":"https://github.com/pingcap/tikv/pull/3290.diff","patch_url":"https://github.com/pingcap/tikv/pull/3290.patch","issue_url":"https://api.github.com/repos/pingcap/tikv/issues/3290","number":3290,"state":"open","locked":false,"title":"Txn: collapse continuous rollbacks","user":{"login":"zhangjinpeng1987","id":19700528,"node_id":"MDQ6VXNlcjE5NzAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/19700528?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangjinpeng1987","html_url":"https://github.com/zhangjinpeng1987","followers_url":"https://api.github.com/users/zhangjinpeng1987/followers","following_url":"https://api.github.com/users/zhangjinpeng1987/following{/other_user}","gists_url":"https://api.github.com/users/zhangjinpeng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjinpeng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjinpeng1987/subscriptions","organizations_url":"https://api.github.com/users/zhangjinpeng1987/orgs","repos_url":"https://api.github.com/users/zhangjinpeng1987/repos","events_url":"https://api.github.com/users/zhangjinpeng1987/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjinpeng1987/received_events","type":"User","site_admin":false},"body":"\r\n## What have you changed? (mandatory)\r\n\r\nPreviously, when a key rollbacked for several times, there will be several rollbacks in `write` column family. These rollbacks only wiped by GC system, so reading the key will be slow before GC wipe these rollbacks. ref to https://github.com/pingcap/tikv/pull/2834\r\n\r\nThis PR collapse continuous rollbacks, and only keep the latest rollback. This optimization works because `PreWrite` is not allowed when there exists a commit version whose commit timestamp is larger than or equal to `PreWrite`'s start timestamp, even if the commit type is rollback.\r\n\r\n## What are the type of the changes? (mandatory)\r\n\r\n- Improvement\r\n\r\n## How has this PR been tested? (mandatory)\r\n\r\nUnit test and CI\r\n\r\n## Does this PR affect documentation (docs/docs-cn) update? (mandatory)\r\n\r\nNo\r\n\r\n## Does this PR affect tidb-ansible update? (mandatory)\r\n\r\nNo\r\n\r\n## Refer to a related PR or issue link (optional)\r\n\r\nhttps://github.com/pingcap/tikv/pull/2834\r\n","created_at":"2018-07-09T04:00:02Z","updated_at":"2018-07-17T02:11:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a8080396a6645b1a167b3efe28117be8e4d2633","assignee":null,"assignees":[],"requested_reviewers":[{"login":"MyonKeminta","id":9948422,"node_id":"MDQ6VXNlcjk5NDg0MjI=","avatar_url":"https://avatars1.githubusercontent.com/u/9948422?v=4","gravatar_id":"","url":"https://api.github.com/users/MyonKeminta","html_url":"https://github.com/MyonKeminta","followers_url":"https://api.github.com/users/MyonKeminta/followers","following_url":"https://api.github.com/users/MyonKeminta/following{/other_user}","gists_url":"https://api.github.com/users/MyonKeminta/gists{/gist_id}","starred_url":"https://api.github.com/users/MyonKeminta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MyonKeminta/subscriptions","organizations_url":"https://api.github.com/users/MyonKeminta/orgs","repos_url":"https://api.github.com/users/MyonKeminta/repos","events_url":"https://api.github.com/users/MyonKeminta/events{/privacy}","received_events_url":"https://api.github.com/users/MyonKeminta/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tikv/pulls/3290/commits","review_comments_url":"https://api.github.com/repos/pingcap/tikv/pulls/3290/comments","review_comment_url":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tikv/issues/3290/comments","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/60f563d38aedf1ad7dce3184d7739be854e6b056","head":{"label":"zhangjinpeng1987:collapse-rollbacks","ref":"collapse-rollbacks","sha":"60f563d38aedf1ad7dce3184d7739be854e6b056","user":{"login":"zhangjinpeng1987","id":19700528,"node_id":"MDQ6VXNlcjE5NzAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/19700528?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangjinpeng1987","html_url":"https://github.com/zhangjinpeng1987","followers_url":"https://api.github.com/users/zhangjinpeng1987/followers","following_url":"https://api.github.com/users/zhangjinpeng1987/following{/other_user}","gists_url":"https://api.github.com/users/zhangjinpeng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjinpeng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjinpeng1987/subscriptions","organizations_url":"https://api.github.com/users/zhangjinpeng1987/orgs","repos_url":"https://api.github.com/users/zhangjinpeng1987/repos","events_url":"https://api.github.com/users/zhangjinpeng1987/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjinpeng1987/received_events","type":"User","site_admin":false},"repo":{"id":112322118,"node_id":"MDEwOlJlcG9zaXRvcnkxMTIzMjIxMTg=","name":"tikv","full_name":"zhangjinpeng1987/tikv","owner":{"login":"zhangjinpeng1987","id":19700528,"node_id":"MDQ6VXNlcjE5NzAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/19700528?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangjinpeng1987","html_url":"https://github.com/zhangjinpeng1987","followers_url":"https://api.github.com/users/zhangjinpeng1987/followers","following_url":"https://api.github.com/users/zhangjinpeng1987/following{/other_user}","gists_url":"https://api.github.com/users/zhangjinpeng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjinpeng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjinpeng1987/subscriptions","organizations_url":"https://api.github.com/users/zhangjinpeng1987/orgs","repos_url":"https://api.github.com/users/zhangjinpeng1987/repos","events_url":"https://api.github.com/users/zhangjinpeng1987/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjinpeng1987/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhangjinpeng1987/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":true,"url":"https://api.github.com/repos/zhangjinpeng1987/tikv","forks_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/forks","keys_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/teams","hooks_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/hooks","issue_events_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/events","assignees_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/tags","blobs_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/languages","stargazers_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/stargazers","contributors_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/contributors","subscribers_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/subscribers","subscription_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/subscription","commits_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/merges","archive_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/downloads","issues_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/labels{/name}","releases_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/zhangjinpeng1987/tikv/deployments","created_at":"2017-11-28T10:39:25Z","updated_at":"2017-11-28T10:39:28Z","pushed_at":"2018-07-17T01:35:13Z","git_url":"git://github.com/zhangjinpeng1987/tikv.git","ssh_url":"git@github.com:zhangjinpeng1987/tikv.git","clone_url":"https://github.com/zhangjinpeng1987/tikv.git","svn_url":"https://github.com/zhangjinpeng1987/tikv","homepage":"https://pingcap.com","size":15406,"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":"pingcap:master","ref":"master","sha":"3b5cc11066d42008fe9763865f9d91d482923cd0","user":{"login":"pingcap","id":11855343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODU1MzQz","avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":48833910,"node_id":"MDEwOlJlcG9zaXRvcnk0ODgzMzkxMA==","name":"tikv","full_name":"pingcap/tikv","owner":{"login":"pingcap","id":11855343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODU1MzQz","avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":false,"url":"https://api.github.com/repos/pingcap/tikv","forks_url":"https://api.github.com/repos/pingcap/tikv/forks","keys_url":"https://api.github.com/repos/pingcap/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tikv/teams","hooks_url":"https://api.github.com/repos/pingcap/tikv/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tikv/events","assignees_url":"https://api.github.com/repos/pingcap/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tikv/tags","blobs_url":"https://api.github.com/repos/pingcap/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tikv/languages","stargazers_url":"https://api.github.com/repos/pingcap/tikv/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tikv/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tikv/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tikv/subscription","commits_url":"https://api.github.com/repos/pingcap/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tikv/merges","archive_url":"https://api.github.com/repos/pingcap/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tikv/downloads","issues_url":"https://api.github.com/repos/pingcap/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tikv/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tikv/deployments","created_at":"2015-12-31T04:51:32Z","updated_at":"2018-07-16T19:42:13Z","pushed_at":"2018-07-17T01:35:15Z","git_url":"git://github.com/pingcap/tikv.git","ssh_url":"git@github.com:pingcap/tikv.git","clone_url":"https://github.com/pingcap/tikv.git","svn_url":"https://github.com/pingcap/tikv","homepage":"https://pingcap.com","size":14619,"stargazers_count":3363,"watchers_count":3363,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":429,"mirror_url":null,"archived":false,"open_issues_count":221,"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":429,"open_issues":221,"watchers":3363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/3290"},"html":{"href":"https://github.com/pingcap/tikv/pull/3290"},"issue":{"href":"https://api.github.com/repos/pingcap/tikv/issues/3290"},"comments":{"href":"https://api.github.com/repos/pingcap/tikv/issues/3290/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/3290/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/3290/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tikv/statuses/60f563d38aedf1ad7dce3184d7739be854e6b056"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zhangjinpeng1987"}}