Make Linux thread id available in PROCESSLIST
Add a column "TID" to table "information_
Semantic:
---------
Expose the "TID", or thread/task identifier, as defined by the underlying
operating system.
For Linux, this corresponds to light-weight process ID (LWP ID).
TID is a field exposed in particular:
- in perf: http://
- is ps -L: http://
- in /proc/[
Benefits:
---------
By exposing the thread TID in the "information schema.
- a user session (see existing column "ID")
- a currently executing statement (see existing column "INFO")
- to an operating system Light Weigh Process (LWP), aka a thread, with new
column "TID".
This is critical to inspect / monitor MySQL server threads with tools external
to the server itself, such as linux perf.
Blueprint information
- Status:
- Complete
- Approver:
- Laurynas Biveinis
- Priority:
- Medium
- Drafter:
- Yura Sorokin
- Direction:
- Approved
- Assignee:
- Yura Sorokin
- Definition:
- Approved
- Series goal:
- Accepted for 5.6
- Implementation:
- Implemented
- Milestone target:
- 5.6.27-75.0
- Started by
- Laurynas Biveinis
- Completed by
- Laurynas Biveinis
Related branches
Related bugs
Sprints
Whiteboard
Original whiteboard:
https:/
Proposed spec:
A new column named "TID" of type "BIGINT UNSIGNED" must be added at the end of "information_
"SHOW COLUMNS FROM information_
Field: TID
Type: bigint(21) unsigned
Null: YES
Key:
Default: NULL
Extra:
Please notice that "TID" can be NULL.
This field must show system thread ID associated with corresponding MySQL thread.
On Linux platforms it must be set to light-weight process ID (LWP ID), the same value produced by
"ps -L ..." system command. Please notice that to get this value from the server code "syscall(
On other platforms this field must always be set to NULL.
For backward compatibility with various monitoring tools the output of the "SHOW PROCESSLIST" command must not be changed. It must include the same 10 fields as before. For instance
Command: Query
Rows_examined: 0
In case when Percona thread pool is enabled ("thread_