Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16015

Unhandled EOPNOTSUPP of posix_fallocate() causes bogus "Probably out of disk space error"

Details

    Description

      I'm not sure whether you're aware of this issue experienced by docker users: https://github.com/docker-library/mariadb/issues/95

      When you start latest stable MariaDB with Docker for Mac/Win and /var/lib/mysql mounted from the host machine it fails with error:

      + mysql_install_db --datadir=/var/lib/mysql/ --rpm
      [ERROR] InnoDB: preallocating 10485760 bytes for file ./ibdata1 failed with error 95
      [ERROR] InnoDB: Could not set the file size of './ibdata1'. Probably out of disk space
      [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
      [ERROR] Plugin 'InnoDB' init function returned error.
      [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
      [ERROR] Unknown/unsupported storage engine: InnoDB
      [ERROR] Aborting
      

      As noted by tianon in the github issue:

      Docker and MariaDB work fine together; the bit that doesn't work is the custom filesystem employed by Docker for Windows and Docker for Mac for sharing files across the VM boundary, which is not all that surprising for a database, which often use features like mmap for performance but thus also require support from the underlying filesystem. There are many reports of similar issues with vboxsf, for example.

      Any fixes would have to happen either in Docker's shared filesystem or in MariaDB itself (not something we can really fix in this Docker image), so I'd recommend checking their respective upstream bugtrackers for any discussion of fixing the problem.

      Also, it worth saying that older MariaDB versions work fine, for example 10.1.22

      Docker images where the problem happens:

      Attachments

        Issue Links

          Activity

            can it be reproduce with innodb_compression_default=1

            stephane@skysql.com VAROQUI Stephane added a comment - can it be reproduce with innodb_compression_default=1

            tried to reproduce it on Mac, but without any success.

            images used:
            wodby/mariadb:10.5
            mariadb/server:10.5
            mariadb/server:10.4
            mariadb/server:10.3
            mariadb/server:10.2
            mariadb:10.5
            mariadb:10.3
            mariadb:10.2

            command used:
            docker run --rm -eMYSQL_RANDOM_ROOT_PASSWORD=1 --mount type=bind,source=/tmp/mysql,target=/var/lib/mysql <IMAGE>:<TAG>

            MacOS 11.1 Big Sur
            Docker Desktop for Mac v3.0.4(51218), engine 20.10.2

            abychko Alexey Bychko (Inactive) added a comment - tried to reproduce it on Mac, but without any success. images used: wodby/mariadb:10.5 mariadb/server:10.5 mariadb/server:10.4 mariadb/server:10.3 mariadb/server:10.2 mariadb:10.5 mariadb:10.3 mariadb:10.2 command used: docker run --rm -eMYSQL_RANDOM_ROOT_PASSWORD=1 --mount type=bind,source=/tmp/mysql,target=/var/lib/mysql <IMAGE>:<TAG> MacOS 11.1 Big Sur Docker Desktop for Mac v3.0.4(51218), engine 20.10.2

            stephane@skysql.com, thank you for trying to help, but I do not think that we allow the system tablespace to be a sparse file (page_compressed tables can only be created in .ibd files).

            abychko, thank you for confirming that this works for your Docker for Mac. We did not verify the fix on Docker for Windows. I believe that the missing handling for the EOPNOTSUPP error code (which is 95 in GNU/Linux) in posix_fallocate() caused the original reported failure.

            chingis, for any remaining problem, please file a separate ticket with the exact symptoms.

            marko Marko Mäkelä added a comment - stephane@skysql.com , thank you for trying to help, but I do not think that we allow the system tablespace to be a sparse file ( page_compressed tables can only be created in .ibd files). abychko , thank you for confirming that this works for your Docker for Mac. We did not verify the fix on Docker for Windows. I believe that the missing handling for the EOPNOTSUPP error code (which is 95 in GNU/Linux) in posix_fallocate() caused the original reported failure. chingis , for any remaining problem, please file a separate ticket with the exact symptoms.
            chingis Chingis added a comment -

            It seems the issue is really fixed. The reason it didn't start for me is because I used a bind mount from `/tmp` on macOS, which is a symlink to `/private/tmp`. It works, if you pre-create a directory under `/tmp/` but if it doesn't exists it fails. And it works fine regardless of whether it's pre-created or not for all other non-symlink directories.

            chingis Chingis added a comment - It seems the issue is really fixed. The reason it didn't start for me is because I used a bind mount from `/tmp` on macOS, which is a symlink to `/private/tmp`. It works, if you pre-create a directory under `/tmp/` but if it doesn't exists it fails. And it works fine regardless of whether it's pre-created or not for all other non-symlink directories.

            Thank you, chingis!

            marko Marko Mäkelä added a comment - Thank you, chingis !

            People

              marko Marko Mäkelä
              chingis Chingis
              Votes:
              10 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.