Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-1421

LP #1229583: Clarify ALL_O_DIRECT relationship with fsync()

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Fixed
    • None
    • None
    • Documentation

    Description

      **Reported in Launchpad by Laurynas Biveinis last update 01-10-2013 06:35:47

      ALL_O_DIRECT is documented as "use O_DIRECT [to] open and flush both the data and the log files." [1]. Preceding it, O_DIRECT is documented as use "O_DIRECT (...) to open the data files; use fsync() to flush both the data and log files.", which is a copy-paste from Oracle docs [2] and is best rephrased.

      ALL_O_DIRECT is missing a similar fsync() comment and source code reading tells that fsync() is skipped for all the log writes: both checkpoint info and log data. A similar setup for data files might result in issues with metadata being out of sync in case of crash (i.e. see 5.6 O_DIRECT_NO_FSYNC docs), but is probably safe for log files as they are fixed-size.

      Thus let's fix the docs by 1) rewriting the O_DIRECT bit not to copy-paste Oracle docs; 2) adding to ALL_O_DIRECT that fsync() is used for data files and skipped for log files.

      [1] http://www.percona.com/doc/percona-server/5.5/scalability/innodb_io_55.html
      [2] https://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_flush_method

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist