# ---------------------------------------------------------------------- # 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 # ---------------------------------------------------------------------- ######### # SETUP # ######### ######################################################################### # RESTART 1 : WITH KEYRING PLUGIN ######################################################################### #-------------------------- TEST 1 -------------------------------------# 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 # Set Encryption process to crash just after making DDL Entry SET SESSION debug= '+d,alter_encrypt_tablespace_crash_after_ddl_entry'; # Encrypt the tablespace. It will cause crash. ALTER TABLESPACE encrypt_ts ENCRYPTION='Y'; ######################################################################### # RESTART 2 : WITH KEYRING PLUGIN after crash ######################################################################### # INJECT error TOO_MANY_CONCURRENT_TXNS in startup location DDL_Log_remove_inject_startup_error_1. # It will cause FATAL error and server abort. # Search the failure pattern in error log Pattern "ENCRYPTION for tablespace encrypt_ts:[0-9]+ could not be done successfully" found DROP TABLE t1; DROP TABLESPACE encrypt_ts; ######################################################################### # RESTART 3 : normally ######################################################################### #-------------------------- TEST 2 -------------------------------------# 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 # Set Encryption process to crash just after making DDL Entry SET SESSION debug= '+d,alter_encrypt_tablespace_crash_after_ddl_entry'; # Encrypt the tablespace. It will cause crash. ALTER TABLESPACE encrypt_ts ENCRYPTION='Y'; ######################################################################### # RESTART 4 : WITH KEYRING PLUGIN after crash ######################################################################### # INJECT error TOO_MANY_CONCURRENT_TXNS in startup location DDL_Log_remove_inject_startup_error_2. # It will cause FATAL error and server abort. # Search the failure pattern in error log Pattern "\[FATAL\] Error in DDL Log recovery during Post-Recovery processing." found ######################################################################### # RESTART 4 : normally ######################################################################### DROP TABLE t1; DROP TABLESPACE encrypt_ts; ########### # Cleanup # ########### ######################################################################### # RESTART 5 : final ######################################################################### # ---------------------------------------------------------------------- # 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 # ----------------------------------------------------------------------