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

Partitioned InnoDB table appears corrupted after restoring full backup

    XMLWordPrintable

Details

    Description

      The original test runs random DML/DDL in a few threads and takes full backups from the server periodically. Then it stops the flow and the server, prepares the backups one by one, each time starting the server on the restored backup and performing data health checks. At some points, an error is revealed:

      10.3 e59c1ce

      MariaDB [test]> check table t1 extended;
      +---------+-------+----------+-------------------------------------------------------------------+
      | Table   | Op    | Msg_type | Msg_text                                                          |
      +---------+-------+----------+-------------------------------------------------------------------+
      | test.t1 | check | error    | Partition ver_p1 returned error                                   |
      | test.t1 | check | Warning  | InnoDB: Index 'FTS_DOC_ID_INDEX' contains 0 entries, should be 3. |
      | test.t1 | check | error    | Corrupt                                                           |
      +---------+-------+----------+-------------------------------------------------------------------+
      

      2021-01-03 21:09:25 8 [ERROR] InnoDB: Flagged corruption of `FTS_DOC_ID_INDEX` in table `test`.`t1` /* Partition `ver_p1` */ in CHECK TABLE; Wrong count
      

      In the server log, it is the first and only error occurring during the test run.
      mariabackup backup log does not show any errors (attached as mbackup_backup_6.log).

      The issue is sporadic in the sense of creating the initial problematic; but once such a backup is created, the failure upon prepare => restart => check is reliably reproducible.

      Similar failures have been observed in tests on at least 10.2, 10.3 and 10.4. I'm setting affect version to 10.3 and 10.4, because the data provided within this ticket relates to a system-versioned partitioned table, so it's not directly applicable to 10.2.

      The backups, logs and rr profiles for each start of server and mariabackup are available.


      For a reference, here is the test I used to produce the data:

      randgen elenst-dev bf2f4069

      perl ./runall-trials.pl --trials=10 --duration=350 --threads=4 --seed=1609549322 --reporters=Backtrace,ErrorLog,Deadlock --skip-gendata --gendata-advanced --engine=InnoDB --views --grammar=conf/mariadb/generic-dml.yy --redefine=conf/mariadb/bulk_insert.yy --filter=conf/mariadb/10.4-combo-filter.ff --mysqld=--log_output=FILE --mysqld=--max-statement-time=20 --mysqld=--lock-wait-timeout=10 --mysqld=--loose-innodb-lock-wait-timeout=5 --mysqld=--loose-debug_assert_on_not_freed_memory=0 --mysqld=--innodb-compression-algorithm=zlib --mysqld=--innodb-page-size=16K --mysqld=--innodb-encrypt-tables --mysqld=--innodb-encrypt-log --mysqld=--innodb-encryption-threads=4 --mysqld=--aria-encrypt-tables=1 --mysqld=--encrypt-tmp-disk-tables=1 --mysqld=--encrypt-binlog --mysqld=--file-key-management --mysqld=--file-key-management-filename=`pwd`/../10.3/mysql-test/std_data/keys.txt --mysqld=--plugin-load-add=file_key_management --scenario=MariaBackupFull --redefine=conf/mariadb/alter_table.yy --redefine=conf/mariadb/modules/admin.yy --redefine=conf/mariadb/versioning.yy --redefine=conf/mariadb/sequences.yy --basedir1=`pwd`/../10.3 --mysqld=--innodb-buffer-pool-size=512M --vardir1=`pwd`/../var --mtr-build-thread=55 --rr
      

      Attachments

        Activity

          People

            marko Marko Mäkelä
            elenst Elena Stepanova
            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.