Commit 6df2f2db authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-21546 main.backup_stages occasionally reports lock wait timeout

With MDEV-16678, InnoDB background tasks (most notably, the purge of
committed transaction history) can acquire metadata locks.
Because of this, the lock_wait_timeout=0 is too strict and must
be relaxed.

The test used to fail easily if an extra sleep was added to
the end of dict_table_close(), before the MDL release. Now,
with lock_wait_timeout=1, the test passes even with an extra
0.1-second sleep added to dict_table_close().

Thanks to Monty for providing this fix.
parent 0d6d63e1
......@@ -63,7 +63,7 @@ INSERT INTO t_permanent_myisam SET col1 = 1;
connect backup,localhost,root,,;
connect con11,localhost,root,,;
SET AUTOCOMMIT = 0;
set session lock_wait_timeout=0;
set session lock_wait_timeout=1;
connect con12,localhost,root,,;
SET AUTOCOMMIT = 1;
# Between (connection default) BACKUP STAGE START and FLUSH
......@@ -208,7 +208,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
DROP TABLE t_con1_myisam;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection con12;
SET STATEMENT lock_wait_timeout=0 FOR UPDATE t_permanent_innodb SET col1 = 9;
SET STATEMENT lock_wait_timeout=1 FOR UPDATE t_permanent_innodb SET col1 = 9;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection backup;
BACKUP STAGE END;
......
......@@ -119,7 +119,7 @@ INSERT INTO t_permanent_myisam SET col1 = 1;
--connect(backup,localhost,root,,)
--connect(con11,localhost,root,,)
SET AUTOCOMMIT = 0;
set session lock_wait_timeout=0;
set session lock_wait_timeout=1;
--connect(con12,localhost,root,,)
SET AUTOCOMMIT = 1;
......@@ -244,7 +244,7 @@ DROP TABLE t_con1_innodb;
DROP TABLE t_con1_myisam;
--connection con12
--error ER_LOCK_WAIT_TIMEOUT
SET STATEMENT lock_wait_timeout=0 FOR UPDATE t_permanent_innodb SET col1 = 9;
SET STATEMENT lock_wait_timeout=1 FOR UPDATE t_permanent_innodb SET col1 = 9;
--connection backup
BACKUP STAGE END;
......
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