summaryrefslogtreecommitdiff
path: root/storage/innobase/fil/fil0fil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/fil/fil0fil.cc')
-rw-r--r--storage/innobase/fil/fil0fil.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 329b250c94d..99cf15c7da0 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1001,22 +1001,28 @@ fil_space_t *fil_space_t::create(const char *name, ulint id, ulint flags,
fil_system.max_assigned_id = id;
}
+ const bool rotate=
+ (purpose == FIL_TYPE_TABLESPACE
+ && (mode == FIL_ENCRYPTION_ON || mode == FIL_ENCRYPTION_OFF
+ || srv_encrypt_tables)
+ && fil_crypt_must_default_encrypt());
+
/* Inform key rotation that there could be something
to do */
- if (purpose == FIL_TYPE_TABLESPACE
- && !srv_fil_crypt_rotate_key_age && fil_crypt_threads_event &&
- (mode == FIL_ENCRYPTION_ON || mode == FIL_ENCRYPTION_OFF
- || srv_encrypt_tables)) {
+ if (rotate) {
/* Key rotation is not enabled, need to inform background
encryption threads. */
fil_system.default_encrypt_tables.push_back(*space);
space->is_in_default_encrypt = true;
mutex_exit(&fil_system.mutex);
- os_event_set(fil_crypt_threads_event);
} else {
mutex_exit(&fil_system.mutex);
}
+ if (rotate && fil_crypt_threads_event) {
+ os_event_set(fil_crypt_threads_event);
+ }
+
return(space);
}