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

InnoDB occasionally fails to recover a corrupted page from the doublewrite buffer

Details

    Description

      While testing the fix of MDEV-35225, I came up with the following rare failure of the test innodb.innodb-32k-crash:

      10.6 1067046b7f4337080e5b59c364c0a53cbeca715e

      2024-10-21 23:10:11 0 [Note] InnoDB: Completed initialization of buffer pool
      2024-10-21 23:10:11 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1059287101,1062232449
      2024-10-21 23:10:11 0 [ERROR] InnoDB: Cannot apply log to [page id: space=704, page number=0] of corrupted file './test/t1.ibd'
      2024-10-21 23:10:11 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1513] with error Data structure corruption
      

      When I tried recovery on a copy of the data directory 32k-recovery.tar.xz, it would succeed each time. The difference to the above would be that there would be a message about doublewrite buffer recovery:

      10.6 1067046b7f4337080e5b59c364c0a53cbeca715e

      2024-10-21 23:42:51 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1059287101,1059287101
      2024-10-21 23:42:51 0 [Note] InnoDB: Trying to recover page [page id: space=704, page number=0] from the doublewrite buffer.
      2024-10-21 23:42:51 0 [Note] InnoDB: Recovered page [page id: space=704, page number=0] to './test/t1.ibd' from the doublewrite buffer.
      2024-10-21 23:42:51 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 20 row operations to undo
      2024-10-21 23:42:51 0 [Note] InnoDB: Trx id counter is 52417
      2024-10-21 23:42:51 0 [Note] InnoDB: To recover: 698 pages
      2024-10-21 23:42:51 0 [Note] InnoDB: Resizing redo log from 33554432 to 100663296 bytes; LSN=1062232813
      

      I will try to reproduce this failure under rr record so that this can be analyzed and fixed.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Marko Mäkelä made transition -
            Open In Progress
            56s 1
            Marko Mäkelä made transition -
            In Progress Stalled
            2h 9m 1

            People

              mleich Matthias Leich
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.