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

Move the InnoDB doublewrite buffer to flat files




      The purpose of the InnoDB doublewrite buffer is to prevent corruption when the database server process is killed in the middle of a write operation that is replacing an already initialized page in a data file. The write logic is like this:

      1. Append to the redo log a record that covers the change(s) to the page.
      2. Write a copy of the modified page to the doublewrite buffer.
      3. Write the modified page to the data file.

      If the system is killed during the last write, the page would be corrupted in the data file, and no redo log can be applied. The copy in the doublewrite buffer would save the situation.

      Currently the doublewrite buffer is physically located in the InnoDB system tablespace, in the pages 64 to 191. It covers all data files. The small number of pages could become a performance bottleneck. And these 128 pages are basically unnecessary garbage when the server has been shut down cleanly.

      We should move the doublewrite buffer to flat files, maybe one file for each physical page size. These files would be created on startup unless innodb_read_only is set, and deleted on shutdown. The files would only be consulted on redo log apply. The size of the files (number of pages) could be derived from some flushing parameters.


        Issue Links



              Unassigned Unassigned
              marko Marko Mäkelä
              4 Vote for this issue
              13 Start watching this issue



                Git Integration

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