mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
MDEV-36180 Doublewrite recovery of innodb_checksum_algorithm=full_crc32 page_compressed pages does not work
- InnoDB fails to recover the full crc32 page_compressed page from doublewrite buffer. The reason is that buf_dblwr_t::recover() fails to identify the space id from the page because the page has compressed from FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION bytes. Fix: === recv_dblwr_t::find_deferred_page(): Find the page which has the same page number and try to decompress/decrypt the page based on the tablespace metadata. After the decompression/decryption, compare the space id and write the recovered page back to the file. buf_page_t::read_complete(): Page read from disk is corrupted then try to read the page from deferred pages in doublewrite buffer.
This commit is contained in:
committed by
Sergei Golubchik
parent
19c4e1abe4
commit
a390aaaf23
@@ -3,8 +3,9 @@ call mtr.add_suppression("InnoDB: Unable to apply log to corrupted page ");
|
||||
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
||||
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
|
||||
create table t1 (f1 int primary key, f2 blob)page_compressed = 1 engine=innodb stats_persistent=0;
|
||||
create table t2(f1 int primary key, f2 blob)engine=innodb stats_persistent=0;
|
||||
create table t1 (f1 int primary key, f2 blob)page_compressed=1 engine=innodb encrypted=yes stats_persistent=0;
|
||||
create table t2(f1 int primary key, f2 blob)engine=innodb encrypted=yes stats_persistent=0;
|
||||
create table t3(f1 int primary key, f2 blob)page_compressed=1 engine=innodb encrypted=no stats_persistent=0;
|
||||
start transaction;
|
||||
insert into t1 values(1, repeat('#',12));
|
||||
insert into t1 values(2, repeat('+',12));
|
||||
@@ -12,29 +13,37 @@ insert into t1 values(3, repeat('/',12));
|
||||
insert into t1 values(4, repeat('-',12));
|
||||
insert into t1 values(5, repeat('.',12));
|
||||
insert into t2 select * from t1;
|
||||
insert into t3 select * from t1;
|
||||
commit work;
|
||||
SET GLOBAL innodb_fast_shutdown = 0;
|
||||
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
|
||||
select space into @t1_space_id from information_schema.innodb_sys_tablespaces where name='test/t1';
|
||||
select space into @t2_space_id from information_schema.innodb_sys_tablespaces where name='test/t2';
|
||||
select space into @t3_space_id from information_schema.innodb_sys_tablespaces where name='test/t3';
|
||||
begin;
|
||||
insert into t1 values (6, repeat('%', 400));
|
||||
insert into t2 values (6, repeat('%', 400));
|
||||
insert into t3 values (6, repeat('%', 400));
|
||||
# xtrabackup prepare
|
||||
set global innodb_saved_page_number_debug = 3;
|
||||
set global innodb_fil_make_page_dirty_debug = @t1_space_id;
|
||||
set global innodb_saved_page_number_debug = 3;
|
||||
set global innodb_fil_make_page_dirty_debug = @t2_space_id;
|
||||
set global innodb_saved_page_number_debug = 3;
|
||||
set global innodb_fil_make_page_dirty_debug = @t3_space_id;
|
||||
set global innodb_buf_flush_list_now = 1;
|
||||
# Kill the server
|
||||
# restart
|
||||
FOUND 2 /InnoDB: Recovered page \[page id: space=[1-9]*, page number=3\]/ in mysqld.1.err
|
||||
FOUND 3 /InnoDB: Recovered page \[page id: space=[1-9]*, page number=3\]/ in mysqld.1.err
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
check table t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 check status OK
|
||||
check table t3;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t3 check status OK
|
||||
select f1, f2 from t1;
|
||||
f1 f2
|
||||
1 ############
|
||||
@@ -49,6 +58,13 @@ f1 f2
|
||||
3 ////////////
|
||||
4 ------------
|
||||
5 ............
|
||||
select f1, f2 from t3;
|
||||
f1 f2
|
||||
1 ############
|
||||
2 ++++++++++++
|
||||
3 ////////////
|
||||
4 ------------
|
||||
5 ............
|
||||
SET GLOBAL innodb_fast_shutdown = 0;
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
@@ -78,4 +94,4 @@ f1 f2
|
||||
3 ////////////
|
||||
4 ------------
|
||||
5 ............
|
||||
drop table t2, t1;
|
||||
drop table t3, t2, t1;
|
||||
|
Reference in New Issue
Block a user