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

InnoDB removes the tablespace from default encrypt list early

    XMLWordPrintable

Details

    Description

      Scenario is like the following:

      • When one of the encryption thread does decryption of tablespace. (flushing of rotated pages happening)
      • Test case sets INNODB_ENCRYPT_TABLES = 1
      • Other encryption thread does check whether the space is eligible for key rotation
        and removes it from default encrypt list.

       
      encryption.innodb_encryption_filekeys 'cbc,innodb' w2 [ fail ]
              Test ended at 2021-06-21 18:39:22
       
      CURRENT_TEST: encryption.innodb_encryption_filekeys
      mysqltest: At line 116: Timeout waiting for encryption threads
       
      CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
      CREATE TABLE t3 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO;
      CREATE TABLE t4 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
      SET GLOBAL innodb_encrypt_tables = on;
      # Wait max 10 min for key encryption threads to encrypt required all spaces
      SELECT NAME,ENCRYPTION_SCHEME,MIN_KEY_VERSION, ROTATING_OR_FLUSHING FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
      NAME    ENCRYPTION_SCHEME       MIN_KEY_VERSION ROTATING_OR_FLUSHING
      innodb_system   0       0       0
      mysql/innodb_table_stats        1       1       0
      mysql/innodb_index_stats        1       1       0
      mysql/transaction_registry      1       1       0
      test/t1 1       1       0
      test/t2 1       1       0
      test/t3 0       0       0
      test/t4 1       1       0
      SHOW STATUS LIKE 'innodb_encryption%';
      Variable_name   Value
      Innodb_encryption_rotation_pages_read_from_cache        3065
      Innodb_encryption_rotation_pages_read_from_disk 32
      Innodb_encryption_rotation_pages_modified       2958
      Innodb_encryption_rotation_pages_flushed        3274
      Innodb_encryption_rotation_estimated_iops       64159
      Innodb_encryption_key_rotation_list_length      0
      Innodb_encryption_n_merge_blocks_encrypted      0
      Innodb_encryption_n_merge_blocks_decrypted      0
      Innodb_encryption_n_rowlog_blocks_encrypted     0
      Innodb_encryption_n_rowlog_blocks_decrypted     0
      
      

      Solution could be the only the last active encryption thread working on the thread
      should be allowed to remove the tablespace from default encrypt list.
      Right now, the Workaround can be set global innodb_encrypt_tables= ON/OFF; as per user wish.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              thiru Thirunarayanan Balathandayuthapani
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.