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

            svoj Sergey Vojtovich created issue -
            svoj Sergey Vojtovich made changes -
            Field Original Value New Value
            Epic Link MDEV-14442 [ 64369 ]
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            marko Marko Mäkelä made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]

            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.
            marko Marko Mäkelä made changes -
            Summary Combine the write of the first undo log record and the creation of the undo log header into a single mini-transaction Reduce the overhead of writing undo log records
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2018-01-29 18:29:25.0 2018-01-29 18:29:25.085
            marko Marko Mäkelä made changes -
            Fix Version/s 10.3.5 [ 22905 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 85163 ] MariaDB v4 [ 133454 ]

            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.