Q: How to turn on the feature output?
A: There is new global boolean variable print_lock_wait_timeout_info which turns on the functionality. It is turned off by default.
Q: How to get query with query id from error log output?
A: The query id can be seen in "show process list" output. Besides query id is logged in general query log which can be turned on with "log=/path_to/mysql_query.log" option. See also https://dev.mysql.com/doc/refman/5.7/en/query-log.html.
Q: What is thread_id in error log output?
A: This is mysql thread id which is shown in "show processlist" results.
Q: What the relation between PFS thread id and thread id which is output to error log by the feature?
A: PFS has their own thread id space. Our thread id corresponds to "PROCESSLIST_ID" field in performance_schema.events_statements_current. If we have blocking thread id then we can get blocking thread statements history with the following query:
SELECT s.SQL_TEXT FROM performance_schema.events_statements_history s
INNER JOIN performance_schema.threads t ON t.THREAD_ID = s.THREAD_ID
WHERE t.PROCESSLIST_ID = %d
UNION
SELECT s.SQL_TEXT FROM performance_schema.events_statements_current s
INNER JOIN performance_schema.threads t ON t.THREAD_ID = s.THREAD_ID
WHERE t.PROCESSLIST_ID = %d;
Where PROCESSLIST_ID is thread id from error log output.
A little FAQ about the current implementation(https:/ /github. com/percona/ percona- server/ pull/1970, https:/ /github. com/percona/ percona- server/ pull/1971).
Q: How to turn on the feature output? wait_timeout_ info which turns on the functionality. It is turned off by default.
A: There is new global boolean variable print_lock_
Q: How to get query with query id from error log output? to/mysql_ query.log" option. See also https:/ /dev.mysql. com/doc/ refman/ 5.7/en/ query-log. html.
A: The query id can be seen in "show process list" output. Besides query id is logged in general query log which can be turned on with "log=/path_
Q: What is thread_id in error log output?
A: This is mysql thread id which is shown in "show processlist" results.
Q: What the relation between PFS thread id and thread id which is output to error log by the feature? schema. events_ statements_ current. If we have blocking thread id then we can get blocking thread statements history with the following query:
A: PFS has their own thread id space. Our thread id corresponds to "PROCESSLIST_ID" field in performance_
SELECT s.SQL_TEXT FROM performance_ schema. events_ statements_ history s schema. threads t ON t.THREAD_ID = s.THREAD_ID schema. events_ statements_ current s schema. threads t ON t.THREAD_ID = s.THREAD_ID
INNER JOIN performance_
WHERE t.PROCESSLIST_ID = %d
UNION
SELECT s.SQL_TEXT FROM performance_
INNER JOIN performance_
WHERE t.PROCESSLIST_ID = %d;
Where PROCESSLIST_ID is thread id from error log output.