mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-23776: Re-apply the fix and make the test more robust
The test that was added in commite05650e686
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 commiteb38b1f703
we can safely re-apply those fixes.
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
|
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
|
||||||
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;
|
|
||||||
SET default_storage_engine = InnoDB;
|
SET default_storage_engine = InnoDB;
|
||||||
SET GLOBAL innodb_encryption_threads = 4;
|
SET GLOBAL innodb_encryption_threads = 4;
|
||||||
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;
|
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;
|
|||||||
drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
|
drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
|
||||||
table10_int_autoinc;
|
table10_int_autoinc;
|
||||||
SET GLOBAL innodb_encryption_threads = @save_threads;
|
SET GLOBAL innodb_encryption_threads = @save_threads;
|
||||||
SET GLOBAL innodb_encrypt_tables = @save_tables;
|
|
||||||
|
1
mysql-test/suite/encryption/t/create_or_replace.opt
Normal file
1
mysql-test/suite/encryption/t/create_or_replace.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--innodb-encrypt-tables
|
@ -3,7 +3,6 @@
|
|||||||
--source include/count_sessions.inc
|
--source include/count_sessions.inc
|
||||||
|
|
||||||
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
|
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
|
||||||
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;
|
|
||||||
|
|
||||||
SET default_storage_engine = InnoDB;
|
SET default_storage_engine = InnoDB;
|
||||||
|
|
||||||
@ -76,5 +75,4 @@ drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
|
|||||||
table10_int_autoinc;
|
table10_int_autoinc;
|
||||||
|
|
||||||
SET GLOBAL innodb_encryption_threads = @save_threads;
|
SET GLOBAL innodb_encryption_threads = @save_threads;
|
||||||
SET GLOBAL innodb_encrypt_tables = @save_tables;
|
|
||||||
--source include/wait_until_count_sessions.inc
|
--source include/wait_until_count_sessions.inc
|
||||||
|
@ -1483,6 +1483,11 @@ static bool fil_crypt_find_space_to_rotate(
|
|||||||
{
|
{
|
||||||
/* we need iops to start rotating */
|
/* we need iops to start rotating */
|
||||||
while (!state->should_shutdown() && !fil_crypt_alloc_iops(state)) {
|
while (!state->should_shutdown() && !fil_crypt_alloc_iops(state)) {
|
||||||
|
if (state->space && state->space->is_stopping()) {
|
||||||
|
fil_space_release(state->space);
|
||||||
|
state->space = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
os_event_reset(fil_crypt_threads_event);
|
os_event_reset(fil_crypt_threads_event);
|
||||||
os_event_wait_time(fil_crypt_threads_event, 100000);
|
os_event_wait_time(fil_crypt_threads_event, 100000);
|
||||||
}
|
}
|
||||||
@ -2506,6 +2511,7 @@ fil_space_crypt_close_tablespace(
|
|||||||
|
|
||||||
/* wakeup throttle (all) sleepers */
|
/* wakeup throttle (all) sleepers */
|
||||||
os_event_set(fil_crypt_throttle_sleep_event);
|
os_event_set(fil_crypt_throttle_sleep_event);
|
||||||
|
os_event_set(fil_crypt_threads_event);
|
||||||
|
|
||||||
os_thread_sleep(20000);
|
os_thread_sleep(20000);
|
||||||
dict_mutex_enter_for_mysql();
|
dict_mutex_enter_for_mysql();
|
||||||
|
Reference in New Issue
Block a user