Merge lp:~akopytov/percona-xtrabackup/bug1322658-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 753
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1322658-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 49 lines (+13/-1)
2 files modified
innobackupex.pl (+11/-0)
test/t/remote_tablespaces.sh (+2/-1)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1322658-2.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+227683@code.launchpad.net

Description of the change

    Bug #1322658: fail to restore (copy-back) tables haveing partitions with
                  their own tablespace location

    Changed process_file() to recursively create directories when copying
    back remote tablespaces.

http://jenkins.percona.com/view/PXB%202.1/job/percona-xtrabackup-2.1-param/586/

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex.pl'
2--- innobackupex.pl 2014-06-05 11:45:17 +0000
3+++ innobackupex.pl 2014-07-22 08:57:29 +0000
4@@ -19,6 +19,7 @@
5 use File::Temp;
6 use File::Find;
7 use File::Copy;
8+use File::Path;
9 use English qw(-no_match_vars);
10 use Time::HiRes qw(usleep);
11
12@@ -2190,6 +2191,16 @@
13 file_to_array($isl_path, \@lines);
14 $dst_path = $lines[0];
15 print STDERR "Using $dst_path as the destination path\n";
16+
17+ my $dst_dir = File::Basename::dirname($dst_path);
18+ if (! -d $dst_dir) {
19+ print STDERR "Recursively creating directory $dst_dir\n";
20+
21+ eval { mkpath($dst_dir) };
22+ if ($@) {
23+ die "Could not create directory $dst_dir: $@";
24+ }
25+ }
26 }
27 }
28
29
30=== modified file 'test/t/remote_tablespaces.sh'
31--- test/t/remote_tablespaces.sh 2013-07-25 15:04:49 +0000
32+++ test/t/remote_tablespaces.sh 2014-07-22 08:57:29 +0000
33@@ -8,7 +8,7 @@
34
35 start_server --innodb_file_per_table
36
37-remote_dir=$TEST_VAR_ROOT/var1/remote_dir
38+remote_dir=$TEST_VAR_ROOT/var1/remote_dir/subdir
39
40 $MYSQL $MYSQL_ARGS test <<EOF
41 CREATE TABLE t(id INT AUTO_INCREMENT PRIMARY KEY, c INT)
42@@ -31,6 +31,7 @@
43 stop_server
44
45 rm -rf $mysql_datadir/*
46+rm -rf $remote_dir
47
48 innobackupex --apply-log $topdir/backup
49 innobackupex --copy-back $topdir/backup

Subscribers

People subscribed via source and target branches

to all changes: