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

innodb_flush_method=O_DIRECT creates excessive errors on Solaris

Details

    Description

      After upgrading MariaDB from 10.3.9 to 10.11.6, we got an excessive number of errors in the server logs:
      ```
      2023-12-20 11:25:48 0 [ERROR] InnoDB: Failed to set DIRECTIO_ON on file ./mysql/gtid_slave_pos.ibd; OPEN: Inappropriate ioctl for device, continuing anyway.
      ```
      It seems the general change of default for `innodb_flush_method` from `fsync` to `O_DIRECT` on every platform is ill-advised: `O_DIRECT` is *not* portable across Unix platforms, but is a Linux extensions that has been adopted by some non-Linux targets, but is certainly not POSIX.

      While I can manually restore the default to `fsync` to avoid this flood of errors, `mysqld` should only change the default to `O_DIRECT` on targets where it's supported and known to work.

      Attachments

        Issue Links

          Activity

            The name of a value of the configuration parameter innodb_flush_method was O_DIRECT. Yes, it was somewhat misleading, and this configuration parameter was deprecated and mapped to 4 new settable Boolean parameters in MDEV-30136.

            marko Marko Mäkelä added a comment - The name of a value of the configuration parameter innodb_flush_method was O_DIRECT . Yes, it was somewhat misleading, and this configuration parameter was deprecated and mapped to 4 new settable Boolean parameters in MDEV-30136 .

            Because we no longer have any Solaris derivatives in our CI systems, it is difficult for me to do anything about this bug. I am happy to review any code contribution.

            While we are at it, I wonder if a Solaris variant of MDEV-26476 could be implemented.

            marko Marko Mäkelä added a comment - Because we no longer have any Solaris derivatives in our CI systems, it is difficult for me to do anything about this bug. I am happy to review any code contribution . While we are at it, I wonder if a Solaris variant of MDEV-26476 could be implemented.

            rorth, based on your comment in MDEV-33203, I would assume that the correct course of action would be to simply remove the support of innodb_flush_method=O_DIRECT on Solaris, as well as the support of the related parameters that were implemented in MDEV-30136.

            Can you confirm that this is fine with you?

            marko Marko Mäkelä added a comment - rorth , based on your comment in MDEV-33203 , I would assume that the correct course of action would be to simply remove the support of innodb_flush_method=O_DIRECT on Solaris, as well as the support of the related parameters that were implemented in MDEV-30136 . Can you confirm that this is fine with you?

            rorth, please check if https://github.com/MariaDB/server/pull/3002 works for you. I added a new cmakedefine for checking if O_DIRECT is usable. Solaris defines both fcntl(2) and O_DIRECT, but they cannot be used together. Therefore, I added a tweak to cmake/os/SunOS.cmake to disable this.

            marko Marko Mäkelä added a comment - rorth , please check if https://github.com/MariaDB/server/pull/3002 works for you. I added a new cmakedefine for checking if O_DIRECT is usable. Solaris defines both fcntl(2) and O_DIRECT , but they cannot be used together. Therefore, I added a tweak to cmake/os/SunOS.cmake to disable this.

            I found out that we were invoking fcntl() on IBM AIX with an undocumented argument O_DIRECT. I implemented a similar way of disabling O_DIRECT on both AIX and Solaris. I think that this is best reviewed by danblack, who set up IBM AIX on our CI.

            marko Marko Mäkelä added a comment - I found out that we were invoking fcntl() on IBM AIX with an undocumented argument O_DIRECT . I implemented a similar way of disabling O_DIRECT on both AIX and Solaris. I think that this is best reviewed by danblack , who set up IBM AIX on our CI.

            People

              marko Marko Mäkelä
              rorth Rainer Orth
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.