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

MariaBackup Incremental Does Not Reflect Dropped/Created Databases

Details

    Description

      Create a test database, say "t2".
      Run mariabackup --backup.
      Drop database "t2"
      Run mariabackup --incremental(-basedir)
      Prepare and restore the backup.
      See the dropped database restored. - All the objects in the database will be gone, but the database itself is still there.

      Attachments

        Issue Links

          Activity

            This mtr test demonstrates the problem:

            call mtr.add_suppression("InnoDB: New log files created");
            --let $basedir=$MYSQLTEST_VARDIR/tmp/backup
            --let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1
             
            CREATE DATABASE db1;
             
            --disable_result_log
            --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir
            --enable_result_log
             
            CREATE TABLE db1.t1 (a INT);
            DROP DATABASE db1;
             
            --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir
             
            --disable_result_log
            --echo # Prepare full backup, apply incremental one
            --exec $XTRABACKUP --prepare --target-dir=$basedir
            --exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir
            --enable_result_log
             
            --let $targetdir=$basedir
            --source include/restart_and_restore.inc
            --enable_result_log
             
            SHOW DATABASES;
            SHOW TABLES IN db1;
             
            --rmdir $basedir
            --rmdir $incremental_dir
            

            This is the output:

            CREATE DATABASE db1;
            CREATE TABLE db1.t1 (a INT);
            DROP DATABASE db1;
            # Prepare full backup, apply incremental one
            # shutdown server
            # remove datadir
            # xtrabackup move back
            # restart
            SHOW DATABASES;
            Database
            db1
            information_schema
            mtr
            mysql
            performance_schema
            test
            SHOW TABLES IN db1;
            Tables_in_db1
            

            Notice, the database db1 is still there. Note, there are no tables in the database.

            bar Alexander Barkov added a comment - This mtr test demonstrates the problem: call mtr.add_suppression("InnoDB: New log files created"); --let $basedir=$MYSQLTEST_VARDIR/tmp/backup --let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1   CREATE DATABASE db1;   --disable_result_log --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir --enable_result_log   CREATE TABLE db1.t1 (a INT); DROP DATABASE db1;   --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir   --disable_result_log --echo # Prepare full backup, apply incremental one --exec $XTRABACKUP --prepare --target-dir=$basedir --exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir --enable_result_log   --let $targetdir=$basedir --source include/restart_and_restore.inc --enable_result_log   SHOW DATABASES; SHOW TABLES IN db1;   --rmdir $basedir --rmdir $incremental_dir This is the output: CREATE DATABASE db1; CREATE TABLE db1.t1 (a INT); DROP DATABASE db1; # Prepare full backup, apply incremental one # shutdown server # remove datadir # xtrabackup move back # restart SHOW DATABASES; Database db1 information_schema mtr mysql performance_schema test SHOW TABLES IN db1; Tables_in_db1 Notice, the database db1 is still there. Note, there are no tables in the database.
            bar Alexander Barkov added a comment - - edited

            The problem is also repeatable with 10.3.37 and 10.4.28.

            bar Alexander Barkov added a comment - - edited The problem is also repeatable with 10.3.37 and 10.4.28 .
            bar Alexander Barkov added a comment - Hello serg . Can you please review this patch: https://github.com/MariaDB/server/commit/df09b3a646b4f4ef15e5182a6c0b86710e1740e2 ? Thanks!

            df09b3a646b4f4ef15e5182a6c0b86710e1740e2 is ok to push

            serg Sergei Golubchik added a comment - df09b3a646b4f4ef15e5182a6c0b86710e1740e2 is ok to push

            People

              bar Alexander Barkov
              juan.vera Juan
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.