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

InnoDB is disregarding read-only mode on slow shutdown

    XMLWordPrintable

Details

    Description

      The following was found while testing a proposed fix of MDEV-34200 on 11.4:

      innodb.undo_upgrade '64k'                w1 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2024-05-22 08:14:23
      line
      mariadbd: /mariadb/11/storage/innobase/mtr/mtr0mtr.cc:562: void mtr_t::commit_shrink(fil_space_t &, uint32_t): Assertion `!high_level_read_only' failed.
      

      The failure is sporadic. I was able to reproduce it locally with a MemorySanitizer build. The relevant part of the server error log is the following:

      2024-05-22  8:14:10 0 [Note] /dev/shm/11msan/sql/mariadbd (initiated by: root[root] @ localhost []): Normal shutdown
      2024-05-22  8:14:10 0 [Note] InnoDB: Truncating system tablespace from 1216 to 192 pages
      mariadbd: /mariadb/11/storage/innobase/mtr/mtr0mtr.cc:562: void mtr_t::commit_shrink(fil_space_t &, uint32_t): Assertion `!high_level_read_only' failed.
      

      We should be in read-only mode because the test invokes innodb_force_recovery=5. Another reason could be innodb_read_only=ON. The fix is simple: do not invoke fsp_system_tablespace_truncate() on slow shutdown when we are in read-only mode. This condition was missed in MDEV-32452.

      Attachments

        Issue Links

          Activity

            People

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