# ---------------------------------------------------------------------- # Setup # Creating local configuration file for keyring component: component_keyring_file # Creating manifest file for current MySQL server instance # Re-starting mysql server with manifest file # ---------------------------------------------------------------------- ######################################################################### # START : WITHOUT KEYRING PLUGIN ######################################################################### # Taking backup of local manifest file for MySQL server instance ######### # SETUP # ######### CREATE TABLESPACE encrypt_ts ADD DATAFILE 'encrypt_ts.ibd' ENGINE=InnoDB ENCRYPTION="N"; CREATE TABLE t1(c1 char(100)) ENGINE=InnoDB TABLESPACE encrypt_ts; set global innodb_buf_flush_list_now = 1; SELECT NAME, ENCRYPTION FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE NAME='encrypt_ts'; NAME ENCRYPTION encrypt_ts N SELECT * FROM t1 LIMIT 10; c1 SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES ALTER TABLESPACE encrypt_ts ENCRYPTION='Y'; ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring is loaded and initialized successfully. ############################################################# # TEST 1 : CRASH DURING ALTER ENCRYPT A TABLESPACE. ############################################################# ######################################################################### # RESTART 1 : WITH KEYRING PLUGIN ######################################################################### # Restore local manifest file for MySQL server instance from backup ############################################################ # ALTER TABLESPACE 1 : Unencrypted => Encrypted # # (crash at page 10) # ############################################################ # Set Encryption process to crash at page 10 SET SESSION debug= '+d,alter_encrypt_tablespace_page_10'; SET GLOBAL innodb_log_checkpoint_now = ON; SET GLOBAL innodb_page_cleaner_disabled_debug = 1; SET GLOBAL innodb_dict_stats_disabled_debug = 1; SET GLOBAL innodb_master_thread_disabled_debug = 1; # Encrypt the tablespace. It will cause crash. ALTER TABLESPACE encrypt_ts ENCRYPTION='Y'; # Restart after crash without Keyring plugin loaded # Taking backup of local manifest file for MySQL server instance Pattern "CORRUPT LOG RECORD FOUND" found # Server shouldn't have restarted, so query should fail. SELECT * from test.t1 limit 10; Got one of the listed errors ######################################################################### # RESTART 2 : WITH KEYRING PLUGIN ######################################################################### # Restore local manifest file for MySQL server instance from backup # Server should have restarted properly. SELECT * from test.t1 limit 10; c1 SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES SOME VALUES ########### # Cleanup # ########### DROP TABLE t1; DROP TABLESPACE encrypt_ts; # ---------------------------------------------------------------------- # Teardown # Removing manifest file for current MySQL server instance # Removing local keyring file for keyring component: component_keyring_file # Removing local configuration file for keyring component: component_keyring_file # Restarting server without the manifest file # ----------------------------------------------------------------------