Commit 2fdf89ec authored by Vlad Lesin's avatar Vlad Lesin

MDEV-32554 mon_lock_wait_current_count test causes innodb.monitor failure

This commit will be applied during 10.5->10.6 merging as a part of
conflicts resolution.

-------------------------
SET GLOBAL innodb_monitor_disable=all;
-------------------------

was set at the the beggining of mon_lock_wait_current_count test,
because lock_row_lock_time_avg is filled under lock_sys.wait_mutex lock,
which is held by connection 2:

--------------------------
--connect (con2,localhost,root,,)
SET DEBUG_SYNC="lock_wait_before_suspend SIGNAL blocked WAIT_FOR cont";
BEGIN;
--send SELECT * FROM t FOR UPDATE
-------------------------

That is why the followin SELECT is blocked:

-----------------------
SELECT name, count FROM information_schema.innodb_metrics
  WHERE name ='lock_row_lock_current_waits';
-----------------------

And setting innodb_monitor_disable=all causes innodb monitor enabling
status changing. And the status is not restored to default value even
after
-----------------------
SET GLOBAL innodb_monitor_reset_all=default;
SET GLOBAL innodb_monitor_enable=default;
-----------------------
execution. See MDEV-32553 for details.

The fix is to disable not all the monitors at the beggining of the test,
but only the monitor, which causes hanging, i.e. lock_row_lock_time_avg.

MDEV-32553 it the root case, the current fix is just workaround.
10.5 is not affected, as there is difference in innodb.monitor.
parent a0a6ace2
connect prevent_purge,localhost,root,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
SET GLOBAL innodb_monitor_disable='all';
SET GLOBAL innodb_monitor_enable='lock_row_lock_current_waits';
SET GLOBAL innodb_monitor_disable='lock_row_lock_time_avg';
CREATE TABLE `t` (a INT PRIMARY KEY) engine=InnoDB STATS_PERSISTENT=0;
INSERT INTO t VALUES (5);
SELECT name, count FROM information_schema.innodb_metrics
......@@ -48,6 +47,7 @@ DROP TABLE `t`;
SET GLOBAL innodb_monitor_disable='lock_row_lock_current_waits';
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_current_waits';
SET GLOBAL innodb_monitor_enable='lock_row_lock_current_waits';
SET GLOBAL innodb_monitor_enable='lock_row_lock_time_avg';
SET GLOBAL innodb_monitor_disable=default;
SET GLOBAL innodb_monitor_reset_all=default;
SET GLOBAL innodb_monitor_enable=default;
......
......@@ -10,8 +10,27 @@
START TRANSACTION WITH CONSISTENT SNAPSHOT;
--connection default
SET GLOBAL innodb_monitor_disable='all';
SET GLOBAL innodb_monitor_enable='lock_row_lock_current_waits';
# lock_row_lock_time_avg is filled under lock_sys.wait_mutex lock, which
# will be held by connection 2, that is why the following SELECT
# from information_schema.innodb_metrics will be blocked.
#
# And setting innodb_monitor_disable=all causes innodb monitor enabling
# status changing. The status will not be restored to default value even
# after
# -----------------------
# SET GLOBAL innodb_monitor_reset_all=default;
# SET GLOBAL innodb_monitor_enable=default;
# -----------------------
# execution. See MDEV-32553 for details.
#
# All monitors disabling, i.e. "innodb_monitor_disable=all" causes
# innodb.monitor test failure due to MDEV-32553. 10.5 is not affected, as
# innodb.monitor differs there.
#
# Disable not all monitors at the beggining of the test,
# but only the monitor, which causes hanging, i.e. lock_row_lock_time_avg.
SET GLOBAL innodb_monitor_disable='lock_row_lock_time_avg';
# 'lock_row_lock_current_waits' should be enabled by default;
CREATE TABLE `t` (a INT PRIMARY KEY) engine=InnoDB STATS_PERSISTENT=0;
INSERT INTO t VALUES (5);
SELECT name, count FROM information_schema.innodb_metrics
......@@ -67,6 +86,8 @@ DROP TABLE `t`;
SET GLOBAL innodb_monitor_disable='lock_row_lock_current_waits';
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_current_waits';
SET GLOBAL innodb_monitor_enable='lock_row_lock_current_waits';
# TODO: remove it when MDEV-32553 is fixed
SET GLOBAL innodb_monitor_enable='lock_row_lock_time_avg';
--disable_warnings
SET GLOBAL innodb_monitor_disable=default;
SET GLOBAL innodb_monitor_reset_all=default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment