mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-29368 Assertion `trx->mysql_thd == thd' failed in innobase_kill_query from process_timers/timer_handler and use-after-poison in innobase_kill_query
This is a 10.5 version of 9b750dcbd8
, fix for
MDEV-23536 Race condition between KILL and transaction commit
InnoDB needs to remove trx from thd before destroying it (trx), otherwise
a concurrent KILL might get a pointer from thd to a destroyed trx.
ha_close_connection() should allow engines to clear ha_data in
hton->on close_connection(). To prevent the engine from being unloaded
while hton->close_connection() is running, we remove the lock from
ha_data and unlock the plugin manually.
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_debug_sync.inc
|
||||
-- source include/have_innodb.inc
|
||||
set local sql_mode="";
|
||||
set global sql_mode="";
|
||||
|
||||
@ -296,3 +297,22 @@ DROP FUNCTION MY_KILL;
|
||||
set global sql_mode=default;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29368 Assertion `trx->mysql_thd == thd' failed in innobase_kill_query from process_timers/timer_handler and use-after-poison in innobase_kill_query
|
||||
--echo #
|
||||
connect foo,localhost,root;
|
||||
let $id=`select connection_id()`;
|
||||
create table t1 (a int) engine=innodb;
|
||||
insert t1 values (1);
|
||||
set debug_sync='THD_cleanup_after_set_killed SIGNAL go0 WAIT_FOR go1';
|
||||
set debug_sync='innobase_connection_closed SIGNAL go2 WAIT_FOR go3';
|
||||
disconnect foo;
|
||||
|
||||
connection default;
|
||||
set debug_sync='now WAIT_FOR go0';
|
||||
set debug_sync='found_killee SIGNAL go1 WAIT_FOR go2';
|
||||
evalp kill $id;
|
||||
set debug_sync='now SIGNAL go3';
|
||||
drop table t1;
|
||||
set debug_sync='reset';
|
||||
|
Reference in New Issue
Block a user