Details
Description
http://buildbot.askmonty.org/buildbot/builders/kvm-fulltest2/builds/9511/steps/test_2/logs/stdio
encryption.encrypt_and_grep 'cbc,innodb' w4 [ fail ]
|
Test ended at 2017-09-08 05:21:32
|
|
CURRENT_TEST: encryption.encrypt_and_grep
|
--- /mnt/buildbot/build/mariadb-10.2.9/mysql-test/suite/encryption/r/encrypt_and_grep.result 2017-09-08 01:57:14.000000000 +0300
|
+++ /mnt/buildbot/build/mariadb-10.2.9/mysql-test/suite/encryption/r/encrypt_and_grep.reject 2017-09-08 05:21:32.000000000 +0300
|
@@ -14,11 +14,8 @@
|
test/t3
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
NAME
|
-mysql/innodb_table_stats
|
-mysql/innodb_index_stats
|
test/t1
|
test/t2
|
-innodb_system
|
# t1 yes on expecting NOT FOUND
|
NOT FOUND /foobarsecret/ in t1.ibd
|
# t2 ... on expecting NOT FOUND
|
@@ -30,10 +27,16 @@
|
# 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 decrypt all spaces
|
+Timeout in wait_condition.inc for SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0;
|
+Id User Host db Command Time State Info Progress
|
+1 system user NULL Daemon NULL InnoDB purge coordinator NULL 0.000
|
+2 system user NULL Daemon NULL InnoDB purge worker NULL 0.000
|
+3 system user NULL Daemon NULL InnoDB purge worker NULL 0.000
|
+4 system user NULL Daemon NULL InnoDB purge worker NULL 0.000
|
+5 system user NULL Daemon NULL InnoDB shutdown handler NULL 0.000
|
+8 root localhost test Query 0 init show full processlist 0.000
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
NAME
|
-mysql/innodb_table_stats
|
-mysql/innodb_index_stats
|
test/t2
|
test/t3
|
innodb_system
|
|
mysqltest: Result length mismatch
|
This is a basic race condition.
The test assumes, that all existing tablespaces are immediately visible in INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION, and then only the key version changes when the tablespaces get encrypted; but it is not so. It takes time for tablespaces to appear in the I_S table, the simple crude test below shows it (it's for demonstration purposes only, do not put it in the test suite!):
suite/encryption/t/t1.opt
--innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
--plugin-load-add=file_key_management
--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
suite/encryption/t/t1.test
-- source include/have_innodb.inc
--sleep 5
If you run it with --repeat=N --force-restart, you get all kinds of results:
NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
NAME
innodb_system
NAME
innodb_system
mysql/innodb_table_stats
etc.
I'll leave it to jplindst to decide whether it's the test that has unreasonable expectations, or something goes wrong with INNODB_TABLESPACES_ENCRYPTION.
Upd:
While it doesn't seem to be happening in buildbot on 10.1, the same race condition technically applies there, so I've added it to Affects/Fix versions.