Browse Source
MDEV-13557: Startup failure, unable to decrypt ibdata1
MDEV-13557: Startup failure, unable to decrypt ibdata1
Fixes also MDEV-13488: InnoDB writes CRYPT_INFO even though encryption is not enabled. Fixes also MDEV-13093: Leak of Datafile::m_crypt_info on shutdown after failed startup. Problem was that we created encryption metadata (crypt_data) for system tablespace even when no encryption was enabled and too early. System tablespace can be encrypted only using key rotation. Test innodb-key-rotation-disable, innodb_encryption, innodb_lotoftables require adjustment because INFORMATION_SCHEMA INNODB_TABLESPACES_ENCRYPTION contain row only if tablespace really has encryption metadata. xb_load_single_table_tablespace(): Do not call fil_space_destroy_crypt_data() any more, because Datafile::m_crypt_data has been removed. fil_crypt_realloc_iops(): Avoid divide by zero. fil_crypt_set_thread_cnt(): Set fil_crypt_threads_event if encryption threads exist. This is required to find tablespaces requiring key rotation if no other changes happen. fil_crypt_find_space_to_rotate(): Decrease the amount of time waiting when nothing happens to better enable key rotation on startup. fil_ibd_open(), fil_ibd_load(): Load possible crypt_data from first page. class Datafile, class SysTablespace : remove m_crypt_info field. Datafile::get_first_page(): Return a pointer to first page buffer. fsp_header_init(): Write encryption metadata to page 0 only if tablespace is encrypted or encryption is disabled by table option. i_s_dict_fill_tablespaces_encryption(): Skip tablespaces that do not contain encryption metadata. This is required to avoid too early wait condition trigger in encrypted -> unencrypted state transfer.pull/185/merge
committed by
Marko Mäkelä
17 changed files with 1331 additions and 381 deletions
-
4extra/mariabackup/xtrabackup.cc
-
61mysql-test/suite/encryption/r/innodb-first-page-read.result
-
3mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
-
58mysql-test/suite/encryption/r/innodb_encryption.result
-
1182mysql-test/suite/encryption/r/innodb_lotoftables.result
-
32mysql-test/suite/encryption/t/innodb-first-page-read.test
-
167mysql-test/suite/encryption/t/innodb_encryption.test
-
91mysql-test/suite/encryption/t/innodb_lotoftables.test
-
23storage/innobase/fil/fil0crypt.cc
-
24storage/innobase/fil/fil0fil.cc
-
7storage/innobase/fsp/fsp0file.cc
-
8storage/innobase/fsp/fsp0fsp.cc
-
2storage/innobase/fsp/fsp0space.cc
-
13storage/innobase/fsp/fsp0sysspace.cc
-
7storage/innobase/handler/i_s.cc
-
24storage/innobase/include/fsp0file.h
-
6storage/innobase/include/fsp0sysspace.h
1182
mysql-test/suite/encryption/r/innodb_lotoftables.result
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue