Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.14
-
linux
-
10.1.18, 10.2.4-1
Description
Data at rest encryption. MariaDB calls the get_latest_version() of the *_key_management plugins millions of times if innodb_encryption_threads>1 during data scrub.
Tested with file_key_management plugin, but it should not matter.
The issue can be seen at each background data scrub, so for testing purposes I have set the interval to 60 seconds:
innodb-background-scrub-data-check-interval=60
When using innodb_encryption_threads>1 the function get_latest_version() of the plugin is called millions of times, also cpu load raises considerably.
Using innodb_encryption_threads=1 there is no such issue.
Attachments
Issue Links
- relates to
-
MDEV-14398 When innodb_encryption_rotate_key_age=0 is set, server won't encrypt tablespaces
-
- Closed
-
http://lists.askmonty.org/pipermail/commits/2016-December/010241.html
commit 2093b7dd9807506b6f83af0969b22f27ab6c034e
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Thu Dec 8 10:24:30 2016 +0200
MDEV-10368: get_latest_version() called too oftenReduce the number of calls to encryption_get_key_get_latest_version
when doing key rotation with two different methods:
(1) We need to fetch key information when tablespace not yet
have a encryption information, invalid keys are handled now
differently (see below). There was extra call to detect
if key_id is not found on key rotation.
(2) If key_id is not found from encryption plugin, do not
try fetching new key_version for it as it will fail anyway.
We store return value from encryption_get_key_get_latest_version
call and if it returns ENCRYPTION_KEY_VERSION_INVALID there
is no need to call it again.