Skip to content

Commit 72cc73c

Browse files
author
Jan Lindström
committed
MDEV-10368: get_latest_version() called too often
Reduce 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.
1 parent 67b570a commit 72cc73c

File tree

18 files changed

+464
-207
lines changed

18 files changed

+464
-207
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6145,12 +6145,12 @@ buf_page_encrypt_before_write(
61456145
return src_frame;
61466146
}
61476147

6148-
if (crypt_data != NULL && crypt_data->encryption == FIL_SPACE_ENCRYPTION_OFF) {
6148+
if (crypt_data != NULL && crypt_data->not_encrypted()) {
61496149
/* Encryption is disabled */
61506150
encrypted = false;
61516151
}
61526152

6153-
if (!srv_encrypt_tables && (crypt_data == NULL || crypt_data->encryption == FIL_SPACE_ENCRYPTION_DEFAULT)) {
6153+
if (!srv_encrypt_tables && (crypt_data == NULL || crypt_data->is_default_encryption())) {
61546154
/* Encryption is disabled */
61556155
encrypted = false;
61566156
}

0 commit comments

Comments
 (0)