MDEV-24426 fil_crypt_thread keep spinning even if innodb_encryption_rotate_key_age=0

After MDEV-15528, two modes of operation in the fil_crypt_thread
remains, depending on whether innodb_encryption_rotate_key_age=0
(whether key rotation is disabled). If the key rotation is disabled,
the fil_crypt_thread miss the opportunity to sleep, which will result
in lots of wasted CPU usage.

fil_crypt_return_iops(): Add a parameter to specify whether other
fil_crypt_thread should be woken up.

fil_system_t::keyrotate_next(): Return the special value
fil_system.temp_space to indicate that no work is to be done.

fil_space_t::next(): Propagage the special value fil_system.temp_space
to the caller.

fil_crypt_find_space_to_rotate(): If no work is to be done,
do not wake up other threads.
This commit is contained in:
Marko Mäkelä 2020-12-17 13:46:21 +02:00
commit 1fe3dd003a
2 changed files with 39 additions and 20 deletions

View file

@ -1,4 +1,4 @@
--innodb-encryption-rotate-key-age=2
--innodb-encryption-rotate-key-age=0
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO