Commit 21e53351 authored by Jan Lindström's avatar Jan Lindström

MDEV-9962: encryption.innodb_encryption_filekeys stalled waiting for key...

MDEV-9962: encryption.innodb_encryption_filekeys stalled waiting for key encryption threads to decrypt all required spaces

Test changes.
parent d3fbff38
call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = OFF; SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encryption_threads = 4;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
...@@ -14,24 +12,21 @@ t1 CREATE TABLE `t1` ( ...@@ -14,24 +12,21 @@ t1 CREATE TABLE `t1` (
CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES; CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
CREATE TABLE t3 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO; CREATE TABLE t3 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO;
CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t2 select * from t1;
INSERT INTO t3 select * from t1;
INSERT INTO t4 select * from t1;
SET GLOBAL innodb_encrypt_tables = on; SET GLOBAL innodb_encrypt_tables = on;
# Wait max 10 min for key encryption threads to encrypt required all spaces # Wait max 10 min for key encryption threads to encrypt required all spaces
# Success! # Success!
SELECT COUNT(1) FROM t1; SELECT COUNT(1) FROM t1;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t2; SELECT COUNT(1) FROM t2;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t3; SELECT COUNT(1) FROM t3;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t4; SELECT COUNT(1) FROM t4;
COUNT(1) COUNT(1)
400 10
SET GLOBAL innodb_encrypt_tables = off; SET GLOBAL innodb_encrypt_tables = off;
# Wait max 10 min for key encryption threads to decrypt all required spaces # Wait max 10 min for key encryption threads to decrypt all required spaces
# Success! # Success!
...@@ -50,18 +45,17 @@ INSERT INTO t5 select * from t1; ...@@ -50,18 +45,17 @@ INSERT INTO t5 select * from t1;
# Success! # Success!
SELECT COUNT(1) FROM t1; SELECT COUNT(1) FROM t1;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t2; SELECT COUNT(1) FROM t2;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t3; SELECT COUNT(1) FROM t3;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t4; SELECT COUNT(1) FROM t4;
COUNT(1) COUNT(1)
400 10
SELECT COUNT(1) FROM t5; SELECT COUNT(1) FROM t5;
COUNT(1) COUNT(1)
400 10
drop table t1,t2,t3,t4, t5; drop table t1,t2,t3,t4, t5;
set GLOBAL innodb_default_encryption_key_id=1;
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc -- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
--disable_query_log --disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`; let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $encrypt_tables = `SELECT @@innodb_encrypt_tables`; let $encrypt_tables = `SELECT @@innodb_encrypt_tables`;
let $threads = `SELECT @@innodb_encryption_threads`; let $threads = `SELECT @@innodb_encryption_threads`;
let $key_id = `SELECT @@innodb_default_encryption_key_id`;
--enable_query_log --enable_query_log
--disable_warnings
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = OFF; SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encryption_threads = 4;
--enable_warnings
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -25,21 +22,20 @@ CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNOD ...@@ -25,21 +22,20 @@ CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNOD
--disable_warnings --disable_warnings
--disable_query_log --disable_query_log
set autocommit=0; begin;
let $i = 400; let $i = 10;
while ($i) while ($i)
{ {
INSERT INTO t1 values(NULL, substring(MD5(RAND()), -128)); INSERT INTO t1 values(NULL, substring(MD5(RAND()), -128));
dec $i; dec $i;
} }
commit;
set autocommit=1;
--enable_warnings
--enable_query_log
INSERT INTO t2 select * from t1; INSERT INTO t2 select * from t1;
INSERT INTO t3 select * from t1; INSERT INTO t3 select * from t1;
INSERT INTO t4 select * from t1; INSERT INTO t4 select * from t1;
commit;
--enable_warnings
--enable_query_log
SET GLOBAL innodb_encrypt_tables = on; SET GLOBAL innodb_encrypt_tables = on;
...@@ -60,7 +56,7 @@ while ($cnt) ...@@ -60,7 +56,7 @@ while ($cnt)
} }
if (!$success) if (!$success)
{ {
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; SELECT NAME,ENCRYPTION_SHCEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%'; SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads -- die Timeout waiting for encryption threads
} }
...@@ -90,7 +86,7 @@ while ($cnt) ...@@ -90,7 +86,7 @@ while ($cnt)
} }
if (!$success) if (!$success)
{ {
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; SELECT NAME,ENCRYPTION_SHCEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%'; SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads -- die Timeout waiting for encryption threads
} }
...@@ -119,7 +115,7 @@ while ($cnt) ...@@ -119,7 +115,7 @@ while ($cnt)
} }
if (!$success) if (!$success)
{ {
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; SELECT NAME,ENCRYPTION_SHCEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%'; SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads -- die Timeout waiting for encryption threads
} }
...@@ -131,15 +127,16 @@ SELECT COUNT(1) FROM t3; ...@@ -131,15 +127,16 @@ SELECT COUNT(1) FROM t3;
SELECT COUNT(1) FROM t4; SELECT COUNT(1) FROM t4;
SELECT COUNT(1) FROM t5; SELECT COUNT(1) FROM t5;
drop table t1,t2,t3,t4, t5;
# reset system # reset system
--disable_query_log --disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; --disable_warnings
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables; EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables;
EVAL SET GLOBAL innodb_encryption_threads = $threads; EVAL SET GLOBAL innodb_encryption_threads = $threads;
EVAL set GLOBAL innodb_default_encryption_key_id = $key_id;
--enable_warnings
--enable_query_log --enable_query_log
drop table t1,t2,t3,t4, t5;
set GLOBAL innodb_default_encryption_key_id=1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment