2018-08-09 15:06:52 +01:00
|
|
|
--source include/have_debug.inc
|
2022-12-02 11:54:35 +05:30
|
|
|
--source include/innodb_undo_tablespaces.inc
|
2018-08-09 15:06:52 +01:00
|
|
|
|
|
|
|
call mtr.add_suppression("InnoDB: New log files created");
|
|
|
|
|
|
|
|
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
|
|
|
|
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
|
|
|
|
|
|
|
|
CREATE TABLE t1(i INT PRIMARY KEY) ENGINE INNODB;
|
|
|
|
CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB;
|
|
|
|
CREATE TABLE t3(i INT) ENGINE INNODB;
|
2020-10-27 20:03:41 +03:00
|
|
|
CREATE TABLE t10(i INT PRIMARY KEY) ENGINE INNODB;
|
2018-08-09 15:06:52 +01:00
|
|
|
|
2021-05-17 18:12:33 +03:00
|
|
|
set global innodb_log_checkpoint_now = 1;
|
|
|
|
|
2018-08-09 15:06:52 +01:00
|
|
|
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 t1 values(1);
|
|
|
|
|
|
|
|
--let after_load_tablespaces=CREATE TABLE test.t4 ENGINE=INNODB SELECT UUID() from test.seq_1_to_10000
|
|
|
|
--let after_copy_test_t1=RENAME TABLE test.t1 TO test.t1_renamed
|
|
|
|
--let after_copy_test_t2=DROP TABLE test.t2
|
|
|
|
--let after_copy_test_t3=CREATE INDEX a_i ON test.t3(i);
|
2020-10-27 20:03:41 +03:00
|
|
|
--let before_copy_test_t10=DROP TABLE test.t10
|
MDEV-22929 MariaBackup option to report and/or continue when corruption is encountered
The new option --log-innodb-page-corruption is introduced.
When this option is set, backup is not interrupted if innodb corrupted
page is detected. Instead it logs all found corrupted pages in
innodb_corrupted_pages file in backup directory and finishes with error.
For incremental backup corrupted pages are also copied to .delta file,
because we can't do LSN check for such pages during backup,
innodb_corrupted_pages will also be created in incremental backup
directory.
During --prepare, corrupted pages list is read from the file just after
redo log is applied, and each page from the list is checked if it is allocated
in it's tablespace or not. If it is not allocated, then it is zeroed out,
flushed to the tablespace and removed from the list. If all pages are removed
from the list, then --prepare is finished successfully and
innodb_corrupted_pages file is removed from backup directory. Otherwise
--prepare is finished with error message and innodb_corrupted_pages contains
the list of the pages, which are detected as corrupted during backup, and are
allocated in their tablespaces, what means backup directory contains corrupted
innodb pages, and backup can not be considered as consistent.
For incremental --prepare corrupted pages from .delta files are applied
to the base backup, innodb_corrupted_pages is read from both base in
incremental directories, and the same action is proceded for corrupted
pages list as for full --prepare. innodb_corrupted_pages file is
modified or removed only in base directory.
If DDL happens during backup, it is also processed at the end of backup
to have correct tablespace names in innodb_corrupted_pages.
2020-08-20 16:49:40 +03:00
|
|
|
--let wait_innodb_redo_before_copy_test_t10 = 1
|
2018-08-09 15:06:52 +01:00
|
|
|
|
2020-10-27 20:03:41 +03:00
|
|
|
# mariabackup should crash with assertion if MDEV-24026 is not fixed
|
|
|
|
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --dbug=+d,mariabackup_events,mariabackup_inject_code;
|
2018-08-09 15:06:52 +01:00
|
|
|
--let after_load_tablespaces=
|
|
|
|
--disable_result_log
|
|
|
|
echo # Prepare full backup, apply incremental one;
|
2020-06-08 11:45:56 +03:00
|
|
|
exec $XTRABACKUP --prepare --target-dir=$basedir;
|
2018-08-09 15:06:52 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
# Test that t1 does not exist, but t1_renamed does
|
|
|
|
CREATE TABLE t1(i int);
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
SELECT * from t1_renamed;
|
|
|
|
DROP TABLE t1_renamed;
|
|
|
|
|
|
|
|
# Test that t2 does not exist;
|
|
|
|
CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB;
|
|
|
|
DROP TABLE t2;
|
|
|
|
|
|
|
|
DROP TABLE t3;
|
|
|
|
DROP TABLE t4;
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rmdir $basedir;
|
|
|
|
rmdir $incremental_dir;
|