The fix for MDEV-10368 and MDEV-11587 introduced innodb_encryption_rotate_key_age=0 as a special value that disables key rotation entirely. This can help performance, since the key rotation checks seem to require a lot of CPU resources.
Unfortunately, when innodb_encryption_rotate_key_age=0 is set, it also seems to prevent the server from encrypting unencrypted tablespaces in the background.
To reproduce, do the following:
1.) Initialize a datadir without encryption enabled. You can ensure that the tablespaces are not encrypted by querying INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION and confirming that there are 0 rows.
MariaDB [(none)]> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION\G
|
Empty set (0.01 sec)
|
2.) Then change the configuration to enable encryption. Be sure to set innodb_encryption_rotate_key_age=0. I used the following configuration:
plugin-load-add=file_key_management
|
file-key-management
|
file_key_management_encryption_algorithm=aes_cbc
|
file_key_management_filename = /etc/my.cnf.d//keys.enc
|
file_key_management_filekey = secret
|
innodb-encrypt-tables
|
innodb-encrypt-log
|
innodb-encryption-threads=4
|
encrypt-tmp-disk-tables=1
|
encrypt-tmp-files=1
|
encrypt-binlog=1
|
innodb_encryption_rotate_key_age = 0
|
3.) Restart the server.
4.) Check whether the tablespaces are encrypted. They still are not:
MariaDB [(none)]> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION\G
|
Empty set (0.00 sec)
|
5.) Change the configuration so that innodb_encryption_rotate_key_age=0 is commented out.
6.) Restart the server.
7.) Check whether the tablespaces are encrypted. They are:
MariaDB [(none)]> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION\G
|
*************************** 1. row ***************************
|
SPACE: 1
|
NAME: mysql/innodb_table_stats
|
ENCRYPTION_SCHEME: 1
|
KEYSERVER_REQUESTS: 1
|
MIN_KEY_VERSION: 1
|
CURRENT_KEY_VERSION: 1
|
KEY_ROTATION_PAGE_NUMBER: NULL
|
KEY_ROTATION_MAX_PAGE_NUMBER: NULL
|
CURRENT_KEY_ID: 1
|
ROTATING_OR_FLUSHING: 0
|
*************************** 2. row ***************************
|
SPACE: 2
|
NAME: mysql/innodb_index_stats
|
ENCRYPTION_SCHEME: 1
|
KEYSERVER_REQUESTS: 1
|
MIN_KEY_VERSION: 1
|
CURRENT_KEY_VERSION: 1
|
KEY_ROTATION_PAGE_NUMBER: NULL
|
KEY_ROTATION_MAX_PAGE_NUMBER: NULL
|
CURRENT_KEY_ID: 1
|
ROTATING_OR_FLUSHING: 0
|
*************************** 3. row ***************************
|
SPACE: 3
|
NAME: mysql/gtid_slave_pos
|
ENCRYPTION_SCHEME: 1
|
KEYSERVER_REQUESTS: 1
|
MIN_KEY_VERSION: 1
|
CURRENT_KEY_VERSION: 1
|
KEY_ROTATION_PAGE_NUMBER: NULL
|
KEY_ROTATION_MAX_PAGE_NUMBER: NULL
|
CURRENT_KEY_ID: 1
|
ROTATING_OR_FLUSHING: 0
|
*************************** 4. row ***************************
|
SPACE: 0
|
NAME: innodb_system
|
ENCRYPTION_SCHEME: 1
|
KEYSERVER_REQUESTS: 1
|
MIN_KEY_VERSION: 1
|
CURRENT_KEY_VERSION: 1
|
KEY_ROTATION_PAGE_NUMBER: NULL
|
KEY_ROTATION_MAX_PAGE_NUMBER: NULL
|
CURRENT_KEY_ID: 1
|
ROTATING_OR_FLUSHING: 0
|
4 rows in set (0.00 sec)
|
{"report":{"fcp":778.8000000119209,"ttfb":206.09999999403954,"pageVisibility":"visible","entityId":64297,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"0f85d04c-e9fb-42e1-9ad2-48c15749b4f7","navigationType":0,"readyForUser":872.0999999940395,"redirectCount":0,"resourceLoadedEnd":858.5999999940395,"resourceLoadedStart":211.80000001192093,"resourceTiming":[{"duration":155.59999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":211.80000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":367.40000000596046,"responseStart":0,"secureConnectionStart":0},{"duration":155.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":212.09999999403954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":367.7000000178814,"responseStart":0,"secureConnectionStart":0},{"duration":164.2999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":212.30000001192093,"connectEnd":212.30000001192093,"connectStart":212.30000001192093,"domainLookupEnd":212.30000001192093,"domainLookupStart":212.30000001192093,"fetchStart":212.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":212.30000001192093,"responseEnd":376.59999999403954,"responseStart":376.59999999403954,"secureConnectionStart":212.30000001192093},{"duration":189.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":212.30000001192093,"connectEnd":212.30000001192093,"connectStart":212.30000001192093,"domainLookupEnd":212.30000001192093,"domainLookupStart":212.30000001192093,"fetchStart":212.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":212.30000001192093,"responseEnd":401.40000000596046,"responseStart":401.40000000596046,"secureConnectionStart":212.30000001192093},{"duration":192.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":212.59999999403954,"connectEnd":212.59999999403954,"connectStart":212.59999999403954,"domainLookupEnd":212.59999999403954,"domainLookupStart":212.59999999403954,"fetchStart":212.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":212.59999999403954,"responseEnd":404.90000000596046,"responseStart":404.90000000596046,"secureConnectionStart":212.59999999403954},{"duration":192.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":212.80000001192093,"connectEnd":212.80000001192093,"connectStart":212.80000001192093,"domainLookupEnd":212.80000001192093,"domainLookupStart":212.80000001192093,"fetchStart":212.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":212.80000001192093,"responseEnd":405.30000001192093,"responseStart":405.30000001192093,"secureConnectionStart":212.80000001192093},{"duration":192.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":213,"connectEnd":213,"connectStart":213,"domainLookupEnd":213,"domainLookupStart":213,"fetchStart":213,"redirectEnd":0,"redirectStart":0,"requestStart":213,"responseEnd":405.80000001192093,"responseStart":405.80000001192093,"secureConnectionStart":213},{"duration":193.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":213.2000000178814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.90000000596046,"responseStart":0,"secureConnectionStart":0},{"duration":192.90000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":213.30000001192093,"connectEnd":213.30000001192093,"connectStart":213.30000001192093,"domainLookupEnd":213.30000001192093,"domainLookupStart":213.30000001192093,"fetchStart":213.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":213.30000001192093,"responseEnd":406.2000000178814,"responseStart":406.2000000178814,"secureConnectionStart":213.30000001192093},{"duration":193.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":213.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":407,"responseStart":0,"secureConnectionStart":0},{"duration":193.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":213.59999999403954,"connectEnd":213.59999999403954,"connectStart":213.59999999403954,"domainLookupEnd":213.59999999403954,"domainLookupStart":213.59999999403954,"fetchStart":213.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":213.59999999403954,"responseEnd":406.90000000596046,"responseStart":406.90000000596046,"secureConnectionStart":213.59999999403954},{"duration":642.5999999940395,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":215.2000000178814,"connectEnd":215.2000000178814,"connectStart":215.2000000178814,"domainLookupEnd":215.2000000178814,"domainLookupStart":215.2000000178814,"fetchStart":215.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":215.2000000178814,"responseEnd":857.8000000119209,"responseStart":857.8000000119209,"secureConnectionStart":215.2000000178814},{"duration":643.2999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":215.30000001192093,"connectEnd":215.30000001192093,"connectStart":215.30000001192093,"domainLookupEnd":215.30000001192093,"domainLookupStart":215.30000001192093,"fetchStart":215.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":215.30000001192093,"responseEnd":858.5999999940395,"responseStart":858.5999999940395,"secureConnectionStart":215.30000001192093},{"duration":310.2999999821186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":603.3000000119209,"connectEnd":603.3000000119209,"connectStart":603.3000000119209,"domainLookupEnd":603.3000000119209,"domainLookupStart":603.3000000119209,"fetchStart":603.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":603.3000000119209,"responseEnd":913.5999999940395,"responseStart":913.5999999940395,"secureConnectionStart":603.3000000119209},{"duration":160,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":772.9000000059605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":772.9000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":932.9000000059605,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":15,"responseStart":206,"responseEnd":211,"domLoading":210,"domInteractive":953,"domContentLoadedEventStart":953,"domContentLoadedEventEnd":1001,"domComplete":1374,"loadEventStart":1374,"loadEventEnd":1375,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":934.8000000119209},{"name":"bigPipe.sidebar-id.end","time":935.5999999940395},{"name":"bigPipe.activity-panel-pipe-id.start","time":935.8000000119209},{"name":"bigPipe.activity-panel-pipe-id.end","time":938.0999999940395},{"name":"activityTabFullyLoaded","time":1014.3000000119209}],"measures":[],"correlationId":"7b7501f6e9082f","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":117,"dbReadsTimeInMs":24,"dbConnsTimeInMs":34,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}