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

The maximum innodb_log_write_ahead_size is insufficient for some storage

    XMLWordPrintable

Details

    • Related to performance
    • The maximum value of the parameter innodb_log_write_ahead_size was increased from 4 KiB to 4 MiB, which is the minimum innodb_log_file_size.

    Description

      As discussed in the mailing list, the current maximum value of the parameter innodb_log_write_ahead_size=4096 is suboptimal for some copy-on-write file systems as well as RAID arrays or SSDs, where it could be more efficient to perform larger writes, such as one RAID stripe or erase block at a time.

      Note: The parameter name is somewhat misleading. It controls the size of writes to the write-ahead log. A larger value of this parameter would mean that when new log records are being appended, we may rewrite more of the log records that had already been written to the log, or we may write more garbage that is after the end of the latest log record. Writes would use file offsets and lengths that are integer multiples of innodb_log_write_ahead_size.

      At the start of the MDEV-14425 (or MDEV-37949) format log file, there is a 12288-byte header, which contains checkpoint information. With innodb_log_write_ahead_size≥8192, we should normally align writes to offsets and lengths that are multiples of ≥8192 bytes. A write that targets the start of the log record payload area at offset 12288 would either have to rewrite some or all of the file header (starting at offset 8192 or 0), or the write offset and length would have to be adjusted, so that we start at 12288 and actually write an integer multiple of 4096 bytes, ending at an integer multiple of innodb_log_write_ahead_size.

      A power outage during a rewrite of the entire log file header could make the database irrecoverable, by destroying information on the latest log checkpoint, or the parameters innodb_encrypt_log=ON parameters. The risk is much smaller when using the innodb_log_archive=ON format that MDEV-37949 is introducing, because we would have the same information in an earlier log file. Nevertheless, this may be a risk that a DBA could be willing to take.

      The default value of innodb_log_write_ahead_size would remain unchanged by this. We attempt to detect the physical block size of the underlying storage device, typically setting the default to 4096 or 512 bytes.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Marko Mäkelä Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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