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

Preparing an incremental backup twice can corrupt data

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.2.7
    • Fix Version/s: 10.1.29, 10.2.10
    • Component/s: Backup
    • Labels:
      None

      Description

      Preparing already prepared incremental backup does show error message below in percona-xtrabackup as well mariabackup 10.1.25 (to protect users from incorrect action).

      xtrabackup: This target seems to be already prepared.
      xtrabackup: error: applying incremental backup needs target prepared with --apply-log-only.
      

      test below passes in 10.1.25 (mariabackup exits with error code 1), but fails in 10.2.7 (mariabackup exits without error):

      call mtr.add_suppression("InnoDB: New log files created");
       
      let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
      let $incremental_dir1=$MYSQLTEST_VARDIR/tmp/backup_inc1;
      let $incremental_dir2=$MYSQLTEST_VARDIR/tmp/backup_inc2;
       
      CREATE TABLE t(i INT) ENGINE INNODB;
      INSERT INTO t VALUES(1);
       
      echo # Create full backup , modify table, then create incremental/differential backup;
      --disable_result_log
      exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup --target-dir=$basedir;
      --enable_result_log
      INSERT INTO t VALUES(2);
      exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup --target-dir=$incremental_dir1 --incremental-basedir=$basedir;
       
      INSERT INTO t VALUES(3);
      exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup --target-dir=$incremental_dir2 --incremental-basedir=$basedir;
       
      echo # Prepare full backup, apply incremental one;
      exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
      exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir1 ;
       
      echo # This time should succeed;
      exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir2 ;
       
      # this returns an error according to test pxb170.sh
      --error 1
      exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir2 ;
       
      # Cleanup
      drop table t;
      rmdir $basedir;
      rmdir $incremental_dir1;
      rmdir $incremental_dir2;
      

      10.1.25:
      Completed: All 1 tests were successful.
      10.2.7:
      mysqltest: At line 35: command "$XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir2 " succeeded - should have failed with errno 1...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                anikitin Andrii Nikitin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: