mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Make the innochecksum tests more robust.
As noted in MDEV-11947, we should disable the InnoDB doublewrite buffer during the tests, because when rewriting page checksums, innochecksum would skip the pages that are in the doublewrite buffer area. Because the doublewrite buffer is emptied on server startup and not shutdown, we should initially start with the doublewrite buffer disabled, so that there will be no warning messages for wrong page checksums in the doublewrite buffer. Also, correct the obvious typo where restart_options should have been $restart_parameters, so that InnoDB is actually verifying that the checksums were rewritten.
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
# Set the environmental variables
|
# Set the environmental variables
|
||||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||||
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
|
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
|
||||||
SET GLOBAL innodb_file_per_table=on;
|
|
||||||
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
|
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
|
||||||
CREATE INDEX idx1 ON tab1(c2(10));
|
CREATE INDEX idx1 ON tab1(c2(10));
|
||||||
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
|
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
|
||||||
@ -89,6 +88,4 @@ c1 c2
|
|||||||
FOUND /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
|
FOUND /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
|
||||||
FOUND /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
|
FOUND /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
|
||||||
FOUND /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
|
FOUND /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
|
||||||
# Restart the server
|
|
||||||
DROP TABLE tab1;
|
DROP TABLE tab1;
|
||||||
SET GLOBAL innodb_file_per_table=default;
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# Set the environmental variables
|
# Set the environmental variables
|
||||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||||
SET GLOBAL innodb_file_per_table=on;
|
|
||||||
[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
||||||
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
|
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
|
||||||
linestring_key GEOMETRY NOT NULL,
|
linestring_key GEOMETRY NOT NULL,
|
||||||
@ -221,7 +220,4 @@ NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_resta
|
|||||||
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
|
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
|
||||||
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
|
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
|
||||||
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
|
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
|
||||||
# Restart the server
|
DROP TABLE tab1,tab2;
|
||||||
DROP TABLE tab1;
|
|
||||||
DROP TABLE tab2;
|
|
||||||
SET GLOBAL innodb_file_per_table=default;
|
|
||||||
|
1
mysql-test/suite/innodb_zip/t/innochecksum.opt
Normal file
1
mysql-test/suite/innodb_zip/t/innochecksum.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--skip-innodb-doublewrite
|
@ -17,8 +17,6 @@ let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
|||||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||||
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
|
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
|
||||||
|
|
||||||
SET GLOBAL innodb_file_per_table=on;
|
|
||||||
|
|
||||||
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
|
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
|
||||||
CREATE INDEX idx1 ON tab1(c2(10));
|
CREATE INDEX idx1 ON tab1(c2(10));
|
||||||
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
|
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
|
||||||
@ -163,7 +161,7 @@ let SEARCH_PATTERN= Error while setting value \'no\' to \'strict-check\';
|
|||||||
--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd
|
--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd
|
||||||
|
|
||||||
--echo # start the server with innodb_checksum_algorithm=InnoDB
|
--echo # start the server with innodb_checksum_algorithm=InnoDB
|
||||||
--let restart_options= : --innodb_checksum_algorithm=innodb
|
--let $restart_parameters= --innodb_checksum_algorithm=innodb
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
|
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
|
||||||
@ -181,7 +179,7 @@ SELECT c1,c2 FROM tab1 order by c1,c2;
|
|||||||
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd
|
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd
|
||||||
|
|
||||||
--echo # Start the server with checksum algorithm=none
|
--echo # Start the server with checksum algorithm=none
|
||||||
--let restart_options= : --innodb_checksum_algorithm=none
|
--let $restart_parameters= --innodb_checksum_algorithm=none
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
|
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
|
||||||
@ -195,7 +193,7 @@ DROP TABLE t1;
|
|||||||
--exec $INNOCHECKSUM --no-check --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
--exec $INNOCHECKSUM --no-check --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||||
|
|
||||||
--echo # Restart the DB server with innodb_checksum_algorithm=crc32
|
--echo # Restart the DB server with innodb_checksum_algorithm=crc32
|
||||||
--let restart_options= : --innodb_checksum_algorithm=crc32 --innodb_file_per_table=on
|
--let $restart_parameters= --innodb_checksum_algorithm=crc32
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
SELECT * FROM tab1;
|
SELECT * FROM tab1;
|
||||||
@ -209,7 +207,7 @@ SELECT c1,c2 FROM tab1 order by c1,c2;
|
|||||||
--exec $INNOCHECKSUM --no-check --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
|
--exec $INNOCHECKSUM --no-check --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
|
||||||
|
|
||||||
--echo # Restart the DB server with innodb_checksum_algorithm=InnoDB
|
--echo # Restart the DB server with innodb_checksum_algorithm=InnoDB
|
||||||
--let restart_options= : --innodb_checksum_algorithm=innodb --innodb_file_per_table=on
|
--let $restart_parameters= --innodb_checksum_algorithm=innodb
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
DELETE FROM tab1 where c1=2;
|
DELETE FROM tab1 where c1=2;
|
||||||
@ -236,8 +234,7 @@ let SEARCH_PATTERN=Error while setting value \'crc23\' to \'write\';
|
|||||||
--remove_file $SEARCH_FILE
|
--remove_file $SEARCH_FILE
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
--echo # Restart the server
|
--let $restart_parameters=
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
DROP TABLE tab1;
|
DROP TABLE tab1;
|
||||||
SET GLOBAL innodb_file_per_table=default;
|
|
||||||
|
1
mysql-test/suite/innodb_zip/t/innochecksum_2.opt
Normal file
1
mysql-test/suite/innodb_zip/t/innochecksum_2.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--skip-innodb-doublewrite
|
@ -4,8 +4,7 @@
|
|||||||
--source include/have_innodb.inc
|
--source include/have_innodb.inc
|
||||||
--source include/have_innodb_zip.inc
|
--source include/have_innodb_zip.inc
|
||||||
--source include/have_debug.inc
|
--source include/have_debug.inc
|
||||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
--source include/no_valgrind_without_big.inc
|
||||||
--source include/not_valgrind.inc
|
|
||||||
# Avoid CrashReporter popup on Mac.
|
# Avoid CrashReporter popup on Mac.
|
||||||
--source include/not_crashrep.inc
|
--source include/not_crashrep.inc
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
--source include/have_innodb.inc
|
--source include/have_innodb.inc
|
||||||
--source include/have_innodb_zip.inc
|
--source include/have_innodb_zip.inc
|
||||||
|
|
||||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
--source include/no_valgrind_without_big.inc
|
||||||
--source include/not_valgrind.inc
|
|
||||||
|
|
||||||
# Embedded server does not support crashing.
|
# Embedded server does not support crashing.
|
||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
@ -19,8 +18,6 @@ let MYSQLD_DATADIR= `SELECT @@datadir`;
|
|||||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||||
|
|
||||||
SET GLOBAL innodb_file_per_table=on;
|
|
||||||
|
|
||||||
--echo [1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
--echo [1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
||||||
|
|
||||||
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
|
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
|
||||||
@ -78,7 +75,7 @@ foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
--echo : start the server with innodb_checksum_algorithm=strict_innodb
|
--echo : start the server with innodb_checksum_algorithm=strict_innodb
|
||||||
--let restart_options= : --innodb_checksum_algorithm=strict_innodb --default_storage_engine=InnoDB
|
--let $restart_parameters= --innodb_checksum_algorithm=strict_innodb
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
|
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
|
||||||
@ -118,7 +115,7 @@ foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
--echo # start the server with innodb_checksum_algorithm=strict_crc32
|
--echo # start the server with innodb_checksum_algorithm=strict_crc32
|
||||||
--let restart_options= : --innodb_checksum_algorithm=strict_crc32 --default_storage_engine=InnoDB
|
--let $restart_parameters= --innodb_checksum_algorithm=strict_crc32
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
# check the table status is GOOD with DML
|
# check the table status is GOOD with DML
|
||||||
@ -163,7 +160,7 @@ foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
--let $restart_parameters = --innodb_checksum_algorithm=strict_none --default_storage_engine=InnoDB
|
--let $restart_parameters= --innodb_checksum_algorithm=strict_none
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
--let $restart_parameters=
|
--let $restart_parameters=
|
||||||
# check the table status is GOOD with DML
|
# check the table status is GOOD with DML
|
||||||
@ -403,9 +400,6 @@ let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
|||||||
--remove_file $SEARCH_FILE
|
--remove_file $SEARCH_FILE
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
--echo # Restart the server
|
|
||||||
--source include/start_mysqld.inc
|
--source include/start_mysqld.inc
|
||||||
|
|
||||||
DROP TABLE tab1;
|
DROP TABLE tab1,tab2;
|
||||||
DROP TABLE tab2;
|
|
||||||
SET GLOBAL innodb_file_per_table=default;
|
|
||||||
|
Reference in New Issue
Block a user