[MDEV-17645] innodb.log_file_name_debug does not clean up after itself Created: 2018-11-08  Updated: 2018-11-08  Resolved: 2018-11-08

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.3.11, 10.2.19

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None


 Description   

The tests innodb.log_file_name_debug (and theoretically innodb.innodb-index) can cause a subsequent recovery test to fail:

./mtr --no-reorder innodb.log_file_name_debug innodb.read_only_recovery

10.4 c761b43451d54eeeecdf3c102906fcce88d4e9d9

innodb.log_file_name_debug 'innodb'      [ pass ]   6736
innodb.read_only_recovery 'innodb'       [ fail ]  Found warnings/errors in server log file!
        Test ended at 2018-11-08 14:29:29
line
2018-11-08 14:29:24 0 [Warning] InnoDB: Tablespace 4294967280 was not found at ./test/bogus file.ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!

The first test does inject this error and does run crash recovery. But it fails to ensure that a redo log checkpoint will occur.
So, if a subsequent test executes crash recovery, it can get the warning due to the fault that was injected in the previous test.
The fix is to add an extra shutdown to the first test:

diff --git a/mysql-test/suite/innodb/t/log_file_name_debug.test b/mysql-test/suite/innodb/t/log_file_name_debug.test
index 0aaf798e2b3..d85fbf08194 100644
--- a/mysql-test/suite/innodb/t/log_file_name_debug.test
+++ b/mysql-test/suite/innodb/t/log_file_name_debug.test
@@ -44,5 +44,7 @@ SELECT * FROM t1;
 
 --let $restart_parameters=
 --source include/restart_mysqld.inc
+# Initiate shutdown in order to issue a redo log checkpoint and to discard
+# the redo log record that was emitted due to '+d,fil_names_write_bogus'.
+--source include/restart_mysqld.inc
 DROP TABLE t1;
-

A similar problem is theoretically possible with innodb.innodb-index, but I was not able to repeat it. It is better to be safe than sorry:

diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 97014d84ca7..e575cff4774 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -1115,6 +1115,11 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
 --move_file $MYSQLD_DATADIR/test/t0.ibd $MYSQLD_DATADIR/test/t1.ibd
 
 --source include/start_mysqld.inc
+if ($have_debug) {
+# Initiate shutdown in order to issue a redo log checkpoint and to discard
+# the redo log record that was emitted due to '+d,fil_names_write_bogus'.
+--source include/restart_mysqld.inc
+}
 
 SELECT * FROM t1;
 SELECT * FROM t2;


Generated at Thu Feb 08 08:38:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.