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

Efficient InnoDB redo log record format

Details

    Description

      The InnoDB crash recovery performance can be improved a little while not changing the file format. MDEV-12699 removed unnecessary reads of pages that can be initialized via the redo log. MDEV-19586 will make recovery read the pages in more sequential order.

      We should fix some fundamental issues that exist with the current InnoDB redo log record format:

      • Records do not contain their length. When buffering records, we must painstakingly parse entire records in order to determine the length. This idea was mentioned in MySQL Bug#82937.
      • For B-tree operations, we are writing a lot of redundant data for mlog_parse_index(). We should use a lower-level format and lower-level apply functions. MySQL Bug#82176 merely speeds up the code around mlog_parse_index().
      • If a mini-transaction is writing multiple records to a page, the page identifier is being repeated for every record. We should omit the page identifier if multiple consecutive records are modifying the same page.

      In this task, we will only improve the redo log record format. Format changes to the redo log blocks and files will be covered by MDEV-14425.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            julien.fritsch Julien Fritsch made changes -
            Comment [ A comment with security level 'Developers' was removed. ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.3 [ 22126 ]
            marko Marko Mäkelä made changes -
            Affects Version/s 10.3 [ 22126 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Fix Version/s 10.4 [ 22408 ]
            NRE Projects RM_105_CANDIDATE
            Affects Version/s 10.4 [ 22408 ]
            elenst Elena Stepanova made changes -
            Fix Version/s 10.5 [ 23123 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.0 [ 16000 ]
            Affects Version/s 10.1 [ 16100 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Issue Type Bug [ 1 ] Task [ 3 ]
            marko Marko Mäkelä made changes -
            Description The InnoDB crash recovery performance could be improved. Some ideas (file format changes cannot be done in GA versions):
            # Read the to-be-recovered pages sorted by page number. Currently, recv_apply_hashed_log_recs() picks a ‘random page number’ from recv_sys->addr_hash and then reads a number of pages starting from that number.
            # Use a simpler redo log record format, and reduce the number of operations that require mlog_write_index(). For example, use MLOG_1BYTE instead of MLOG_REC_SEC_DELETE_MARK. This should also reduce the redo log volume.
            # Look at some contributed patches, such as [MySQL Bug#82937|https://bugs.mysql.com/bug.php?id=82937] (format change), [MySQL Bug#82176|https://bugs.mysql.com/bug.php?id=82176].
            The InnoDB crash recovery performance can be improved a little while not changing the file format. MDEV-12699 removed unnecessary reads of pages that can be initialized via the redo log. MDEV-19586 will make recovery read the pages in more sequential order.

            We should fix some fundamental issues that exist with the current InnoDB redo log record format:
            * Records do not contain their length. When buffering records, we must painstakingly parse entire records in order to determine the length. This idea was mentioned in [MySQL Bug#82937|https://bugs.mysql.com/bug.php?id=82937].
            * For B-tree operations, we are writing a lot of redundant data for {{mlog_parse_index()}}. We should use a lower-level format and lower-level apply functions. [MySQL Bug#82176|https://bugs.mysql.com/bug.php?id=82176] merely speeds up the code around {{mlog_parse_index()}}.
            * If a mini-transaction is writing multiple records to a page, the page identifier is being repeated for every record. We should omit the page identifier if multiple consecutive records are modifying the same page.

            In this task, we will only improve the redo log record format. Format changes to the redo log blocks and files will be covered by MDEV-14425.
            Summary Speed up InnoDB crash recovery Efficient InnoDB redo log record format
            marko Marko Mäkelä made changes -
            Comment [ While fixing MDEV-17680, it occurred to me that in {{recv_apply_hashed_log_recs()}} we could easily filter out any log records that precede {{MLOG_INIT_FILE_PAGE2}}. If such a record is present for a page, we can simply create the page and apply the log records. There is absolutely no need to read the page, and possibly unnecessarily fail if the to-be-ignored page was corrupted. This should be fixed in MDEV-12699. ]
            marko Marko Mäkelä made changes -
            Elkin Andrei Elkin made changes -
            Assignee Marko Mäkelä [ marko ] Andrei Elkin [ elkin ]
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            mleich Matthias Leich made changes -
            Attachment simp_page_rec_set_n_owned.test [ 50212 ]
            mleich Matthias Leich made changes -
            mleich Matthias Leich made changes -
            Attachment prt [ 50214 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2020-02-14 05:01:19.0 2020-02-14 05:01:19.48
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5.1 [ 24029 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5.2 [ 24030 ]
            Fix Version/s 10.5.1 [ 24029 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            thiru Thirunarayanan Balathandayuthapani made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Labels performance recovery ServiceNow performance recovery
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Labels ServiceNow performance recovery 76qDvLB8Gju6Hs7nk3VY3EX42G795W5z performance recovery
            serg Sergei Golubchik made changes -
            Labels 76qDvLB8Gju6Hs7nk3VY3EX42G795W5z performance recovery performance recovery
            marko Marko Mäkelä made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 80109 ] MariaDB v4 [ 133192 ]
            jplindst Jan Lindström (Inactive) made changes -
            jplindst Jan Lindström (Inactive) made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            midenok Aleksey Midenkov made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            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 -
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 201658 167030
            Zendesk active tickets 201658

            People

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