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

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 398
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1002688-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 97 lines (+72/-3)
2 files modified
innobackupex (+4/-3)
test/t/bug1002688.sh (+68/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1002688-2.1
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+106968@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2012-05-23 01:02:23 +0000
3+++ innobackupex 2012-05-23 09:18:17 +0000
4@@ -575,7 +575,7 @@
5 "file $copy_dir_dst/$_ exists";
6 }
7
8- print STDERR "$prefix Copying file '$copy_dir_dst/$_'\n";
9+ print STDERR "$prefix Copying '$File::Find::name' to '$dst_path'\n";
10 copy($File::Find::name, $dst_path) or Die "copy failed: $!";
11 }
12 }
13@@ -595,8 +595,9 @@
14 # use rsync when --rsync is specified
15 #
16 sub copy_dir_recursively {
17- $copy_dir_src = shift;
18- $copy_dir_dst = shift;
19+ # Clean paths and remove trailing slashes if any
20+ $copy_dir_src = File::Spec->canonpath(shift);
21+ $copy_dir_dst = File::Spec->canonpath(shift);
22 $copy_dir_exclude_regexp = shift;
23 $copy_dir_overwrite = shift;
24
25
26=== added file 'test/t/bug1002688.sh'
27--- test/t/bug1002688.sh 1970-01-01 00:00:00 +0000
28+++ test/t/bug1002688.sh 2012-05-23 09:18:17 +0000
29@@ -0,0 +1,68 @@
30+############################################################################
31+# Bug #1002688: innobackupex incremental apply-log copies to wrong directory
32+############################################################################
33+. inc/common.sh
34+
35+init
36+run_mysqld --innodb_file_per_table
37+load_sakila
38+
39+# Full backup
40+# backup root directory
41+vlog "Starting backup"
42+
43+full_backup_dir=$topdir/full_backup
44+innobackupex --no-timestamp $full_backup_dir
45+
46+# Changing data
47+
48+run_cmd $MYSQL $MYSQL_ARGS -e "CREATE DATABASE newdb"
49+run_cmd $MYSQL $MYSQL_ARGS -e \
50+ "CREATE TABLE actor_copy ENGINE=MyISAM SELECT * FROM sakila.actor" newdb
51+
52+# Saving the checksum of original table
53+checksum_a=`checksum_table newdb actor_copy`
54+test -n "$checksum_a" || die "Failed to checksum table actor_copy"
55+
56+vlog "Making incremental backup"
57+
58+# Incremental backup
59+inc_backup_dir=$topdir/incremental_backup
60+innobackupex --incremental --no-timestamp \
61+ --incremental-basedir=$full_backup_dir $inc_backup_dir
62+vlog "Incremental backup created in directory $inc_backup_dir"
63+
64+vlog "Preparing backup"
65+innobackupex --apply-log --redo-only $full_backup_dir
66+vlog "Log applied to full backup"
67+
68+innobackupex --apply-log --redo-only --incremental-dir=$inc_backup_dir/ \
69+ $full_backup_dir
70+vlog "Delta applied to full backup"
71+
72+innobackupex --apply-log $full_backup_dir
73+vlog "Data prepared for restore"
74+
75+# Destroying mysql data
76+stop_mysqld
77+rm -rf $mysql_datadir/*
78+vlog "Data destroyed"
79+
80+# Restore backup
81+vlog "Copying files to their original locations"
82+innobackupex --copy-back $full_backup_dir
83+vlog "Data restored"
84+
85+run_mysqld --innodb_file_per_table
86+
87+vlog "Checking checksums"
88+checksum_b=`checksum_table newdb actor_copy`
89+
90+vlog "Old checksum: $checksum_a"
91+vlog "New checksum: $checksum_b"
92+
93+if [ "$checksum_a" != "$checksum_b" ]
94+then
95+ vlog "Checksums do not match"
96+ exit -1
97+fi

Subscribers

People subscribed via source and target branches

to all changes: