mirror of
https://github.com/MariaDB/server.git
synced 2025-06-03 07:02:23 +03:00
After MDEV-13583: Improvements for MTR rebootstrap introduced in MDEV-12042 bootsrap correctly creates mysql/innodb_table_stats and mysql/innodb_index_stats InnoDB tables before innodb_encryption test starts. These tables are also encrypted or decrypted, thus we need to wait also these tables (if not we could randomly get different results as system tablespace and these tables are encrypted or decrypted in parallel).
70 lines
2.5 KiB
Plaintext
70 lines
2.5 KiB
Plaintext
SET @start_global_value = @@global.innodb_encryption_threads;
|
|
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
|
Variable_name Value
|
|
innodb_encrypt_log ON
|
|
innodb_encrypt_tables ON
|
|
innodb_encryption_rotate_key_age 15
|
|
innodb_encryption_rotation_iops 100
|
|
innodb_encryption_threads 4
|
|
SET GLOBAL innodb_encrypt_tables = ON;
|
|
# Wait max 10 min for key encryption threads to encrypt all spaces
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
NAME
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
NAME
|
|
mysql/innodb_table_stats
|
|
mysql/innodb_index_stats
|
|
./ibdata1
|
|
# Success!
|
|
# Now turn off encryption and wait for threads to decrypt everything
|
|
SET GLOBAL innodb_encrypt_tables = off;
|
|
# Wait max 10 min for key encryption threads to encrypt all spaces
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
NAME
|
|
mysql/innodb_table_stats
|
|
mysql/innodb_index_stats
|
|
./ibdata1
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
NAME
|
|
# Success!
|
|
# Shutdown innodb_encryption_threads
|
|
SET GLOBAL innodb_encryption_threads=0;
|
|
# Turn on encryption
|
|
# since threads are off tables should remain unencrypted
|
|
SET GLOBAL innodb_encrypt_tables = on;
|
|
# Wait 15s to check that nothing gets encrypted
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
NAME
|
|
mysql/innodb_table_stats
|
|
mysql/innodb_index_stats
|
|
./ibdata1
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
NAME
|
|
# Success!
|
|
# Startup innodb_encryption_threads
|
|
SET GLOBAL innodb_encryption_threads=@start_global_value;
|
|
# Wait max 10 min for key encryption threads to encrypt all spaces
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
NAME
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
NAME
|
|
mysql/innodb_table_stats
|
|
mysql/innodb_index_stats
|
|
./ibdata1
|
|
# Success!
|
|
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
|
|
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
|
Variable_name Value
|
|
innodb_encrypt_log ON
|
|
innodb_encrypt_tables OFF
|
|
innodb_encryption_rotate_key_age 15
|
|
innodb_encryption_rotation_iops 100
|
|
innodb_encryption_threads 0
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
NAME
|
|
mysql/innodb_table_stats
|
|
mysql/innodb_index_stats
|
|
./ibdata1
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
NAME
|