mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-13564: Refuse MLOG_TRUNCATE in mariabackup
The MySQL 5.7 TRUNCATE TABLE is inherently incompatible with hot backup, because it is creating and deleting a separate log file, and it is not writing redo log for all changes of the InnoDB data dictionary tables. Refuse to create a corrupted backup if the unsafe form of TRUNCATE was executed. Note: Undo log tablespace truncation cannot be detected easily. Also it is incompatible with backup, for similar reasons. xtrabackup_backup_func(): "Subscribe to" the log events before the first invocation of xtrabackup_copy_logfile(). recv_parse_or_apply_log_rec_body(): If the function pointer log_truncate is set, invoke it to report MLOG_TRUNCATE.
This commit is contained in:
19
mysql-test/suite/mariabackup/truncate_during_backup.test
Normal file
19
mysql-test/suite/mariabackup/truncate_during_backup.test
Normal file
@@ -0,0 +1,19 @@
|
||||
--source include/have_debug.inc
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
mkdir $targetdir;
|
||||
|
||||
CREATE TABLE t1 ENGINE=InnoDB SELECT 1;
|
||||
|
||||
--let after_load_tablespaces=TRUNCATE test.t1
|
||||
|
||||
--disable_result_log
|
||||
--error 1
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
--enable_result_log
|
||||
|
||||
--let after_load_tablespaces=
|
||||
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_log_checkpoint_now=1;
|
||||
SET GLOBAL innodb_log_checkpoint_now=DEFAULT;
|
||||
rmdir $targetdir;
|
Reference in New Issue
Block a user