{"action":"closed","number":11491,"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/11491","id":301903951,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAxOTAzOTUx","html_url":"https://github.com/pingcap/tidb/pull/11491","diff_url":"https://github.com/pingcap/tidb/pull/11491.diff","patch_url":"https://github.com/pingcap/tidb/pull/11491.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/11491","number":11491,"state":"closed","locked":false,"title":"infoschema: add current txn start time in processlist table","user":{"login":"lysu","id":528332,"node_id":"MDQ6VXNlcjUyODMzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/528332?v=4","gravatar_id":"","url":"https://api.github.com/users/lysu","html_url":"https://github.com/lysu","followers_url":"https://api.github.com/users/lysu/followers","following_url":"https://api.github.com/users/lysu/following{/other_user}","gists_url":"https://api.github.com/users/lysu/gists{/gist_id}","starred_url":"https://api.github.com/users/lysu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lysu/subscriptions","organizations_url":"https://api.github.com/users/lysu/orgs","repos_url":"https://api.github.com/users/lysu/repos","events_url":"https://api.github.com/users/lysu/events{/privacy}","received_events_url":"https://api.github.com/users/lysu/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\nhelp identify long-running transaction(maybe client forgot to commit/rollback) add TxnStart column to `information_schema.processlist`\r\n\r\n```\r\nmysql> select * from information_schema.processlist;\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+\r\n| ID   | USER | HOST      | DB   | COMMAND | TIME | STATE | INFO                                         | MEM  | TxnStart |\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+\r\n|    1 | root | 127.0.0.1 | test | Query   |    0 | 2     | select * from information_schema.processlist |    0 |          |\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> begin;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> select * from information_schema.processlist;\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------------------------------------+\r\n| ID   | USER | HOST      | DB   | COMMAND | TIME | STATE | INFO                                         | MEM  | TxnStart                               |\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------------------------------------+\r\n|    1 | root | 127.0.0.1 | test | Query   |    0 | 3     | select * from information_schema.processlist |    0 | 07-29 12:34:29.166(410091485702651904) |\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> commit;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> select * from information_schema.processlist;\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+\r\n| ID   | USER | HOST      | DB   | COMMAND | TIME | STATE | INFO                                         | MEM  | TxnStart |\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+\r\n|    1 | root | 127.0.0.1 | test | Query   |    0 | 2     | select * from information_schema.processlist |    0 |          |\r\n+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+\r\n1 row in set (0.00 sec)\r\n```\r\n### What is changed and how it works?\r\n\r\nadd a column to info schema table, but didn't change `show proceslist` to keep compatibility.\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 - Unit test\r\n - Integration test\r\n\r\nCode changes\r\n\r\n - add new column to infoschema\r\n\r\nSide effects\r\n\r\n - N/A\r\n\r\nRelated changes\r\n\r\n - Need to cherry-pick to the release branch\r\n - Need to update the documentation\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/pingcap/tidb/11491)\n<!-- Reviewable:end -->\n","created_at":"2019-07-29T04:38:43Z","updated_at":"2019-07-29T08:11:10Z","closed_at":"2019-07-29T08:11:10Z","merged_at":"2019-07-29T08:11:10Z","merge_commit_sha":"05b4e2299d0ed6656114deb13550de7f1a1ad8b7","assignee":null,"assignees":[],"requested_reviewers":[{"login":"cfzjywxk","id":3692139,"node_id":"MDQ6VXNlcjM2OTIxMzk=","avatar_url":"https://avatars0.githubusercontent.com/u/3692139?v=4","gravatar_id":"","url":"https://api.github.com/users/cfzjywxk","html_url":"https://github.com/cfzjywxk","followers_url":"https://api.github.com/users/cfzjywxk/followers","following_url":"https://api.github.com/users/cfzjywxk/following{/other_user}","gists_url":"https://api.github.com/users/cfzjywxk/gists{/gist_id}","starred_url":"https://api.github.com/users/cfzjywxk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfzjywxk/subscriptions","organizations_url":"https://api.github.com/users/cfzjywxk/orgs","repos_url":"https://api.github.com/users/cfzjywxk/repos","events_url":"https://api.github.com/users/cfzjywxk/events{/privacy}","received_events_url":"https://api.github.com/users/cfzjywxk/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1095620003,"node_id":"MDU6TGFiZWwxMDk1NjIwMDAz","url":"https://api.github.com/repos/pingcap/tidb/labels/component/server","name":"component/server","color":"e0854c","default":false},{"id":1204650617,"node_id":"MDU6TGFiZWwxMjA0NjUwNjE3","url":"https://api.github.com/repos/pingcap/tidb/labels/component/usability","name":"component/usability","color":"0ad8bd","default":false},{"id":1433635481,"node_id":"MDU6TGFiZWwxNDMzNjM1NDgx","url":"https://api.github.com/repos/pingcap/tidb/labels/needs-cherry-pick-3.0","name":"needs-cherry-pick-3.0","color":"000000","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/11491/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/11491/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/11491/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/9df05e503ed2e6ee90d0557e4bf4ea8dc8f3ef36","head":{"label":"lysu:dev-plist-txn-start","ref":"dev-plist-txn-start","sha":"9df05e503ed2e6ee90d0557e4bf4ea8dc8f3ef36","user":{"login":"lysu","id":528332,"node_id":"MDQ6VXNlcjUyODMzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/528332?v=4","gravatar_id":"","url":"https://api.github.com/users/lysu","html_url":"https://github.com/lysu","followers_url":"https://api.github.com/users/lysu/followers","following_url":"https://api.github.com/users/lysu/following{/other_user}","gists_url":"https://api.github.com/users/lysu/gists{/gist_id}","starred_url":"https://api.github.com/users/lysu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lysu/subscriptions","organizations_url":"https://api.github.com/users/lysu/orgs","repos_url":"https://api.github.com/users/lysu/repos","events_url":"https://api.github.com/users/lysu/events{/privacy}","received_events_url":"https://api.github.com/users/lysu/received_events","type":"User","site_admin":false},"repo":{"id":133315666,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMzMTU2NjY=","name":"tidb","full_name":"lysu/tidb","private":false,"owner":{"login":"lysu","id":528332,"node_id":"MDQ6VXNlcjUyODMzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/528332?v=4","gravatar_id":"","url":"https://api.github.com/users/lysu","html_url":"https://github.com/lysu","followers_url":"https://api.github.com/users/lysu/followers","following_url":"https://api.github.com/users/lysu/following{/other_user}","gists_url":"https://api.github.com/users/lysu/gists{/gist_id}","starred_url":"https://api.github.com/users/lysu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lysu/subscriptions","organizations_url":"https://api.github.com/users/lysu/orgs","repos_url":"https://api.github.com/users/lysu/repos","events_url":"https://api.github.com/users/lysu/events{/privacy}","received_events_url":"https://api.github.com/users/lysu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/lysu/tidb","description":"TiDB is a distributed HTAP database compatible with the MySQL protocol ","fork":true,"url":"https://api.github.com/repos/lysu/tidb","forks_url":"https://api.github.com/repos/lysu/tidb/forks","keys_url":"https://api.github.com/repos/lysu/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lysu/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lysu/tidb/teams","hooks_url":"https://api.github.com/repos/lysu/tidb/hooks","issue_events_url":"https://api.github.com/repos/lysu/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/lysu/tidb/events","assignees_url":"https://api.github.com/repos/lysu/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/lysu/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/lysu/tidb/tags","blobs_url":"https://api.github.com/repos/lysu/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lysu/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lysu/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/lysu/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lysu/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/lysu/tidb/languages","stargazers_url":"https://api.github.com/repos/lysu/tidb/stargazers","contributors_url":"https://api.github.com/repos/lysu/tidb/contributors","subscribers_url":"https://api.github.com/repos/lysu/tidb/subscribers","subscription_url":"https://api.github.com/repos/lysu/tidb/subscription","commits_url":"https://api.github.com/repos/lysu/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/lysu/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/lysu/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/lysu/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/lysu/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/lysu/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lysu/tidb/merges","archive_url":"https://api.github.com/repos/lysu/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lysu/tidb/downloads","issues_url":"https://api.github.com/repos/lysu/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/lysu/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/lysu/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/lysu/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lysu/tidb/labels{/name}","releases_url":"https://api.github.com/repos/lysu/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/lysu/tidb/deployments","created_at":"2018-05-14T06:37:16Z","updated_at":"2019-07-29T02:37:55Z","pushed_at":"2019-07-29T07:28:45Z","git_url":"git://github.com/lysu/tidb.git","ssh_url":"git@github.com:lysu/tidb.git","clone_url":"https://github.com/lysu/tidb.git","svn_url":"https://github.com/lysu/tidb","homepage":"https://pingcap.com","size":82364,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":1,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"6ba79d4d4405006ecf6fe28d9c53496131da306e","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 a 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-07-29T08:06:39Z","pushed_at":"2019-07-29T08:11: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":137236,"stargazers_count":19928,"watchers_count":19928,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2901,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":988,"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":2901,"open_issues":988,"watchers":19928,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11491"},"html":{"href":"https://github.com/pingcap/tidb/pull/11491"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/11491"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/11491/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11491/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11491/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/9df05e503ed2e6ee90d0557e4bf4ea8dc8f3ef36"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"jackysp","id":4352397,"node_id":"MDQ6VXNlcjQzNTIzOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/4352397?v=4","gravatar_id":"","url":"https://api.github.com/users/jackysp","html_url":"https://github.com/jackysp","followers_url":"https://api.github.com/users/jackysp/followers","following_url":"https://api.github.com/users/jackysp/following{/other_user}","gists_url":"https://api.github.com/users/jackysp/gists{/gist_id}","starred_url":"https://api.github.com/users/jackysp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackysp/subscriptions","organizations_url":"https://api.github.com/users/jackysp/orgs","repos_url":"https://api.github.com/users/jackysp/repos","events_url":"https://api.github.com/users/jackysp/events{/privacy}","received_events_url":"https://api.github.com/users/jackysp/received_events","type":"User","site_admin":false},"comments":4,"review_comments":2,"maintainer_can_modify":false,"commits":4,"additions":30,"deletions":19,"changed_files":4}}
{"actor":{"display_login":"jackysp"}}