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

Test case to handle undo tablespace truncation in Mariabackup

    XMLWordPrintable

Details

    Description

      • Write a test case which allows mariabackup to handle undo tablespace truncation

      --source include/have_innodb.inc
      --source include/not_embedded.inc
      --source include/have_sequence.inc
       
      SET GLOBAL innodb_undo_log_truncate = 0;
       
      LET $MYSQLD_DATADIR = `select @@datadir`;
      LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
      #
      # Perform DML action using multiple clients and multiple undo tablespace.
      #
      let basedir=$MYSQLTEST_VARDIR/tmp/backup;
      let incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
      create table t1(keyc int primary key, c char(100)) engine = innodb;
      create table t2(keyc int primary key, c char(100)) engine = innodb;
      let DATADIR = `select @@datadir`;
      connect (con1,localhost,root,,);
      begin;
      send insert into t1 select seq,'a' from seq_1_to_20000;
       
      connect (con2,localhost,root,,);
      begin;
      send insert into t2 select seq,'a' from seq_1_to_20000;
       
      connection con1; reap; send update t1 set c = 'mysql';
      connection con2; reap; send update t2 set c = 'mysql';
      connection con1; reap; send update t1 set c = 'oracle';
      connection con2; reap; send update t2 set c = 'oracle';
      connection con1; reap; send delete from t1;
      connection con2; reap; delete from t2;
      connection con1; reap;
       
      --disable_result_log
      exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup --parallel=10 --target-dir=$basedir --throttle=1000;
      --enable_result_log
       
      commit; disconnect con1;
      connection con2; commit; disconnect con2;
       
      connection default;
       
      SET GLOBAL innodb_undo_log_truncate = 1;
      SET GLOBAL innodb_max_undo_log_size=DEFAULT;
      SET GLOBAL innodb_max_purge_lag_wait=0;
       
      --echo # Incremental backup
      exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=2 --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir --innodb_undo_tablespaces=2;
       
      --disable_result_log
      --echo # Prepare full backup
      exec $XTRABACKUP --prepare --target-dir=$basedir;
      --echo # Apply incremental one
      exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;
       
      echo # Restore and check results;
      let $targetdir=$basedir;
      -- source include/restart_and_restore.inc
      --enable_result_log
      # Cleanup
      rmdir $basedir;
      rmdir $incremental_dir;
      DROP TABLE t2, t1;
      

      Incremental backup should copy the undo tablespace truncation redo log record
      and incremental prepare should truncate the undo log tablespace.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              thiru Thirunarayanan Balathandayuthapani
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.