mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
MDEV-36116: Remove debug assert in TOI when executing thread is killed
Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
committed by
Julius Goryavsky
parent
d698b784c8
commit
dd54ce9e10
22
mysql-test/suite/galera/r/MDEV-36116.result
Normal file
22
mysql-test/suite/galera/r/MDEV-36116.result
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
|
connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1;
|
||||||
|
connection node_1;
|
||||||
|
CALL mtr.add_suppression("CREATE TABLE isolation failure");
|
||||||
|
SET DEBUG_SYNC = 'wsrep_kill_thd_before_enter_toi SIGNAL may_kill WAIT_FOR continue';
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
connection con1;
|
||||||
|
SET DEBUG_SYNC = 'now WAIT_FOR may_kill';
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue';
|
||||||
|
connection node_1;
|
||||||
|
ERROR HY000: Lost connection to MySQL server during query
|
||||||
|
connection node_2;
|
||||||
|
SHOW TABLES LIKE 't1';
|
||||||
|
Tables_in_test (t1)
|
||||||
|
connection con1;
|
||||||
|
SHOW TABLES LIKE 't1';
|
||||||
|
Tables_in_test (t1)
|
||||||
|
SET DEBUG_SYNC = 'RESET';
|
||||||
|
disconnect con1;
|
||||||
|
disconnect node_2;
|
||||||
|
disconnect node_1;
|
43
mysql-test/suite/galera/t/MDEV-36116.test
Normal file
43
mysql-test/suite/galera/t/MDEV-36116.test
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#
|
||||||
|
# MDEV-36116: TOI crashes in debug assert if executing thread is killed.
|
||||||
|
#
|
||||||
|
|
||||||
|
--source include/galera_cluster.inc
|
||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
--source include/have_debug.inc
|
||||||
|
|
||||||
|
--connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1
|
||||||
|
|
||||||
|
# Start TOI operation and wait for the thread to be killed.
|
||||||
|
--connection node_1
|
||||||
|
CALL mtr.add_suppression("CREATE TABLE isolation failure");
|
||||||
|
|
||||||
|
--let $connection_id = `SELECT CONNECTION_ID()`
|
||||||
|
SET DEBUG_SYNC = 'wsrep_kill_thd_before_enter_toi SIGNAL may_kill WAIT_FOR continue';
|
||||||
|
--send
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
# Kill the thread and let it continue.
|
||||||
|
--connection con1
|
||||||
|
SET DEBUG_SYNC = 'now WAIT_FOR may_kill';
|
||||||
|
--disable_query_log
|
||||||
|
--eval KILL CONNECTION $connection_id
|
||||||
|
--enable_query_log
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue';
|
||||||
|
|
||||||
|
--connection node_1
|
||||||
|
--error 2013
|
||||||
|
--reap
|
||||||
|
|
||||||
|
# Verify no tables created on either nodes.
|
||||||
|
--connection node_2
|
||||||
|
SHOW TABLES LIKE 't1';
|
||||||
|
|
||||||
|
--connection con1
|
||||||
|
SHOW TABLES LIKE 't1';
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
SET DEBUG_SYNC = 'RESET';
|
||||||
|
--disconnect con1
|
||||||
|
--source include/galera_end.inc
|
@@ -2625,12 +2625,13 @@ int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_,
|
|||||||
const wsrep::key_array *fk_tables,
|
const wsrep::key_array *fk_tables,
|
||||||
const HA_CREATE_INFO *create_info)
|
const HA_CREATE_INFO *create_info)
|
||||||
{
|
{
|
||||||
|
DEBUG_SYNC(thd, "wsrep_kill_thd_before_enter_toi");
|
||||||
mysql_mutex_lock(&thd->LOCK_thd_kill);
|
mysql_mutex_lock(&thd->LOCK_thd_kill);
|
||||||
const killed_state killed = thd->killed;
|
const killed_state killed = thd->killed;
|
||||||
mysql_mutex_unlock(&thd->LOCK_thd_kill);
|
mysql_mutex_unlock(&thd->LOCK_thd_kill);
|
||||||
if (killed)
|
if (killed)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(FALSE);
|
/* The thread may have been killed as a result of memory pressure. */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user