1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge 10.4 into 10.5

A conflict between MDEV-19514 (b42294bc64)
and MDEV-20934 (d7a2401750)
was resolved. We will not invoke the function ibuf_delete_recs()
from ibuf_merge_or_delete_for_page(). Instead, we will add that
logic to the function ibuf_read_merge_pages().
This commit is contained in:
Marko Mäkelä
2019-11-07 10:34:33 +02:00
27 changed files with 444 additions and 143 deletions

View File

@@ -21,6 +21,11 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
# restart: --innodb-force-recovery=6 --innodb-change-buffer-dump
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check Warning InnoDB: Index 'b' contains #### entries, should be 4096.
test.t1 check error Corrupt
# restart
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
InnoDB 0 transactions not purged
SET GLOBAL innodb_fast_shutdown=0;
# restart
DROP TABLE t1;

View File

@@ -0,0 +1,5 @@
[strict_crc32]
--innodb-checksum-algorithm=strict_crc32
[strict_full_crc32]
--innodb-checksum-algorithm=strict_full_crc32

View File

@@ -42,9 +42,44 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
let MYSQLD_DATADIR=`select @@datadir`;
let PAGE_SIZE=`select @@innodb_page_size`;
--source include/shutdown_mysqld.inc
# Corrupt the change buffer bitmap, to claim that pages are clean
perl;
do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
open(FILE, "+<$file") || die "Unable to open $file";
binmode FILE;
my $ps= $ENV{PAGE_SIZE};
my $page;
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
# Clean the change buffer bitmap.
substr($page,38,$ps - 38 - 8) = chr(0) x ($ps - 38 - 8);
my $polynomial = 0x82f63b78; # CRC-32C
if ($full_crc32)
{
my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
substr($page, $ps-4, 4) = pack("N", $ck);
}
else
{
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
substr($page,0,4)=$ck;
substr($page,$ps-8,4)=$ck;
}
sysseek(FILE, $ps, 0) || die "Unable to rewind $file\n";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file";
EOF
--let $restart_parameters= --innodb-force-recovery=6 --innodb-change-buffer-dump
--source include/restart_mysqld.inc
--source include/start_mysqld.inc
--replace_regex /contains \d+ entries/contains #### entries/
check table t1;
@@ -52,5 +87,13 @@ check table t1;
--let $restart_parameters=
--source include/restart_mysqld.inc
# Ensure that the slow shutdown will not time out due to running purge.
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
--source include/wait_all_purged.inc
# The change buffer merge for the injected corruption must complete
# without exceeding the 60-second shutdown_server timeout.
SET GLOBAL innodb_fast_shutdown=0;
--source include/restart_mysqld.inc
# Cleanup
DROP TABLE t1;