Skip to content

Commit 2af8f71

Browse files
committed
MDEV-23776: Re-apply the fix and make the test more robust
The test that was added in commit e05650e would break a subsequent run of a test encryption.innodb-bad-key-change because some pages in the system tablespace would be encrypted with a different key. The failure was repeatable with the following invocation: ./mtr --no-reorder \ encryption.create_or_replace,cbc \ encryption.innodb-bad-key-change,cbc Because the crash was unrelated to the code changes that we reverted in commit eb38b1f we can safely re-apply those fixes.
1 parent 732cd7f commit 2af8f71

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

mysql-test/suite/encryption/r/create_or_replace.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
2-
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;
32
SET default_storage_engine = InnoDB;
43
SET GLOBAL innodb_encryption_threads = 4;
54
CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
@@ -18,4 +17,3 @@ connection default;
1817
drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
1918
table10_int_autoinc;
2019
SET GLOBAL innodb_encryption_threads = @save_threads;
21-
SET GLOBAL innodb_encrypt_tables = @save_tables;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--innodb-encrypt-tables

mysql-test/suite/encryption/t/create_or_replace.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
--source include/count_sessions.inc
44

55
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
6-
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;
76

87
SET default_storage_engine = InnoDB;
98

@@ -76,5 +75,4 @@ drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
7675
table10_int_autoinc;
7776

7877
SET GLOBAL innodb_encryption_threads = @save_threads;
79-
SET GLOBAL innodb_encrypt_tables = @save_tables;
8078
--source include/wait_until_count_sessions.inc

storage/innobase/fil/fil0crypt.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,11 @@ static bool fil_crypt_find_space_to_rotate(
14831483
{
14841484
/* we need iops to start rotating */
14851485
while (!state->should_shutdown() && !fil_crypt_alloc_iops(state)) {
1486+
if (state->space && state->space->is_stopping()) {
1487+
fil_space_release(state->space);
1488+
state->space = NULL;
1489+
}
1490+
14861491
os_event_reset(fil_crypt_threads_event);
14871492
os_event_wait_time(fil_crypt_threads_event, 100000);
14881493
}
@@ -2506,6 +2511,7 @@ fil_space_crypt_close_tablespace(
25062511

25072512
/* wakeup throttle (all) sleepers */
25082513
os_event_set(fil_crypt_throttle_sleep_event);
2514+
os_event_set(fil_crypt_threads_event);
25092515

25102516
os_thread_sleep(20000);
25112517
dict_mutex_enter_for_mysql();

0 commit comments

Comments
 (0)