summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-12-19 13:29:43 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2017-12-19 13:29:43 +0200
commita2367fc893d8adf9571b13f3e08d37e32226f32a (patch)
tree547cb9d6aee048e3328970893fc681781c4ecd6b
parentce4cdfa0f8691f47366d50acd6049b8cd7520e8a (diff)
downloadmariadb-git-bb-10.1-MDEV-14701.tar.gz
MDEV-14701: install_db shows corruption for rest encryption with innodb_data_file_path=ibdata1:3Mbb-10.1-MDEV-14701
Problem was that crypt_data->min_key_version is not a realible way to detect is tablespace encrypted and could lead that in first page of the second (page 192 and similarly for other files if more configured) system tablespace file used key_version is replaced with zero leading a corruption as in next startup page is though to be corrupted. fil_write_flushed_lsn Use crypt_data->should_encrypt() instead.
-rw-r--r--storage/innobase/fil/fil0fil.cc4
-rw-r--r--storage/xtradb/fil/fil0fil.cc3
2 files changed, 5 insertions, 2 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index ac30f3c7a25..c9ecf3dab0b 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -2085,7 +2085,9 @@ fil_write_flushed_lsn(
/* If tablespace is not encrypted, stamp flush_lsn to
first page of all system tablespace datafiles to avoid
unnecessary error messages on possible downgrade. */
- if (!space->crypt_data || space->crypt_data->min_key_version == 0) {
+ if (!space->crypt_data
+ || !space->crypt_data->should_encrypt()) {
+
fil_node_t* node;
ulint sum_of_sizes = 0;
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 00f2c44637e..9023b4446b5 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -2136,7 +2136,8 @@ fil_write_flushed_lsn(
/* If tablespace is not encrypted, stamp flush_lsn to
first page of all system tablespace datafiles to avoid
unnecessary error messages on possible downgrade. */
- if (!space->crypt_data || space->crypt_data->min_key_version == 0) {
+ if (!space->crypt_data
+ || !space->crypt_data->should_encrypt()) {
fil_node_t* node;
ulint sum_of_sizes = 0;