Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: 5.5.31
    • Labels:
      None
    • Global Rank:
      2767

      Description

      The task is to support InnoDB/XtraDB atomic writes without using doublewrite buffer. The benefits of of it is better latency, and superior flash endurance. This approach also reduces write amplification on flash devices.

      To support atomic writes, new boolean configuration option innodb_use_atomic_writes will be added . (default OFF).

      Following happens if innodb_use_atomic_writes is ON (this should be done only on a system that supports atomic writes) :

      • innodb_use_doublewrite is switched OFF (since writes are atomic)
      • innodb_file_flush_method to O_DIRECT, unless already set to O_DIRECT or ALL_O_DIRECT, or to O_DIRECT_NO_FSYNC in 5.6.
      • The option causes Innodb to use posix_fallocate for file preallocation and extension. The reason behind it
        is that atomic write option does not currently work for writes behind the end of file.
      • Upon opening Innodb data files, InnoDB/XtraDB will issue ioctl (DFS_IOCTL_ATOMIC_WRITE_SET). This new ioctl hints underlying filesystem to transparently convert normal writes (via pwrite(), write(), io_submit() calls) to atomic writes which is guaranteed by the underlying device. In case of ioctl() failure, opening of data file fails, and an error is returned to the calling code with a message written in the log file. In case the data file is system tablespace(ibdata1), mysqld does not start.

      Currently only directFS file system supports atomics, however this approach is potentially extensible to other filesystems/devices choose to provide this functionality.

      We'll need following define to InnoDB/XtraDB.

      • #define DFS_IOCTL_ATOMIC_WRITE_SET _IOW(0x95, 2, uint)

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Vladislav Vaintroub
            Reporter:
            Vladislav Vaintroub
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 week, 3 days
              1w 3d