mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-19384 Deadlock in FTWRL
The deadlock happened between FTWRL under open HANDLER, LOCK TABLE and DROP DATABASE Fixed by reverting the previous fix for handler open in lock_global_read_lock() Fixed the original (wrong) test case in flush_read_lock.test to be repeatable.
This commit is contained in:
@ -2023,6 +2023,9 @@ set global sql_mode=default;
|
||||
--echo # Deadlock between FTWRL under open handler and DDL/LOCK TABLES
|
||||
--echo #
|
||||
CREATE TABLE t1(a INT);
|
||||
|
||||
--echo #
|
||||
connect (con3,localhost,root,,);
|
||||
HANDLER t1 OPEN;
|
||||
|
||||
--echo #
|
||||
@ -2041,7 +2044,11 @@ disconnect con2;
|
||||
connection default;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--echo #
|
||||
connection con3;
|
||||
HANDLER t1 CLOSE;
|
||||
disconnect con3;
|
||||
|
||||
--echo #
|
||||
connection con1;
|
||||
@ -2087,3 +2094,40 @@ disconnect con1;
|
||||
connection default;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19384 Deadlock between FTWRL under open HANDLER, LOCK TABLE
|
||||
--echo # and DROP DATABASE
|
||||
--echo #
|
||||
|
||||
CREATE DATABASE mysqltest;
|
||||
CREATE TABLE mysqltest.t1(a INT);
|
||||
HANDLER mysqltest.t1 OPEN as t1;
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready';
|
||||
--send LOCK TABLE mysqltest.t1 WRITE
|
||||
connect (con2,localhost,root,,);
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR ready';
|
||||
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready';
|
||||
--send DROP DATABASE mysqltest
|
||||
|
||||
connect (con3,localhost,root,,);
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR ready';
|
||||
disconnect con3;
|
||||
|
||||
connection default;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
HANDLER t1 CLOSE;
|
||||
connection con1;
|
||||
|
||||
--error 0,ER_NO_SUCH_TABLE
|
||||
reap;
|
||||
UNLOCK TABLES;
|
||||
disconnect con1;
|
||||
connection con2;
|
||||
reap;
|
||||
disconnect con2;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
Reference in New Issue
Block a user