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-14447 mariabackup incremental incorrectly extends system tablespace
for multi-file innodb_data_file_path. Use fil_extend_space_to_desired_size() to correctly extend system tablespace. Make sure to get tablespace size from the first tablespace part.
- Loading branch information
Showing
5 changed files
with
90 additions
and
5 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
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 @@ | ||
| --sequence --innodb-data-file-path=ibdata_first:3M;ibdata_second:1M:autoextend |
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 @@ | ||
| call mtr.add_suppression("InnoDB: New log files created"); | ||
| CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB; | ||
| # Create full backup , modify table, then create incremental/differential backup | ||
| BEGIN; | ||
| INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000; | ||
| COMMIT; | ||
| SELECT count(*) FROM t; | ||
| count(*) | ||
| 100000 | ||
| # Prepare full backup, apply incremental one | ||
| # Restore and check results | ||
| # shutdown server | ||
| # remove datadir | ||
| # xtrabackup move back | ||
| # restart server | ||
| SELECT count(*) FROM t; | ||
| count(*) | ||
| 100000 | ||
| DROP TABLE t; |
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,46 @@ | ||
| 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 t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB; | ||
|
|
||
| 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 | ||
| BEGIN; | ||
| INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000; | ||
| COMMIT; | ||
| SELECT count(*) FROM t; | ||
|
|
||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir; | ||
|
|
||
| --disable_result_log | ||
| echo # Prepare full backup, apply incremental one; | ||
| exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir; | ||
| exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ; | ||
|
|
||
| echo # Restore and check results; | ||
| let $targetdir=$basedir; | ||
| #-- source include/restart_and_restore.inc | ||
|
|
||
| let $_datadir= `SELECT @@datadir`; | ||
| let $innodb_data_file_path=`SELECT @@innodb_data_file_path`; | ||
| echo # shutdown server; | ||
| --source include/shutdown_mysqld.inc | ||
| echo # remove datadir; | ||
| rmdir $_datadir; | ||
| echo # xtrabackup move back; | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir "--innodb_data_file_path=$innodb_data_file_path" --target-dir=$targetdir; | ||
| echo # restart server; | ||
| --source include/start_mysqld.inc | ||
|
|
||
|
|
||
| --enable_result_log | ||
| SELECT count(*) FROM t; | ||
| DROP TABLE t; | ||
|
|
||
| # Cleanup | ||
| rmdir $basedir; | ||
| rmdir $incremental_dir; |