4312 Marko Mäkelä 2012-09-24
WL#6494 crash injection testing.
Test recovery of a dirty database with all values of
--innodb-force-recovery-crash.
modified:
mysql-test/suite/innodb/r/innodb-log-file-size.result
mysql-test/suite/innodb/t/innodb-log-file-size.test
4311 Marko Mäkelä 2012-09-24
Remove an extra InnoDB: prefix.
modified:
storage/innobase/log/log0recv.cc
4310 Marko Mäkelä 2012-09-24
WL#6494: Add a basic test, not crashing during the log switch.
added:
mysql-test/suite/innodb/r/innodb-log-file-size.result
mysql-test/suite/innodb/t/innodb-log-file-size.test
=== modified file 'mysql-test/suite/innodb/r/innodb-log-file-size.result'
--- a/mysql-test/suite/innodb/r/innodb-log-file-size.result revid:marko.makela@strippedyl
+++ b/mysql-test/suite/innodb/r/innodb-log-file-size.result revid:marko.makela@strippedg3c9280cqf
@@ -1,6 +1,7 @@
call mtr.add_suppression("InnoDB: Resizing redo log");
call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files");
call mtr.add_suppression("InnoDB: New log files created");
+call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
SET DEBUG='+d,crash_commit_before';
INSERT INTO t1 VALUES (42);
@@ -14,4 +15,115 @@ ERROR HY000: Lost connection to MySQL se
SELECT * FROM t1;
a
42
+INSERT INTO t1 VALUES (123);
+SET DEBUG='+d,crash_commit_before';
+DELETE FROM t1;
+ERROR HY000: Lost connection to MySQL server during query
+--innodb-force-recovery-crash=1
+auto.cnf
+ib_logfile0
+ib_logfile1
+ib_logfile2
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=2
+auto.cnf
+ib_logfile0
+ib_logfile1
+ib_logfile2
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=3
+auto.cnf
+ib_logfile0
+ib_logfile1
+ib_logfile2
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=4
+auto.cnf
+ib_logfile0
+ib_logfile1
+ib_logfile2
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=5
+auto.cnf
+ib_logfile0
+ib_logfile1
+ib_logfile2
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=6
+auto.cnf
+ib_logfile1
+ib_logfile2
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=7
+auto.cnf
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=8
+auto.cnf
+ib_logfile1
+ib_logfile101
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=9
+auto.cnf
+ib_logfile1
+ib_logfile101
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+--innodb-force-recovery-crash=10
+auto.cnf
+ib_logfile0
+ib_logfile1
+ibdata1
+master-bin.index
+mtr
+mysql
+performance_schema
+test
+SELECT * FROM t1;
+a
+42
+123
DROP TABLE t1;
=== modified file 'mysql-test/suite/innodb/t/innodb-log-file-size.test'
--- a/mysql-test/suite/innodb/t/innodb-log-file-size.test revid:marko.makela@stripped56s1p52z9s227yl
+++ b/mysql-test/suite/innodb/t/innodb-log-file-size.test revid:marko.makela@stripped0839-4721pbg3c9280cqf
@@ -13,6 +13,7 @@
call mtr.add_suppression("InnoDB: Resizing redo log");
call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files");
call mtr.add_suppression("InnoDB: New log files created");
+call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -42,6 +43,62 @@ DELETE FROM t1;
SELECT * FROM t1;
-# TODO: Test with --innodb-force-recovery-crash
+INSERT INTO t1 VALUES (123);
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+SET DEBUG='+d,crash_commit_before';
+# Write file to make mysql-test-run.pl restart the server
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--error 2013
+DELETE FROM t1;
+
+--echo --innodb-force-recovery-crash=1
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=1
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=2
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=2
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=3
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=3
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=4
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=4
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=5
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=5
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=6
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=6
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=7
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=7
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=8
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=8
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=9
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=9
+--list_files $MYSQLD_DATADIR
+--echo --innodb-force-recovery-crash=10
+--error 137
+--exec $MYSQLD_CMD --loose-console --innodb-force-recovery-crash=10
+--list_files $MYSQLD_DATADIR
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+SELECT * FROM t1;
DROP TABLE t1;
=== modified file 'storage/innobase/log/log0recv.cc'
--- a/storage/innobase/log/log0recv.cc revid:marko.makela@stripped7yl
+++ b/storage/innobase/log/log0recv.cc revid:marko.makela@stripped
@@ -3136,7 +3136,7 @@ recv_recovery_from_checkpoint_start_func
if (!recv_needed_recovery) {
ib_logf(IB_LOG_LEVEL_WARN,
- "InnoDB: The log sequence numbers "
+ "The log sequence numbers "
LSN_PF " and " LSN_PF
" in ibdata files do not match"
" the log sequence number "
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.6-wl6494 branch (marko.makela:4310 to 4312) WL#6494 | marko.makela | 26 Sep |