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

InnoDB fails to restore page 0 from the doublewrite buffer

    XMLWordPrintable

Details

    Description

      The test innodb.doublewrite corrupts the first page of a data file t1.ibd by writing 0 to the bytes 34 through 37 and recomputing the checksum.

      The data directory in data.tar.xz fails to recover:

      tar xJf data.tar.xz
      sql/mariadbd --innodb-page-size=32k --datadir=$(pwd)/data
      

      mariadb-10.6.5

      2021-11-10 13:17:58 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=45679,45679
      2021-11-10 13:17:58 0 [ERROR] InnoDB: Inconsistent tablespace ID in ./test/t1.ibd
      2021-11-10 13:17:58 0 [ERROR] InnoDB: Cannot apply log to [page id: space=5, page number=0] of corrupted file './test/t1.ibd'
      2021-11-10 13:17:58 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
      2021-11-10 13:17:58 0 [Note] InnoDB: Starting shutdown...
      

      You will find that fil_ibd_load() is invoked once and returns FIL_LOAD_DEFER. After that, buf_dblwr_t::recover() will be invoked, but there is no call of Datafile::restore_from_doublewrite(). The scenario is similar to MDEV-26631.

      Note: The doublewrite copy of the page is at the very first slot. The contents only differs for the tablespace identifier and the page checksum:

      diff -u <(od -An -t x1 -j 0x200000 -N 0x8000 data/ibdata1) <(od -An -t x1 -N 0x8000 data/test/t1.ibd)
      

      Thanks to monty for providing a copy of the data directory.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              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.