Skip to content

Commit a9d00db

Browse files
committed
MDEV-11799 InnoDB can abort if the doublewrite buffer
contains a bad and a good copy Clean up the InnoDB doublewrite buffer code. buf_dblwr_init_or_load_pages(): Do not add empty pages to the buffer. buf_dblwr_process(): Do consider changes to pages that are all zero. Do not abort when finding a corrupted copy of a page in the doublewrite buffer, because there could be multiple copies in the doublewrite buffer, and only one of them needs to be good.
1 parent 9b99d9b commit a9d00db

14 files changed

+191
-295
lines changed

mysql-test/suite/innodb/r/group_commit_crash.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
21
CREATE TABLE t1(a CHAR(255),
32
b CHAR(255),
43
c CHAR(255),

mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
21
CREATE TABLE t1(a CHAR(255),
32
b CHAR(255),
43
c CHAR(255),

mysql-test/suite/innodb/r/innodb-alter-tempfile.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
# Temporary tablename will be unique. This makes sure that future
55
# in-place ALTERs of the same table will not be blocked due to
66
# temporary tablename.
7-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed
8-
");
9-
call mtr.add_suppression("InnoDB: file read of space .* page .*");
10-
call mtr.add_suppression("InnoDB: Trying to recover it from the doublewrite buffer.");
117
# Crash the server in ha_innobase::commit_inplace_alter_table()
128
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
139
SET debug='d,innodb_alter_commit_crash_before_commit';

mysql-test/suite/innodb/r/innodb_bug14147491.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
22
CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
3-
CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
43
CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed");
54
CALL mtr.add_suppression("InnoDB: Space .* file test/t1 read of page .*");
65
CALL mtr.add_suppression("InnoDB: You may have to recover from a backup.");

mysql-test/suite/innodb/r/xa_recovery.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
21
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
32
INSERT INTO t1 VALUES (1);
43
XA START 'x';
54
UPDATE t1 set a=2;
65
XA END 'x';
76
XA PREPARE 'x';
87
call mtr.add_suppression("Found 1 prepared XA transactions");
8+
# Kill the server
99
SELECT * FROM t1 LOCK IN SHARE MODE;
1010
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
1111
SELECT * FROM t1;

mysql-test/suite/innodb/t/group_commit_crash.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
--source include/have_debug.inc
1010
--source include/have_log_bin.inc
1111

12-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
13-
1412
let $file_format_max=`SELECT @@innodb_file_format_max`;
1513
CREATE TABLE t1(a CHAR(255),
1614
b CHAR(255),

mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
--source include/have_debug.inc
1010
--source include/have_log_bin.inc
1111

12-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
13-
1412
let $file_format_max=`SELECT @@innodb_file_format_max`;
1513
CREATE TABLE t1(a CHAR(255),
1614
b CHAR(255),

mysql-test/suite/innodb/t/innodb-alter-tempfile.test

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@
2020
--echo # in-place ALTERs of the same table will not be blocked due to
2121
--echo # temporary tablename.
2222

23-
# As we intentionally crash below, there could be partially written
24-
# pages that are then recovered from the doublewrite buffer
25-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed
26-
");
27-
call mtr.add_suppression("InnoDB: file read of space .* page .*");
28-
call mtr.add_suppression("InnoDB: Trying to recover it from the doublewrite buffer.");
29-
3023
let datadir= `select @@datadir`;
3124

3225
--let $_server_id= `SELECT @@server_id`

mysql-test/suite/innodb/t/innodb_bug14147491.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ source include/have_debug.inc;
2121
source include/not_windows.inc;
2222

2323
CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
24-
CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
2524
CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed");
2625
CALL mtr.add_suppression("InnoDB: Space .* file test/t1 read of page .*");
2726
CALL mtr.add_suppression("InnoDB: You may have to recover from a backup.");

mysql-test/suite/innodb/t/xa_recovery.test

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins wher
1212
FLUSH TABLES;
1313
--enable_query_log
1414

15-
#
16-
# We kill server belown with timeout 0 that is not fully safe
17-
#
18-
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
19-
2015
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
2116
INSERT INTO t1 VALUES (1);
2217
connect (con1,localhost,root);
@@ -25,15 +20,8 @@ connection default;
2520

2621
call mtr.add_suppression("Found 1 prepared XA transactions");
2722

28-
# Kill and restart the server.
29-
-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
30-
-- shutdown_server 0
31-
-- source include/wait_until_disconnected.inc
32-
33-
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
34-
-- enable_reconnect
35-
-- source include/wait_until_connected_again.inc
36-
-- disable_reconnect
23+
--source include/kill_mysqld.inc
24+
--source include/start_mysqld.inc
3725

3826
disconnect con1;
3927
connect (con1,localhost,root);

0 commit comments

Comments
 (0)