[MDEV-11600] Test innodb-wl5522-debug-zip aka innodb_zip.wl5522_debug_zip has race condition between opening tablespaces and external tool Created: 2016-12-19  Updated: 2021-10-25  Resolved: 2021-10-25

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.2
Fix Version/s: 10.2.5

Type: Bug Priority: Major
Reporter: Jan Lindström (Inactive) Assignee: Marko Mäkelä
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

InnoDB tries to open file on read-only mode but some external tool (in this case ib-utils) also has opened it as read-write.

innodb.innodb-wl5522-debug-zip 'innodb'  [ fail ]  Found warnings/errors in server log file!
        Test ended at 2016-12-19 10:38:46
line
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: The error means the system cannot find the path specified.
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: Cannot open datafile for read-only: './test_wl5522/t1.ibd' OS error: 71
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: The error means the system cannot find the path specified.
2016-12-19 10:38:35 139864375539584 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2016-12-19 10:38:35 139864375539584 [Warning] InnoDB: Ignoring tablespace `test_wl5522/t1` because it could not be opened.
^ Found warnings in /dev/shm/log/mysqld.1.err



 Comments   
Comment by Marko Mäkelä [ 2017-03-14 ]

It would be useful to see more of the server error log, to determine at which point of the test the message was issued.
I renamed the test to innodb_zip.wl5522_debug_zip and did some minor cleanup on 2017-02-24.
It is possible that my DBUG_DEBUG fix reduced the I/O workload enough so that the race condition is now harder to repeat.

Comment by Marko Mäkelä [ 2017-08-10 ]

Is this still an issue?

Comment by Marko Mäkelä [ 2021-10-25 ]

The Description looks like a misunderstanding. No source code revision was stated, but based on the timestamp, this was slightly before the mariadb-10.2.3 release. The test innodb.innodb-wl5522-debug-zip had not been modified between 10.2.2 and 10.2.3, but there were some changes to the suppressions in 10.2.4. In MDEV-11927 (10.2.5) the test was partly replaced with innodb_zip.wl5522_debug_zip.

I believe that the “ib-utils” refers to sections of the test like this:

FLUSH TABLES t1 FOR EXPORT;
 
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;

There is no race condition here, because the file is being accessed between FLUSH TABLES…FOR EXPORT and UNLOCK TABLES.

It looks like the problem simply was that the call mtr.add_suppression() had not been adjusted to the changed error messages:

git grep -B1 'The error means' mariadb-10.2.3 -- storage/innobase/ mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test

This will find several ib::error() calls with that string but no suppression in the test. (There are suppressions in the test innodb-wl5522-debug.)

I suspect that this was fixed in the 10.2.5 release.

Generated at Thu Feb 08 07:51:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.