Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infoschema: add current txn start time in processlist table (#11491) #16160

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 8, 2020

cherry-pick #11491 to release-3.0


What problem does this PR solve?

help identify long-running transaction(maybe client forgot to commit/rollback) add TxnStart column to information_schema.processlist

mysql> select * from information_schema.processlist;
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+
| ID   | USER | HOST      | DB   | COMMAND | TIME | STATE | INFO                                         | MEM  | TxnStart |
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+
|    1 | root | 127.0.0.1 | test | Query   |    0 | 2     | select * from information_schema.processlist |    0 |          |
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+
1 row in set (0.00 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from information_schema.processlist;
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------------------------------------+
| ID   | USER | HOST      | DB   | COMMAND | TIME | STATE | INFO                                         | MEM  | TxnStart                               |
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------------------------------------+
|    1 | root | 127.0.0.1 | test | Query   |    0 | 3     | select * from information_schema.processlist |    0 | 07-29 12:34:29.166(410091485702651904) |
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------------------------------------+
1 row in set (0.00 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from information_schema.processlist;
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+
| ID   | USER | HOST      | DB   | COMMAND | TIME | STATE | INFO                                         | MEM  | TxnStart |
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+
|    1 | root | 127.0.0.1 | test | Query   |    0 | 2     | select * from information_schema.processlist |    0 |          |
+------+------+-----------+------+---------+------+-------+----------------------------------------------+------+----------+
1 row in set (0.00 sec)

What is changed and how it works?

add a column to info schema table, but didn't change show proceslist to keep compatibility.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • add new column to infoschema

Side effects

  • N/A

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

This change is Reviewable

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 8, 2020

/run-all-tests

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp jackysp added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 8, 2020
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. status/PTAL labels Apr 8, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 8, 2020

Your auto merge job has been accepted, waiting for 16171, 16170, 16169, 16168, 16111

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 8, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 8, 2020

@sre-bot merge failed.

@ngaut ngaut merged commit 73c1e52 into pingcap:release-3.0 Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/server sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/usability type/3.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants