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

Defer writes to the InnoDB temporary tablespace

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.
      We should avoid any writes to the temporary tablespace, unless the pages are being evicted from the buffer pool and going to be reused.

      I think that we should simply omit any pages of temporary tables from buf_pool.flush_list. This would allow us to remove the loop in buf_flush_wait_flushed(), among other things. The refactored LRU flushing of MDEV-23399 would have to be refined further to initiate writes of pages of temporary tables. And any code that invokes a page flush before invalidating or resizing the buffer pool will have to be adjusted. On shutdown, we can obviously discard any writes of temporary pages, but when shrinking the buffer pool we must preserve such data.

      There is no need to care about the LSN in the temporary tablespace, because the changes are never going to be logged or recovered.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            marko Marko Mäkelä made changes -
            Affects Version/s 10.3.0 [ 22127 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5 [ 23123 ]
            Affects Version/s 10.4.0 [ 23115 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Affects Version/s 10.5.0 [ 23709 ]
            Assignee Marko Mäkelä [ marko ] Vladislav Vaintroub [ wlad ]
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Affects Version/s 10.2.2 [ 22013 ]
            Affects Version/s 10.3.0 [ 22127 ]
            Affects Version/s 10.4.0 [ 23115 ]
            Affects Version/s 10.5.0 [ 23709 ]
            Issue Type Bug [ 1 ] Task [ 3 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Description The flushing of the InnoDB temporary tablespace is unnecessarily tied to the write-ahead redo logging and the flushing of the persistent tablespaces.
            We should avoid any writes to the temporary tablespace, unless the pages are being evicted from the buffer pool and going to be reused.
            Maybe there should be a separate flush list for temporary tablespaces? There is no need to care about the LSN (write-ahead logging) when flushing, because changes to the temporary tablespace are not logged nor recovered.
            The flushing of the InnoDB temporary tablespace is unnecessarily tied to the write-ahead redo logging and the flushing of the persistent tablespaces.
            We should avoid any writes to the temporary tablespace, unless the pages are being evicted from the buffer pool and going to be reused.

            I think that we should simply omit any pages of temporary tables from {{buf_pool.flush_list}}. This would allow us to remove the loop in {{buf_flush_wait_flushed()}}, among other things. The refactored LRU flushing of MDEV-23399 would have to be refined further to initiate writes of pages of temporary tables. And any code that invokes a page flush before invalidating or resizing the buffer pool will have to be adjusted. On shutdown, we can obviously discard any writes of temporary pages, but when shrinking the buffer pool we must preserve such data.

            There is no need to care about the LSN in the temporary tablespace, because the changes are never going to be logged or recovered.
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -

            I think that this is best done in 10.5. Having any temporary tablespace pages in buf_pool.flush_list is unnecessarily complicating the page cleaner logic.

            marko Marko Mäkelä added a comment - I think that this is best done in 10.5. Having any temporary tablespace pages in buf_pool.flush_list is unnecessarily complicating the page cleaner logic.
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5 [ 23123 ]
            Assignee Vladislav Vaintroub [ wlad ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5.9 [ 25109 ]
            Fix Version/s 10.6.0 [ 24431 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 79926 ] MariaDB v4 [ 133156 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -

            People

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