Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24426

fil_crypt_thread keep spinning even if innodb_encryption_rotate_key_age=0

    XMLWordPrintable

Details

    Description

      With the following patch:

      diff --git a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
      index 8baef973470..265ee9fe2e0 100644
      --- a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
      +++ b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
      @@ -1,5 +1,5 @@
       --innodb-encryption-rotate-key-age=2
      ---innodb-encryption-threads=4
      +--innodb-encryption-threads=200
       --innodb-tablespaces-encryption
       --plugin-load-add=$FILE_KEY_MANAGEMENT_SO
       --loose-file-key-management
      

      and with the invocation

      ./mtr --start mariabackup.xb_compressed_encrypted
      

      I see high CPU usage on GNU/Linux on the 10.5 server. On the 10.6 server with MDEV-21452 fixed, the CPU usage is more moderate on GNU/Linux, but there is a huge amount of system calls. On Microsoft Windows, the changed system call pattern make the test run much slower, causing timeouts. This was successfully worked around by setting innodb_encryption_threads=1.

      The anomaly is caused by the fact that fil_crypt_return_iops() is waking up all fil_crypt_thread even though innodb_encryption_rotate_key_age=0 and there is no work to do.

      Unfortunately, for other settings than --innodb-encryption-rotate-key-age=0 a proper fix of this would require implementing a check whether the encryption plugin supports key versioning.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.