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

Optimize btr_page_reorganize_low() redo logging

Details

    Description

      MDEV-12353 introduces a purely physical redo log format.

      For btr_page_reorganize_low(), there is no optimization as of now. It is essentially copying the page payload to the redo log, as if all records were inserted anew. A better approach would be to compare the old page contents to the reorganized one, and only emit the minimal amount of WRITE or MEMMOVE records to cover the changes.

      This affects especially the innodb_defragment feature, because it is invoking btr_page_reorganize_low() extensively. The test used to work with the mysql-test/include/default_mysqld.cnf se{{page_delete_rec_list_end()}}tting of innodb_log_buffer_size=1M, but that had to be increased to innodb_log_buffer_size=6M to avoid warnings about the buffer being extended.

      Attachments

        Issue Links

          Activity

            Related to this, page_delete_rec_list_end() and page_cur_delete_rec() should be rewritten so that they will decrement PAGE_HEAP_TOP when deleting the very last records of a page, instead of prepending the deleted record to the PAGE_FREE list. That should reduce the need of page reorganize operations.

            It could be worthwhile to always reorganize the page as part of page_delete_rec_list_start() and page_delete_rec_list_end().

            marko Marko Mäkelä added a comment - Related to this, page_delete_rec_list_end() and page_cur_delete_rec() should be rewritten so that they will decrement PAGE_HEAP_TOP when deleting the very last records of a page, instead of prepending the deleted record to the PAGE_FREE list. That should reduce the need of page reorganize operations. It could be worthwhile to always reorganize the page as part of page_delete_rec_list_start() and page_delete_rec_list_end() .

            I pushed an initial fix that will still copy the entire changed page payload area to the redo log. A complete fix should make use of MEMMOVE records to minimize the redo log volume.

            marko Marko Mäkelä added a comment - I pushed an initial fix that will still copy the entire changed page payload area to the redo log. A complete fix should make use of MEMMOVE records to minimize the redo log volume.

            People

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