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

innodb_undo_log_truncate=ON is blocking page writes

Details

    Description

      The implementation of innodb_undo_log_truncate=ON in trx_purge_truncate_history() is interfering with log checkpoint and page write performance.

      Before MDEV-13564, we used the MySQL 5.7 implementation, which would force a full flush of the entire buffer pool and a sharp log checkpoint. In MDEV-13564 we changed it so that only the pages of the being-truncated undo tablespace would be removed from the buffer pool, but no log checkpoint would be needed.

      There is a less intrusive, lazy approach: We can actually let the 'garbage' undo log pages remain in the buffer pool, just like we do on DROP TABLE or DROP INDEX or when freeing pages in any operation: Simply, if the newest modification to a page (FIL_PAGE_LSN) is older than the LSN of the latest tablespace rebuild, we will discard the page, just like in MDEV-15528 we do for pages whose underlying file page has been freed. With this approach, there is no need for trx_purge_truncate_history() to traverse the buffer pool.

      For the similar case of shrinking the InnoDB system tablespace (MDEV-14795), there would not be a complete tablespace rebuild (like there is with innodb_undo_log_truncate=ON), so we must only discard pages that are beyond the end of the current tablespace size; their FIL_PAGE_LSN must be older than the latest LSN of shrinking the FSP_SIZE. I think that we can do that by relaxing the logic around invoking fil_invalid_page_access_msg() in fil_space_t::io().

      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 -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5 [ 23123 ]
            marko Marko Mäkelä made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Matthias Leich [ mleich ]
            mleich Matthias Leich made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            mleich Matthias Leich made changes -
            Assignee Matthias Leich [ mleich ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Vladislav Lesin [ vlad.lesin ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            vlad.lesin Vladislav Lesin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            vlad.lesin Vladislav Lesin made changes -
            Assignee Vladislav Lesin [ vlad.lesin ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2024-01-10 13:42:46.0 2024-01-10 13:42:45.529
            marko Marko Mäkelä made changes -
            Fix Version/s 10.6.17 [ 29518 ]
            Fix Version/s 10.11.7 [ 29519 ]
            Fix Version/s 11.0.5 [ 29520 ]
            Fix Version/s 11.1.4 [ 29024 ]
            Fix Version/s 11.2.3 [ 29521 ]
            Fix Version/s 11.3.2 [ 29522 ]
            Fix Version/s 11.4.1 [ 29523 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.3 [ 28565 ]
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.4 [ 29301 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

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