1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-36556: MariaDB restart after upgrade fails with innodb_encrypt_tables

ibuf_upgrade_needed(): Adjust the check for the case that the
InnoDB system tablespace had been created without
innodb_checksum_algorithm=full_crc32 and innodb_encrypt_tables
was enabled at the time the change buffer was upgraded.
This commit is contained in:
Marko Mäkelä
2025-10-07 09:59:59 +03:00
parent 5b72e95a8c
commit d7d7304d9b
4 changed files with 15 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
SET GLOBAL innodb_encrypt_tables=ON,innodb_encryption_threads=1;
SET GLOBAL innodb_saved_page_number_debug=4,innodb_fil_make_page_dirty_debug=0;
CREATE TABLE t1(f1 text, index idx(f1(20))) ENGINE INNODB;
set global innodb_fast_shutdown=0;
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0

View File

@@ -0,0 +1,4 @@
[full_crc32]
--innodb-checksum-algorithm=full_crc32
[crc32]
--innodb-checksum-algorithm=crc32

View File

@@ -5,6 +5,9 @@
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let MYSQLD_DATADIR=`select @@datadir`;
# Encrypt the change buffer root page
SET GLOBAL innodb_encrypt_tables=ON,innodb_encryption_threads=1;
SET GLOBAL innodb_saved_page_number_debug=4,innodb_fil_make_page_dirty_debug=0;
CREATE TABLE t1(f1 text, index idx(f1(20))) ENGINE INNODB;

View File

@@ -1046,10 +1046,13 @@ dberr_t ibuf_upgrade_needed()
if (!root)
goto err_exit;
const size_t payload= fil_system.sys_space->full_crc32() ||
!fil_system.sys_space->crypt_data
? FIL_PAGE_TYPE : FIL_PAGE_SPACE_ID;
if (UNIV_LIKELY(!page_has_siblings(root->page.frame)) &&
UNIV_LIKELY(!memcmp(root->page.frame + FIL_PAGE_TYPE, field_ref_zero,
srv_page_size -
(FIL_PAGE_DATA_END + FIL_PAGE_TYPE))))
UNIV_LIKELY(!memcmp(root->page.frame + payload, field_ref_zero,
srv_page_size - (FIL_PAGE_DATA_END + payload))))
/* the change buffer was removed; no need to upgrade */;
else if (page_is_comp(root->page.frame) ||
btr_page_get_index_id(root->page.frame) != ibuf_index_id ||