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-15780 : Mariabackup with absolute paths in innodb_data_file_path
System tablespace can be specified with absolute path, if innodb_data_home_dir is empty. This was not handled well by mariabackup 1. In backup phase, empty innodb_data_home_dir variable from server was not recognized. full paths were stored in backup-my.ini, even if it stored all files locally. thus prepare phase would not find the system tablespace files. 2. In copy-back phase, copy would not be done to the absolute destination path, as path would be stripped with trim_dotslash This patch fixes the above defects.
- Loading branch information
Showing
5 changed files
with
86 additions
and
4 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 @@ | ||
| --innodb --innodb-data-home-dir= --innodb-data-file-path=$MYSQLTEST_VARDIR/tmp/absolute_path_ibdata1: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,10 @@ | ||
| CREATE TABLE t(i INT) ENGINE INNODB; | ||
| INSERT INTO t VALUES(1); | ||
| # xtrabackup backup | ||
| # remove datadir | ||
| # xtrabackup copy back | ||
| # restart server | ||
| SELECT * from t; | ||
| i | ||
| 1 | ||
| 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,31 @@ | ||
| # This test just backs up and restores empty database | ||
| # Innodb system tablespace is specified with absolute path in the .opt file | ||
| CREATE TABLE t(i INT) ENGINE INNODB; | ||
| INSERT INTO t VALUES(1); | ||
| echo # xtrabackup backup; | ||
|
|
||
| let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; | ||
| let $_innodb_data_file_path=`select @@innodb_data_file_path`; | ||
| let $_innodb_data_home_dir=`select @@innodb_data_home_dir`; | ||
| let $_datadir= `SELECT @@datadir`; | ||
|
|
||
| --disable_result_log | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; | ||
| --enable_result_log | ||
| exec $XTRABACKUP --prepare --target-dir=$targetdir; | ||
|
|
||
| --source include/shutdown_mysqld.inc | ||
| echo # remove datadir; | ||
| rmdir $_datadir; | ||
| #remove out-of-datadir ibdata1 | ||
| remove_file $MYSQLTEST_VARDIR/tmp/absolute_path_ibdata1; | ||
| echo # xtrabackup copy back; | ||
| exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir "--innodb_data_file_path=$_innodb_data_file_path" --innodb_data_home_dir=$_innodb_data_home_dir; | ||
| echo # restart server; | ||
| --source include/start_mysqld.inc | ||
| --enable_result_log | ||
|
|
||
| SELECT * from t; | ||
| DROP TABLE t; | ||
| rmdir $targetdir; | ||
|
|