From a891fe6aa5ede1bf1f4551cfa75cf856f1dd1c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 9 Oct 2020 12:47:58 +0300 Subject: [PATCH] MDEV-23927 Crash in ./mtr --skip-innodb-fast-shutdown innodb.temporary_tables innodb_preshutdown(): On innodb_fast_shutdown=0, only wait for transactions to exit if the transaction system had been initialized. Reviewed by: Vladislav Vaintroub --- mysql-test/suite/innodb/t/temporary_table.test | 2 +- storage/innobase/srv/srv0start.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index 8e3ddf95634..389e106a345 100644 --- a/mysql-test/suite/innodb/t/temporary_table.test +++ b/mysql-test/suite/innodb/t/temporary_table.test @@ -131,7 +131,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); # We cannot use include/restart_mysqld.inc in this particular test, # because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir. --source include/shutdown_mysqld.inc ---exec echo "restart: --tmpdir=/dev/null/nonexistent" > $_expect_file_name +--exec echo "restart: --tmpdir=/dev/null/nonexistent --skip-innodb-fast-shutdown" > $_expect_file_name --enable_reconnect --disable_result_log --disable_query_log diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 3481df9160b..59ed743b087 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2076,8 +2076,9 @@ void innodb_preshutdown() better prevent any further changes from being buffered. */ innodb_change_buffering= 0; - while (trx_sys.any_active_transactions()) - os_thread_sleep(1000); + if (trx_sys.is_initialised()) + while (trx_sys.any_active_transactions()) + os_thread_sleep(1000); } srv_shutdown_bg_undo_sources(); srv_purge_shutdown();