[MDEV-29551] InnoDB: Plugin initialization aborted with error I/O error - EINVAL, O_DIRECT, overlayfs Created: 2022-09-15 Updated: 2022-09-23 Resolved: 2022-09-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.9.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Rick Ferreira | Assignee: | Daniel Black |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Singularity container. |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
I get the following error when I try to run the following in a singularity Ubuntu 22.04 containers: sudo mysqld --verbose --user=root --innodb_use_native_aio=0 --innodb_force_recovery=1 ERRORS: 2022-09-15 18:54:43 0 [Note] mysqld (server 10.9.2-MariaDB-1:10.9.2+maria~ubu2204) starting as process 162465 ... To report this bug, see https://mariadb.com/kb/en/reporting-bugs We will try our best to scrape up some info that will hopefully help Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 Thread pointer: 0x0 Kernel version: Linux version 5.15.0-47-generic (buildd@lcy02-amd64-060) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 |
| Comments |
| Comment by Daniel Black [ 2022-09-15 ] | |||||||||||||||||||||||||||||||||||
|
Are you able to sudo strace -f -o /tmp/mariadbd.strace -- mariadbd --verbose --user=root --innodb_use_native_aio=0 --innodb_force_recovery=1 }} inside the container and attach the file {{/tmp/mariadbd.strace here. This will most likely need the capability CAP_SYS_PTRACE in starting the container. Also what are the characteristics of the /var/lib/mysql datadir? I'm assuming you are on a jammy host too based on the kernel version. | |||||||||||||||||||||||||||||||||||
| Comment by Rick Ferreira [ 2022-09-16 ] | |||||||||||||||||||||||||||||||||||
|
. Okay here is the file : I also tried the following commands:: mkdir /run/mysqld However it ends up hanging after showing the following lines sudo mysqld --verbose --user=root --innodb_flush_method=fsync | |||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-09-16 ] | |||||||||||||||||||||||||||||||||||
|
So this is showing the pread returning EINVAL under the O_DIRECT mode, which is why --innodb_flush_method=fsync avoided it by not setting O_DIRECT. So this looks like What filesytem and mount options are used for your datadir? --innodb_flush_method=fsync isn't hanging, that's a complete startup. | |||||||||||||||||||||||||||||||||||
| Comment by Rick Ferreira [ 2022-09-18 ] | |||||||||||||||||||||||||||||||||||
|
. sudo singularity shell --net --writable-tmpfs test2.sif Data directory is in the tmpfs at this location Singularity> mysqld --help --verbose | grep 'datadir' | tail -1 I modified my 50-server.cnf configuration file to have the following line under [server]. innodb_flush_method=fsync It was working for a while, however now sudo service mariadb start fails, however the following command works sudo mysqld --verbose --user=root & I still want to figure out how to solve the sudo service mariadb start not working. Is there a way of getting error messages and to print it's default settings? | |||||||||||||||||||||||||||||||||||
| Comment by Rick Ferreira [ 2022-09-18 ] | |||||||||||||||||||||||||||||||||||
|
Turns out mysqld wasn't hanging when putting &. It's just that mysqld couldn't be escaped without it and when I did add a & to the end, the singularity prompt didn't update the cursor location so it looked like it hanged. | |||||||||||||||||||||||||||||||||||
| Comment by Rick Ferreira [ 2022-09-18 ] | |||||||||||||||||||||||||||||||||||
|
Now I can't seem to create a wait or sleep bash script that waits for the mysql queries to run when creating a singularity instance before running sql commands. mysqld --user=root & #this works but could fail if it takes long and it wastes time #for some reason this works after running mysqld, but not sure why #If I remove the service mariadb start and try this code it doesn't work on the singularity %startscript mysql -u root --password=root -e 'CREATE DATABASE test;' | |||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-09-19 ] | |||||||||||||||||||||||||||||||||||
|
The default singularity filesytem is overlay FS which fails to support O_DIRECT.
I think I'll need to take this up with kernel devs on failing fcntl(10, F_SETFL, O_RDONLY|O_DIRECT) early rather than accepting it and failing on pread/write. In the mean time, to pull a mariadb container and run under singularity requires an explicit volume (for storage, that supports O_DIRECT, or use --innodb_flush_method=fsync) and --scratch option are needed. There's a few more options I put on this github issue. Note this omits the need for --writable-tmpfs.
| |||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-09-19 ] | |||||||||||||||||||||||||||||||||||
|
Closing as "Not a bug" but really not our bug. |