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

MariaBackup loses a DML operation after server restart

    XMLWordPrintable

Details

    Description

      Set to minor because I could only reproduce it on 10.3/10.4.

      --source include/have_innodb.inc
       
      CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
      INSERT INTO t VALUES (1),(2);
       
      --source include/restart_mysqld.inc
       
      DELETE FROM t;
       
      --echo # Running backup
      --exec $XTRABACKUP --backup --target-dir=$MYSQL_TMP_DIR/mbackup_backup --protocol=tcp --port=$MASTER_MYPORT --user=root
      --echo # Running prepare
      --exec $XTRABACKUP --prepare --target-dir=$MYSQL_TMP_DIR/mbackup_backup
      --echo # Running restore
      --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$MYSQL_TMP_DIR/mbackup_restore --target-dir=$MYSQL_TMP_DIR/mbackup_backup
      --echo # Restarting on the restored datadir
       
      --let $restart_parameters= --datadir=$MYSQL_TMP_DIR/mbackup_restore
      --source include/restart_mysqld.inc
      SELECT * FROM t;
      

      10.3 e7be2d31

      CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
      INSERT INTO t VALUES (1),(2);
      DELETE FROM t;
      # Running backup
      # Running prepare
      # Running restore
      # Restarting on the restored datadir
      SELECT * FROM t;
      pk
      1
      2
      

      So, even though the backup was run after the DELETE, it still contains the data in the table.

      Reproducible on 10.3 and 10.4, could not reproduce 10.5+.

      It is a race condition, even though not with the client connection, because if I put a sleep between DELETE and backup, it is no longer reproducible.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.