From 85d0a1955fe9b9cf87fb6cbfe84d684bff2b24cc Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 1 Jul 2019 15:21:17 +0530 Subject: MDEV-19914 Server startup fails while dropping garbage encrypted tablespace if innodb_encryption_threads > 0 - Avoiding accessing encryption thread mutex before initiating the encryption threads --- mysql-test/suite/encryption/t/innodb-encryption-alter.test | 1 + storage/innobase/fil/fil0crypt.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/encryption/t/innodb-encryption-alter.test b/mysql-test/suite/encryption/t/innodb-encryption-alter.test index d9a0e4e95cd..2e18b15079b 100644 --- a/mysql-test/suite/encryption/t/innodb-encryption-alter.test +++ b/mysql-test/suite/encryption/t/innodb-encryption-alter.test @@ -123,6 +123,7 @@ SET DEBUG_SYNC = 'now WAIT_FOR done'; SET GLOBAL innodb_flush_log_at_trx_commit=1; COMMIT; +let $restart_parameters = --innodb_encryption_threads=2; --let $shutdown_timeout= 0 --source include/restart_mysqld.inc disconnect con1; diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 635ed619df0..d1bfa8921e5 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -2414,7 +2414,8 @@ fil_space_crypt_close_tablespace( { fil_space_crypt_t* crypt_data = space->crypt_data; - if (!crypt_data || srv_n_fil_crypt_threads == 0) { + if (!crypt_data || srv_n_fil_crypt_threads == 0 + || !fil_crypt_threads_inited) { return; } -- cgit v1.2.1