Details

    Description

      When InnoDB creates an .ibd file, it first writes a dummy page 0 with no information about encryption. This may prevent Mariabackup 10.2.20 or 10.2.21 from copying encrypted data files that were craeted shortly before backup started.

      Maybe we should create a 0-byte .ibd file first, and then let page flushing write the first pages? Alternatively, preallocate a zero-filled file and then let page flushing do its job.

      A valid page 0 must be written to the created files before writing any other pages. Otherwise, crash recovery cannot work.

      Attachments

        Issue Links

          Activity

            It looks like crash recovery is broken because of this. Here is a test that initializes the database and kills&restarts it soon after that. It can occasionally fail:

            10.2 23e4446adc0de8b6f763f746fd20f0e546a40129

            innodb.group_commit_crash_no_optimize_thread 'innodb' w3 [ fail ]  Found warnings/errors in server log file!
                   Test ended at 2019-01-03 16:54:22
            line
            2019-01-03 16:54:21 3069097920 [ERROR] InnoDB: Checksum mismatch in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
            ^ Found warnings in /mnt/buildbot/build/mariadb-10.2.22/mysql-test/var/3/log/mysqld.1.err
            

            Perhaps, in order to simplify things, we can keep the crash-unsafe creation of the InnoDB system tablespace that only happens when the database is initialized, and only fix the .ibd file creation. After all, I would at some point (MDEV-11633) make the InnoDB system tablespace optional (split its contents into more manageable pieces).

            marko Marko Mäkelä added a comment - It looks like crash recovery is broken because of this. Here is a test that initializes the database and kills&restarts it soon after that. It can occasionally fail: 10.2 23e4446adc0de8b6f763f746fd20f0e546a40129 innodb.group_commit_crash_no_optimize_thread 'innodb' w3 [ fail ] Found warnings/errors in server log file! Test ended at 2019-01-03 16:54:22 line 2019-01-03 16:54:21 3069097920 [ERROR] InnoDB: Checksum mismatch in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue. ^ Found warnings in /mnt/buildbot/build/mariadb-10.2.22/mysql-test/var/3/log/mysqld.1.err Perhaps, in order to simplify things, we can keep the crash-unsafe creation of the InnoDB system tablespace that only happens when the database is initialized, and only fix the .ibd file creation. After all, I would at some point ( MDEV-11633 ) make the InnoDB system tablespace optional (split its contents into more manageable pieces).

            This looks OK. Unfortunately, we were unable to reproduce failures with mariabackup --backup --skip-encrypted-backup with or without the patch. The purpose of that option was to work around this bug. I think that we should remove that option in 10.5.

            marko Marko Mäkelä added a comment - This looks OK. Unfortunately, we were unable to reproduce failures with mariabackup --backup --skip-encrypted-backup with or without the patch. The purpose of that option was to work around this bug. I think that we should remove that option in 10.5.

            The commit message accidentally omitted the bug title.

            marko Marko Mäkelä added a comment - The commit message accidentally omitted the bug title.

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Votes:
              1 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.