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

The purge of committed history is mis-parsing some log

Details

    Description

      While the testing of MDEV-33588, mleich encountered an rr replay trace where the purge_coordinator_task is trying to parse arbitrary data in the middle of an undo log record. I narrowed it down to the following code in purge_sys_t::choose_next_log():

          const trx_undo_rec_t *undo_rec=
            trx_undo_page_get_first_rec(b, hdr_page_no, hdr_offset);
      

      Here, b is undo log page 13, and hdr_page_no and hdr_offset are related to that. I think that we would benefit from some testing with the following patch to catch the root cause of the corruption sooner:

      @@ -134,8 +134,9 @@ trx_undo_page_get_first_rec(const buf_block_t *block, uint32_t page_no,
                                   uint16_t offset)
       {
         uint16_t start= trx_undo_page_get_start(block, page_no, offset);
      -  return start == trx_undo_page_get_end(block, page_no, offset)
      -    ? nullptr : block->page.frame + start;
      +  uint16_t end= trx_undo_page_get_end(block, page_no, offset);
      +  ut_ad(start <= end);
      +  return start >= end ? nullptr : block->page.frame + start;
       }
       
       /** Get the last undo log record on a page.
      

      In the trace that I analyzed, we would be reading an invalid start value that points outside the page frame.

      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 -
            Status Open [ 1 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Labels rr-profile regression rr-profile-analyzed
            Summary mach_read_next_much_compressed(const byte**): Assertion `val == 0xFF' failed in purge The purge of committed history is mis-parsing some log
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Vladislav Lesin [ vlad.lesin ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            Affects Version/s 10.11.7 [ 29519 ]
            Affects Version/s 10.6.17 [ 29518 ]
            Affects Version/s 11.2.2 [ 29035 ]
            Affects Version/s 11.1.3 [ 29023 ]
            Affects Version/s 11.0.4 [ 29021 ]
            Affects Version/s 10.11.6 [ 29020 ]
            Affects Version/s 10.10.7 [ 29018 ]
            Affects Version/s 10.6.16 [ 29014 ]
            Affects Version/s 10.6 [ 24028 ]
            vlad.lesin Vladislav Lesin made changes -
            Assignee Vladislav Lesin [ vlad.lesin ] Marko Mäkelä [ marko ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.6.18 [ 29627 ]
            Fix Version/s 10.11.8 [ 29630 ]
            Fix Version/s 11.1.5 [ 29629 ]
            Fix Version/s 11.2.4 [ 29631 ]
            Fix Version/s 11.4.2 [ 29633 ]
            Fix Version/s 11.0.0 [ 28500 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -

            People

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