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

innodb_log_archive=ON file creation causes log_sys.latch contention

    XMLWordPrintable

Details

    • Related to performance
    • Q2/2026 Server Maintenance

    Description

      I made a questionable design choice in MDEV-37949 in order to simplify the initial implementation of the innodb_log_archive=ON format: When a new ib_*.log file is being created and extended to innodb_log_file_size, we will hold log_sys.latch in exclusive mode. This will create significant contention to other concurrent threads.

      A better choice would be to preallocate a spare file while not holding any mutex. The most natural place for that could be the buf_flush_page_cleaner() thread.

      Creating a file upfront might also allow more graceful handling of out-of-space scenarios. Currently, we intentionally crash the server if we fail to create a log file. If we preallocate a log file, in some cases under moderate write load there could be enough time to gracefully switch to read-only operation. Because this is tricky to test and implement, I would leave this out of the scope of the fix for now.

      Attachments

        Issue Links

          Activity

            People

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