-
Type:
Bug
-
Status: Done
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: 5.7.x, Not 5.5.x, Not 5.6.x
-
Fix Version/s: 5.7.23-23
-
Component/s: None
-
Labels:
In 5.7, with InnoDB extensions in slow query log enabled, these are shown as zeros incorrectly:
# InnoDB_trx_id: 509 # InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000 # InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000 # InnoDB_pages_distinct: 0
whereas the actual data should be
# InnoDB_trx_id: 509 # InnoDB_IO_r_ops: 1 InnoDB_IO_r_bytes: 16384 InnoDB_IO_r_wait: 0.000024 # InnoDB_rec_lock_wait: 2.004502 InnoDB_queue_wait: 0.000000 # InnoDB_pages_distinct: 6
To repeat,
--source include/have_innodb.inc CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); BEGIN; SELECT * FROM t1 FOR UPDATE; --source include/count_sessions.inc --connect(con1,localhost,root,,) SET SESSION log_slow_verbosity='innodb'; SET SESSION long_query_time=0; --let log_file=percona.slow_extended_lock_time.log --source include/log_start.inc send DELETE FROM t1 WHERE a = 1; --connection default # TODO wait condition --real_sleep 2 SHOW PROCESSLIST; ROLLBACK; --connection con1 reap; --source include/log_stop.inc --disconnect con1 --connection default DROP TABLE t1; --source include/wait_until_count_sessions.inc --cat_file $MYSQLTEST_VARDIR/$log_file.slog --source include/log_cleanup.inc
This appears to be caused by trx_commit_in_memory calling trx_init which zeroes out the stat fields in trx object before ha_innobase::external_lock sends them back to the server layer. This is a 5.7-only regression.
- causes
-
PS-5581 High memory usage with log_slow_verbosity=innodb while running a stored procedure.
-
- Done
-
- is duplicated by
-
PS-1284 LP #1086859: XtraDB may not account all accesses for InnoDB_pages_distinct in extended slow query log
-
- Done
-
-
PS-1315 LP #1124028: Unnecessary calls to innobase_get_trx() if slow log is enabled, but InnoDB stats are not
-
- Done
-
-
PS-2006 LP #1178113: Missing UNIV_UNLIKELY on trx->distinct_page_access_hash tests
-
- Done
-