summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-09-21 15:55:27 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-09-21 15:55:27 +0300
commite33f7b6faaacf49881fd913115b0735c62aba395 (patch)
treef715638747ba1ef1730b5c5a5c05532a57f653f8
parenta3bdce8f1e268e3ac57644faf91c9c5ad43f5291 (diff)
downloadmariadb-git-e33f7b6faaacf49881fd913115b0735c62aba395.tar.gz
MDEV-23776 Test encryption.create_or_replace fails with a warning
The test encryption.create_or_replace would occasionally fail with a warning message from fil_check_pending_ops(). fil_crypt_find_space_to_rotate(): While waiting for available I/O capacity, check fil_space_t::is_stopping() and release a handle if necessary. fil_space_crypt_close_tablespace(): Wake up the waiters in fil_crypt_find_space_to_rotate().
-rw-r--r--storage/innobase/fil/fil0crypt.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 09f2730edec..16b2093b691 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1483,6 +1483,11 @@ static bool fil_crypt_find_space_to_rotate(
{
/* we need iops to start rotating */
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_wait_time(fil_crypt_threads_event, 100000);
}
@@ -2506,6 +2511,7 @@ fil_space_crypt_close_tablespace(
/* wakeup throttle (all) sleepers */
os_event_set(fil_crypt_throttle_sleep_event);
+ os_event_set(fil_crypt_threads_event);
os_thread_sleep(20000);
dict_mutex_enter_for_mysql();