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

corruption in encrypted table may be overlooked

    Details

      Description

      mariabackup may overlook file corruptions as shown in steps below:

      1. Start MySQL Server with Encryption enabled
      2. Create tables, insert data as below:

      use test;
      create table t(a varchar(128)) engine=innodb;
      create table t1(a varchar(128)) engine=innodb;
      insert into t select repeat('a',100);
      insert into t1 select repeat('a',100);
      

      3. Wait some time to make sure that all pages are flushed and query below shows 0 dirty pages:

      SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_dirty';

      4. Corrupt t.ibd with commands below (replace data_directory with actual data directory):

      cd data_directory
      printf '\xAA\xAA\xAA\xAA' | dd of=test/t.ibd seek=16384 count=4 bs=1 conv=notrunc
      

      5. Create backup , observe no errors :

      170223 09:53:10 [01] Copying ./test/t.ibd to /bkup/test/t.ibd
      170223 09:53:10 [01]        ...done
      ..
      170223 09:53:14 completed OK!
      

      6. Check table with innochecksum to confirm that it is really corrupted:

      > innochecksum dt/test/t.ibd 
      InnoDB offline file checksum utility.
      Table is uncompressed
      Page size is 16384
      Fail;  page 1 invalid (fails old style checksum)
      

      7. (optional) make sure innochecksum doesn't complain about the other table t1:

      innochecksum test/t1.ibd
      

      Without rest encryption the same steps result in backup error:

      170223 10:17:22 [01] Copying ./test/t.ibd to /bkup/test/t.ibd
      [01] xtrabackup: Database page corruption detected at page 1, retrying...
      ...
      [01] xtrabackup: Error: failed to read page after 10 retries. File ./test/t.ibd seems to be corrupted.
      [01] xtrabackup: Error: xtrabackup_copy_datafile() failed.
      [01] xtrabackup: Error: failed to copy datafile.
      xtrabackup based on MariaDB server 10.1.22-MariaDB Linux (x86_64) 
      ...
      xtrabackup: Error: cannot open ./xtrabackup_checkpoints
      xtrabackup: Error: failed to read metadata from './xtrabackup_checkpoints'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                anikitin Andrii Nikitin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: