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

Assertion w==OPT failed in trx_undo_header_create()

    XMLWordPrintable

Details

    Description

      A debug assertion could fail in the function trx_undo_header_create() with the following stack trace:

      10.5 ff64152bc72d985862ab729a2cf6d6167531b1ed

      #7  0x00007fc33add77d2 in __assert_fail ()
         from /dev/shm/avosusi/lib64/libc.so.6
      #8  0x00000000011a4f39 in mtr_t::memcpy<(mtr_t::write_type)0> (
          this=0x7fc33045d8d0, b=..., dest=0x7fc331b6465c, str=0x7fc33045d7a8, len=4)
          at /my/maria-10.5/storage/innobase/include/mtr0log.h:496
      #9  0x000000000131ffce in trx_undo_header_create (undo_page=0x7fc33161a0a0, 
          trx_id=1221, mtr=0x7fc33045d8d0)
          at /my/maria-10.5/storage/innobase/trx/trx0undo.cc:471
      #10 0x00000000013225f7 in trx_undo_reuse_cached (trx=0x7fc332607620, 
          rseg=0x4e76f78, pundo=0x7fc332608650, mtr=0x7fc33045d8d0)
          at /my/maria-10.5/storage/innobase/trx/trx0undo.cc:1112
      #11 0x0000000001322d04 in trx_undo_assign_low (trx=0x7fc332607620, 
          rseg=0x4e76f78, undo=0x7fc332608650, err=0x7fc33045d8cc, 
          mtr=0x7fc33045d8d0) at /my/maria-10.5/storage/innobase/trx/trx0undo.cc:1225
      #12 0x00000000012fdc49 in trx_undo_report_row_operation (thr=0x7fc27003d338, 
          index=0x7fc270053d00, clust_entry=0x7fc270025ac0, update=0x0, cmpl_info=0, 
          rec=0x0, offsets=0x0, roll_ptr=0x7fc33045de98)
          at /my/maria-10.5/storage/innobase/trx/trx0rec.cc:1992
      

      Because InnoDB is not freeing undo pages to the normal free-page management, old undo log pages can be reused. Due to that, it is possible (but unlikely) that the fields TRX_UNDO_NEEDS_PURGE and TRX_UNDO_LOG_START relative to the free offset that is stored at TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_START already have the correct value. Hence, we must pass the mtr_t::OPT template parameter to silence the debug assertion.

      Other writes in that function that are using the default template parameter seem to be correct (the data fields should be guaranteed to change even in the event of reusing pages).

      Attachments

        Activity

          People

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