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

Avoid writes of freed (garbage) pages to InnoDB data files

Details

    Description

      The flushing of the InnoDB temporary tablespace is unnecessarily tied to the write-ahead redo logging and the flushing of the persistent tablespaces.
      It would be good to avoid any writes to the temporary tablespace, unless the pages are being evicted from the buffer pool and going to be reused.

      This task is one step towards that goal: When a page in a temporary tablespace is marked as free, we should remove the page from the flush list. This will avoid unnecessary writes of garbage that is certainly not needed any more. (The freed pages would never be read back; instead new pages would be created.)

      Attachments

        Issue Links

          Activity

            do_not_flush_freed_temp_pages.patch is a work-in-progress (non-working) patch that would implement part of this: when a page in the temporary tablespace is freed, it will be removed from the flush list.

            marko Marko Mäkelä added a comment - do_not_flush_freed_temp_pages.patch is a work-in-progress (non-working) patch that would implement part of this: when a page in the temporary tablespace is freed, it will be removed from the flush list.

            Perhaps we should use asynchronous writes for advancing the redo log checkpoint, and synchronous I/O for anything else (page reads and writes).

            For example, if a user thread wants to replace a buffer pool page with something else (to initialize or read a different page), then it could write a page to the temporary tablespace, unless the page was already marked to be free. This would be the only source of writes to the temporary tablespace file.

            Read-ahead requests could be delegated to a background thread.

            marko Marko Mäkelä added a comment - Perhaps we should use asynchronous writes for advancing the redo log checkpoint, and synchronous I/O for anything else (page reads and writes). For example, if a user thread wants to replace a buffer pool page with something else (to initialize or read a different page), then it could write a page to the temporary tablespace, unless the page was already marked to be free. This would be the only source of writes to the temporary tablespace file. Read-ahead requests could be delegated to a background thread.

            MDEV-15528 tracks freed pages and handles them in 3 ways:

            • Skip writing any page payload for freed pages. (This fixes MDEV-12226.)
            • For page_compressed tables, punch holes.
            • Else, if background scrubbing is enabled, overwrite freed pages with zeroes.

            MDEV-8139 will further improve the scrubbing and may implement trimming of freed pages from the end of data files.

            marko Marko Mäkelä added a comment - MDEV-15528 tracks freed pages and handles them in 3 ways: Skip writing any page payload for freed pages. (This fixes MDEV-12226 .) For page_compressed tables, punch holes. Else, if background scrubbing is enabled, overwrite freed pages with zeroes. MDEV-8139 will further improve the scrubbing and may implement trimming of freed pages from the end of data files.

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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