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

innodb_undo_log_truncate=ON is not crash safe

Details

    Description

      As noted in MDEV-32681, the invocation of buf_page_t::clear_oldest_modification() in trx_purge_truncate_history() is unsafe. The buf_flush_page_cleaner() thread may advance the checkpoint before mtr_t::commit_shrink() has finished executing. This may cause a previously committed transaction to be treated as uncommitted. The server could crash or hang while trying to roll back the "uncommitted" transaction. With the data.tar.xz that is attached to MDEV-32681, the rollback would try to free an undo log page multiple times and possibly end up in an infinite loop.

      Attachments

        Issue Links

          Activity

            origin/10.6-MDEV-32757 5a8b6ff7d9805403ed8c7bb9025e9e8b85eccfcf 2023-11-10T12:27:02+02:00
            behaved well in RQG testing

            mleich Matthias Leich added a comment - origin/10.6- MDEV-32757 5a8b6ff7d9805403ed8c7bb9025e9e8b85eccfcf 2023-11-10T12:27:02+02:00 behaved well in RQG testing

            origin/10.5-MDEV-32757 64601d745903bb3b0487d294cece2958eb312f28 2023-11-10T11:54:20+02:00
            behaved well in RQG testing

            mleich Matthias Leich added a comment - origin/10.5- MDEV-32757 64601d745903bb3b0487d294cece2958eb312f28 2023-11-10T11:54:20+02:00 behaved well in RQG testing

            Anyone who hits this issue would likely have to start up the server with innodb_force_recovery=3 and create a logical dump of the database, effectively using the READ UNCOMMITTED isolation level. I do not think there is any easy way to "repair" the InnoDB transactional metadata. MDEV-19229 implements something close to that, but its prerequisite is that the undo logs are logically empty, which would not be the case here.

            marko Marko Mäkelä added a comment - Anyone who hits this issue would likely have to start up the server with innodb_force_recovery=3 and create a logical dump of the database, effectively using the READ UNCOMMITTED isolation level. I do not think there is any easy way to "repair" the InnoDB transactional metadata. MDEV-19229 implements something close to that, but its prerequisite is that the undo logs are logically empty, which would not be the case here.

            People

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