Skip to content

Commit ed7e4b6

Browse files
committed
DEV-14701: install_db shows corruption for rest encryption with innodb_data_file_path=ibdata1:3M
Problem was that crypt_data->min_key_version is not a reliable 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. Note that crypt_data->min_key_version is updated only after all pages from tablespace have been processed (i.e. key rotation is done) and flushed. fil_write_flushed_lsn Use crypt_data->should_encrypt() instead.
1 parent 252e690 commit ed7e4b6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,9 @@ fil_write_flushed_lsn(
20852085
/* If tablespace is not encrypted, stamp flush_lsn to
20862086
first page of all system tablespace datafiles to avoid
20872087
unnecessary error messages on possible downgrade. */
2088-
if (!space->crypt_data || space->crypt_data->min_key_version == 0) {
2088+
if (!space->crypt_data
2089+
|| !space->crypt_data->should_encrypt()) {
2090+
20892091
fil_node_t* node;
20902092
ulint sum_of_sizes = 0;
20912093

storage/xtradb/fil/fil0fil.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,8 @@ fil_write_flushed_lsn(
21362136
/* If tablespace is not encrypted, stamp flush_lsn to
21372137
first page of all system tablespace datafiles to avoid
21382138
unnecessary error messages on possible downgrade. */
2139-
if (!space->crypt_data || space->crypt_data->min_key_version == 0) {
2139+
if (!space->crypt_data
2140+
|| !space->crypt_data->should_encrypt()) {
21402141
fil_node_t* node;
21412142
ulint sum_of_sizes = 0;
21422143

0 commit comments

Comments
 (0)