summaryrefslogtreecommitdiff
path: root/storage/innobase/fsp/fsp0file.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-08-29 14:23:34 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-08-31 08:36:56 +0300
commiteca238aea7925b3f165db7c8a0e03c5b3b179cf9 (patch)
tree9686c818f33aebfb223a7c508507d75f81595b1e /storage/innobase/fsp/fsp0file.cc
parent43b262af55db507320b165bb0f9abf05b2f05a89 (diff)
downloadmariadb-git-eca238aea7925b3f165db7c8a0e03c5b3b179cf9.tar.gz
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.
Diffstat (limited to 'storage/innobase/fsp/fsp0file.cc')
-rw-r--r--storage/innobase/fsp/fsp0file.cc7
1 files changed, 0 insertions, 7 deletions
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index 4f03ace9d8e..c21c9497735 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -58,11 +58,6 @@ Datafile::shutdown()
ut_free(m_name);
m_name = NULL;
-
- /* The fil_space_t::crypt_data was freed in
- fil_space_free_low(). Invalidate our redundant pointer. */
- m_crypt_info = NULL;
-
free_filepath();
free_first_page();
}
@@ -374,8 +369,6 @@ Datafile::read_first_page(bool read_only_mode)
return(DB_CORRUPTION);
}
- m_crypt_info = fil_space_read_crypt_data(ps, m_first_page);
-
return(err);
}