Skip to content

Commit 9b6cfb7

Browse files
Merge pull request #1716 from jakub-nowakowski-percona/PXB-3458-8.4
PXB-3458 : Ignore invalid innodb_undo_directory setting in --copy-back mode
2 parents a954ec2 + c7f2484 commit 9b6cfb7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

storage/innobase/xtrabackup/src/backup_copy.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ struct datadir_thread_ctxt_t {
160160
bool ret;
161161
};
162162

163-
164163
/************************************************************************
165164
Trim leading slashes from absolute path so it becomes relative */
166165
static const char *trim_dotslash(const char *path) {
@@ -2290,7 +2289,15 @@ bool copy_back(int argc, char **argv) {
22902289

22912290
/* copy undo tablespaces */
22922291
if (srv_undo_tablespaces > 0) {
2293-
dst_dir = (srv_undo_dir && *srv_undo_dir) ? srv_undo_dir : mysql_data_home;
2292+
dst_dir = mysql_data_home;
2293+
2294+
// If innodb_undo_directory is set, use it as the destination directory.
2295+
// Ignore innodb_undo_directory if it's set to "./" (default value), because
2296+
// it will make xtrabackup try to copy files back to backup directory,
2297+
// resulting in "file exists" errors.
2298+
if (srv_undo_dir && *srv_undo_dir && strcmp(srv_undo_dir, "./") != 0) {
2299+
dst_dir = srv_undo_dir;
2300+
}
22942301

22952302
ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);
22962303

0 commit comments

Comments
 (0)