[MDEV-28716] innodb.innodb_28867993 fails on FreeBSD with an error in log file Created: 2022-05-31  Updated: 2022-06-01  Resolved: 2022-06-01

Status: Closed
Project: MariaDB Server
Component/s: Platform FreeBSD, Storage Engine - InnoDB, Tests
Affects Version/s: 10.8, 10.9
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2

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


 Description   

10.8 0e0a3580e

innodb.innodb_28867993 'innodb'          w3 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2022-05-28 00:37:06
line
2022-05-28  0:37:05 0 [ERROR] InnoDB: File ./ib_logfile2: 'delete' returned OS error 201.
^ Found warnings in /tmp/var/3/log/mysqld.1.err
ok

It fails seemingly reliably (or at least very frequently) on 10.8+. No recorded failures on 10.7.



 Comments   
Comment by Marko Mäkelä [ 2022-06-01 ]

InnoDB sometimes likes to add OS_FILE_ERROR_MAX (200) to the errno codes. In FreeBSD, EPERM is 1. The Linux man 2 unlink says:

EPERM The system does not allow unlinking of directories, or unlinking
of directories requires privileges that the calling process
doesn't have. (This is the POSIX prescribed error return; as
noted above, Linux returns EISDIR for this case.)

It seems that the following should fix this. It is applicable to every major version.

diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 42772904bc3..83beccc6909 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -810,6 +810,7 @@ os_file_get_last_error_low(
 		return(OS_FILE_ALREADY_EXISTS);
 	case EXDEV:
 	case ENOTDIR:
+	case EPERM:
 	case EISDIR:
 		return(OS_FILE_PATH_ERROR);
 	case EAGAIN:

Comment by Marko Mäkelä [ 2022-06-01 ]

Here is the result of a test push for a 10.8-based branch:
http://buildbot.askmonty.org/buildbot/builders/kvm-ports-freebsd130-amd64/builds/1120/steps/mtr/logs/stdio

innodb.innodb_28867993 'innodb'          w1 [ pass ]   1613

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