1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00
Files
mariadb/mysql-test/suite/innodb/r/innodb_row_lock_time_ms.result
Vlad Lesin 090a84366a MDEV-29311 Server Status Innodb_row_lock_time% is reported in seconds
Before MDEV-24671, the wait time was derived from my_interval_timer() /
1000 (nanoseconds converted to microseconds, and not microseconds to
milliseconds like I must have assumed). The lock_sys.wait_time and
lock_sys.wait_time_max are already in milliseconds; we should not divide
them by 1000.

In MDEV-24738 the millisecond counts lock_sys.wait_time and
lock_sys.wait_time_max were changed to a 32-bit type. That would
overflow in 49.7 days. Keep using a 64-bit type for those millisecond
counters.

Reviewed by: Marko Mäkelä
2023-07-10 12:42:46 +03:00

41 lines
1.2 KiB
Plaintext

CREATE TABLE `t`(`id` INT, PRIMARY KEY(`id`)) ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t VALUES (1);
SET GLOBAL innodb_monitor_reset = "module_innodb";
BEGIN;
SELECT * FROM t FOR UPDATE;
id
1
connect con1,localhost,root,,;
SET innodb_lock_wait_timeout = 1;
SELECT * FROM t FOR UPDATE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1;
connection default;
COMMIT;
SELECT variable_value > 100 FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time';
variable_value > 100
1
SELECT variable_value > 100 FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
variable_value > 100
1
SELECT variable_value > 100 FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value > 100
1
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time";
count_reset > 100
1
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time_max";
count_reset > 100
1
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time_avg";
count_reset > 100
1
DROP TABLE t;
SET GLOBAL innodb_monitor_reset=default;