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

Reduce the overhead of writing undo log records

Details

    Description

      oltp_update_index.lua benchmark commits mini transaction 5 times. This causes log_sys->mutex contention.

      First two mini transactions (write of the first undo log record and the creation of the undo log header) can be combined.

      This change was verified to give ~10% better throughput.

      Attachments

        Issue Links

          Activity

            I had some doubts whether this is safe to do in all cases or if some deadlocks could be caused due to making changes to some pages after a page allocation. (There is a rule about that in operations that affect the change buffer; see the comment in the function btr_compress() which BTW is involved in the deadlock that has been reported in MDEV-14637.)

            It turns out that whenever there is not enough space for the undo log record in the undo log page, InnoDB will commit the mini-transaction and start a new one. It also turns out that the undo log record write would be attempted on the same page that was already written to within trx_undo_assign_undo(). So, merging the mini-transactions should be completely safe.

            marko Marko Mäkelä added a comment - I had some doubts whether this is safe to do in all cases or if some deadlocks could be caused due to making changes to some pages after a page allocation. (There is a rule about that in operations that affect the change buffer; see the comment in the function btr_compress() which BTW is involved in the deadlock that has been reported in MDEV-14637 .) It turns out that whenever there is not enough space for the undo log record in the undo log page, InnoDB will commit the mini-transaction and start a new one. It also turns out that the undo log record write would be attempted on the same page that was already written to within trx_undo_assign_undo() . So, merging the mini-transactions should be completely safe.

            People

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