payload: {"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/333335573","pull_request_review_id":299826900,"id":333335573,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMzMzNTU3Mw==","diff_hunk":"@@ -265,6 +265,40 @@ func (s *testLockSuite) TestTxnHeartBeat(c *C) {\n \tc.Assert(newTTL, Equals, uint64(0))\n }\n \n+func (s *testLockSuite) TestCheckTxnStatus(c *C) {\n+\ttxn, err := s.store.Begin()\n+\tc.Assert(err, IsNil)\n+\ttxn.Set(kv.Key(\"key\"), []byte(\"value\"))\n+\ts.prewriteTxn(c, txn.(*tikvTxn))\n+\n+\toracle := s.store.GetOracle()\n+\tcurrentTS, err := oracle.GetTimestamp(context.Background())\n+\tc.Assert(err, IsNil)\n+\tbo := NewBackoffer(context.Background(), prewriteMaxBackoff)\n+\tstatus, err := newLockResolver(s.store).getTxnStatus(bo, txn.StartTS(), []byte(\"key\"), currentTS, currentTS)\n+\tc.Assert(err, IsNil)\n+\tc.Assert(status.IsCommitted(), IsFalse)\n+\tc.Assert(status.ttl, Greater, uint64(0))\n+\tc.Assert(status.CommitTS(), Equals, uint64(0))\n+\n+\t// It is confusing here, getTxnStatus with currentTS = MaxUint64 really means rollback!\n+\tstatus, err = newLockResolver(s.store).getTxnStatus(bo, txn.StartTS(), []byte(\"key\"), currentTS, math.MaxUint64)","path":"store/tikv/lock_test.go","position":21,"original_position":21,"commit_id":"6da84f703a1904115198b63ae4548b374f1373bc","original_commit_id":"6da84f703a1904115198b63ae4548b374f1373bc","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 don't need to test MaxUint64","created_at":"2019-10-10T05:29:20Z","updated_at":"2019-10-10T05:29:20Z","html_url":"https://github.com/pingcap/tidb/pull/11999#discussion_r333335573","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/11999","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/333335573"},"html":{"href":"https://github.com/pingcap/tidb/pull/11999#discussion_r333335573"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11999"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/11999","id":313423434,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEzNDIzNDM0","html_url":"https://github.com/pingcap/tidb/pull/11999","diff_url":"https://github.com/pingcap/tidb/pull/11999.diff","patch_url":"https://github.com/pingcap/tidb/pull/11999.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/11999","number":11999,"state":"open","locked":false,"title":"store/tikv: refactor the ResolveLocks() function for large transaction's implementation","user":{"login":"tiancaiamao","id":1420062,"node_id":"MDQ6VXNlcjE0MjAwNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/1420062?v=4","gravatar_id":"","url":"https://api.github.com/users/tiancaiamao","html_url":"https://github.com/tiancaiamao","followers_url":"https://api.github.com/users/tiancaiamao/followers","following_url":"https://api.github.com/users/tiancaiamao/following{/other_user}","gists_url":"https://api.github.com/users/tiancaiamao/gists{/gist_id}","starred_url":"https://api.github.com/users/tiancaiamao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiancaiamao/subscriptions","organizations_url":"https://api.github.com/users/tiancaiamao/orgs","repos_url":"https://api.github.com/users/tiancaiamao/repos","events_url":"https://api.github.com/users/tiancaiamao/events{/privacy}","received_events_url":"https://api.github.com/users/tiancaiamao/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for contributing to TiDB! Please read TiDB's [CONTRIBUTING](https://github.com/pingcap/tidb/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\n\r\n### What problem does this PR solve? <!--add issue link with summary if exists-->\r\n\r\nAfter introducing the large transaction, the true lock TTL information is stored in the primary lock, and the TTL may change.\r\nThis commit updates the resolve lock method, using the new kvproto API.\r\n\r\n### What is changed and how it works?\r\n\r\nTiny refactor to adapt the new kvproto API.\r\n~~Blocked by https://github.com/pingcap/tidb/pull/11974 which implements the `CheckTxnStatus` API, please review that one first.~~\r\n\r\n### Check List <!--REMOVE the items that are not applicable-->\r\n\r\nTests <!-- At least one of them must be included. -->\r\n\r\n - No code\r\n\r\n\r\n","created_at":"2019-09-03T05:11:24Z","updated_at":"2019-10-10T05:29:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33fa71de1f5442350362528fe45c308abbce9817","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":972099262,"node_id":"MDU6TGFiZWw5NzIwOTkyNjI=","url":"https://api.github.com/repos/pingcap/tidb/labels/component/tikv","name":"component/tikv","color":"8bef73","default":false},{"id":1153365387,"node_id":"MDU6TGFiZWwxMTUzMzY1Mzg3","url":"https://api.github.com/repos/pingcap/tidb/labels/component/transaction-need-LGT3","name":"component/transaction-need-LGT3","color":"83e2d1","default":false},{"id":770872605,"node_id":"MDU6TGFiZWw3NzA4NzI2MDU=","url":"https://api.github.com/repos/pingcap/tidb/labels/status/all%20tests%20passed","name":"status/all tests passed","color":"2cbe4e","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/11999/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/11999/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/11999/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/6da84f703a1904115198b63ae4548b374f1373bc","head":{"label":"tiancaiamao:resolve-lock","ref":"resolve-lock","sha":"6da84f703a1904115198b63ae4548b374f1373bc","user":{"login":"tiancaiamao","id":1420062,"node_id":"MDQ6VXNlcjE0MjAwNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/1420062?v=4","gravatar_id":"","url":"https://api.github.com/users/tiancaiamao","html_url":"https://github.com/tiancaiamao","followers_url":"https://api.github.com/users/tiancaiamao/followers","following_url":"https://api.github.com/users/tiancaiamao/following{/other_user}","gists_url":"https://api.github.com/users/tiancaiamao/gists{/gist_id}","starred_url":"https://api.github.com/users/tiancaiamao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiancaiamao/subscriptions","organizations_url":"https://api.github.com/users/tiancaiamao/orgs","repos_url":"https://api.github.com/users/tiancaiamao/repos","events_url":"https://api.github.com/users/tiancaiamao/events{/privacy}","received_events_url":"https://api.github.com/users/tiancaiamao/received_events","type":"User","site_admin":false},"repo":{"id":63065396,"node_id":"MDEwOlJlcG9zaXRvcnk2MzA2NTM5Ng==","name":"tidb","full_name":"tiancaiamao/tidb","private":false,"owner":{"login":"tiancaiamao","id":1420062,"node_id":"MDQ6VXNlcjE0MjAwNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/1420062?v=4","gravatar_id":"","url":"https://api.github.com/users/tiancaiamao","html_url":"https://github.com/tiancaiamao","followers_url":"https://api.github.com/users/tiancaiamao/followers","following_url":"https://api.github.com/users/tiancaiamao/following{/other_user}","gists_url":"https://api.github.com/users/tiancaiamao/gists{/gist_id}","starred_url":"https://api.github.com/users/tiancaiamao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiancaiamao/subscriptions","organizations_url":"https://api.github.com/users/tiancaiamao/orgs","repos_url":"https://api.github.com/users/tiancaiamao/repos","events_url":"https://api.github.com/users/tiancaiamao/events{/privacy}","received_events_url":"https://api.github.com/users/tiancaiamao/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tiancaiamao/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":true,"url":"https://api.github.com/repos/tiancaiamao/tidb","forks_url":"https://api.github.com/repos/tiancaiamao/tidb/forks","keys_url":"https://api.github.com/repos/tiancaiamao/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiancaiamao/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiancaiamao/tidb/teams","hooks_url":"https://api.github.com/repos/tiancaiamao/tidb/hooks","issue_events_url":"https://api.github.com/repos/tiancaiamao/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/tiancaiamao/tidb/events","assignees_url":"https://api.github.com/repos/tiancaiamao/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/tiancaiamao/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/tiancaiamao/tidb/tags","blobs_url":"https://api.github.com/repos/tiancaiamao/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiancaiamao/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiancaiamao/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiancaiamao/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiancaiamao/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/tiancaiamao/tidb/languages","stargazers_url":"https://api.github.com/repos/tiancaiamao/tidb/stargazers","contributors_url":"https://api.github.com/repos/tiancaiamao/tidb/contributors","subscribers_url":"https://api.github.com/repos/tiancaiamao/tidb/subscribers","subscription_url":"https://api.github.com/repos/tiancaiamao/tidb/subscription","commits_url":"https://api.github.com/repos/tiancaiamao/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiancaiamao/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiancaiamao/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiancaiamao/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiancaiamao/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/tiancaiamao/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiancaiamao/tidb/merges","archive_url":"https://api.github.com/repos/tiancaiamao/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiancaiamao/tidb/downloads","issues_url":"https://api.github.com/repos/tiancaiamao/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/tiancaiamao/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/tiancaiamao/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/tiancaiamao/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiancaiamao/tidb/labels{/name}","releases_url":"https://api.github.com/repos/tiancaiamao/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/tiancaiamao/tidb/deployments","created_at":"2016-07-11T12:20:13Z","updated_at":"2018-11-08T12:08:01Z","pushed_at":"2019-10-10T05:06:21Z","git_url":"git://github.com/tiancaiamao/tidb.git","ssh_url":"git@github.com:tiancaiamao/tidb.git","clone_url":"https://github.com/tiancaiamao/tidb.git","svn_url":"https://github.com/tiancaiamao/tidb","homepage":"","size":86599,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":"740b490cbd3d8004a724d3196d96ca6aa20cb776","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":41986369,"node_id":"MDEwOlJlcG9zaXRvcnk0MTk4NjM2OQ==","name":"tidb","full_name":"pingcap/tidb","private":false,"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},"html_url":"https://github.com/pingcap/tidb","description":"TiDB is an open source distributed HTAP database compatible with the MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2019-10-10T05:20:06Z","pushed_at":"2019-10-10T05:20:09Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"https://pingcap.com","size":142653,"stargazers_count":20845,"watchers_count":20845,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3077,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1063,"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":3077,"open_issues":1063,"watchers":20845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11999"},"html":{"href":"https://github.com/pingcap/tidb/pull/11999"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/11999"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/11999/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11999/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11999/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/6da84f703a1904115198b63ae4548b374f1373bc"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"coocood"}}