Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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.
- Loading branch information
Showing
5 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE TABLE t1 ENGINE=InnoDB SELECT 1; | ||
| DROP TABLE t1; | ||
| SET GLOBAL innodb_log_checkpoint_now=1; | ||
| SET GLOBAL innodb_log_checkpoint_now=DEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters