File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
mysql-test/suite/encryption Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 11# Wait max 10 min for key encryption threads to encrypt all spaces
22# Success!
3+ SET GLOBAL innodb_encryption_threads=4;
4+ SELECT COUNT(*) AS encrypt_threads_running
5+ FROM performance_schema.threads
6+ WHERE NAME LIKE '%encrypt%';
7+ encrypt_threads_running
8+ 4
39# restart: --innodb-read-only=1 --innodb-encrypt-tables=1
10+ SET GLOBAL innodb_encryption_threads=4;
11+ SELECT COUNT(*) AS encrypt_threads_running
12+ FROM performance_schema.threads
13+ WHERE NAME LIKE '%encrypt%';
14+ encrypt_threads_running
15+ 0
416# All done
Original file line number Diff line number Diff line change @@ -25,10 +25,22 @@ if (!$success)
2525}
2626--echo # Success!
2727
28+ # Server in normal mode
29+ SET GLOBAL innodb_encryption_threads=4;
30+ SELECT COUNT(*) AS encrypt_threads_running
31+ FROM performance_schema.threads
32+ WHERE NAME LIKE '%encrypt%';
33+
2834#
2935# MDEV-11835: InnoDB: Failing assertion: free_slot != NULL on
3036# restarting server with encryption and read-only
3137#
3238--let $restart_parameters= --innodb-read-only=1 --innodb-encrypt-tables=1
3339--source include/restart_mysqld.inc
40+
41+ # Server read-only mode
42+ SET GLOBAL innodb_encryption_threads=4;
43+ SELECT COUNT(*) AS encrypt_threads_running
44+ FROM performance_schema.threads
45+ WHERE NAME LIKE '%encrypt%';
3446--echo # All done
Original file line number Diff line number Diff line change @@ -2108,6 +2108,9 @@ Adjust thread count for key rotation
21082108@param[in] enw_cnt Number of threads to be used */
21092109void fil_crypt_set_thread_cnt (const uint new_cnt)
21102110{
2111+ if (srv_read_only_mode)
2112+ return ;
2113+
21112114 if (!fil_crypt_threads_inited) {
21122115 if (srv_shutdown_state != SRV_SHUTDOWN_NONE)
21132116 return ;
@@ -2261,6 +2264,8 @@ void fil_crypt_set_encrypt_tables(ulong val)
22612264Init threads for key rotation */
22622265void fil_crypt_threads_init ()
22632266{
2267+ ut_ad (!srv_read_only_mode);
2268+
22642269 if (!fil_crypt_threads_inited) {
22652270 pthread_cond_init (&fil_crypt_cond, nullptr );
22662271 pthread_cond_init (&fil_crypt_threads_cond, nullptr );
You can’t perform that action at this time.
0 commit comments