Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.11, 11.4, 11.8
-
None
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
- relates to
-
MDEV-35830 innodb_undo_log_truncate=ON during mariadb-backup --backup does not work as intended
-
- Closed
-
Thank you. I wrote a faster version of this in
MDEV-35830. I checked that it is occasionally (not in every run) covering the function backup_undo_trunc() in mariadb-backup --backup, in 10.6 and 10.11, and presumably also 10.5. I’ll push that test once the bug fix has been approved.