diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2022-09-28 14:27:55 +0200 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2022-09-29 00:11:02 +0200 |
| commit | de130323b4401ba9dfcb08ebd7f8d688cb317a80 (patch) | |
| tree | aea21ad06b034834ea8395b45bb7b496d9a51a26 /mysql-test/main | |
| parent | 74ac683a7e822f3287e75527d7d3a7ff1256c46c (diff) | |
| download | mariadb-git-de130323b4401ba9dfcb08ebd7f8d688cb317a80.tar.gz | |
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 9b750dcbd89e, 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.
Diffstat (limited to 'mysql-test/main')
| -rw-r--r-- | mysql-test/main/kill_debug.result | 16 | ||||
| -rw-r--r-- | mysql-test/main/kill_debug.test | 20 |
2 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/main/kill_debug.result b/mysql-test/main/kill_debug.result index d0fadb5c7b5..061e7602383 100644 --- a/mysql-test/main/kill_debug.result +++ b/mysql-test/main/kill_debug.result @@ -221,3 +221,19 @@ DROP FUNCTION MY_KILL; set global sql_mode=default; disconnect con1; disconnect con2; +# +# 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 +# +connect foo,localhost,root; +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'; +kill $id; +set debug_sync='now SIGNAL go3'; +drop table t1; +set debug_sync='reset'; diff --git a/mysql-test/main/kill_debug.test b/mysql-test/main/kill_debug.test index ba6a0ced528..32a764004e3 100644 --- a/mysql-test/main/kill_debug.test +++ b/mysql-test/main/kill_debug.test @@ -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'; |
