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

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 339
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1002688-1.6
Merge into: lp:percona-xtrabackup/1.6
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-1.6
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+106857@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
=== modified file 'innobackupex'
--- innobackupex 2012-04-17 12:44:49 +0000
+++ innobackupex 2012-05-22 16:52:20 +0000
@@ -564,7 +564,7 @@
564 "file $copy_dir_dst/$_ exists";564 "file $copy_dir_dst/$_ exists";
565 }565 }
566566
567 print STDERR "$prefix Copying file '$copy_dir_dst/$_'\n";567 print STDERR "$prefix Copying '$File::Find::name' to '$dst_path'\n";
568 copy($File::Find::name, $dst_path) or Die "copy failed: $!";568 copy($File::Find::name, $dst_path) or Die "copy failed: $!";
569 }569 }
570}570}
@@ -584,8 +584,9 @@
584# use rsync when --rsync is specified584# use rsync when --rsync is specified
585#585#
586sub copy_dir_recursively {586sub copy_dir_recursively {
587 $copy_dir_src = shift;587 # Clean paths and remove trailing slashes if any
588 $copy_dir_dst = shift;588 $copy_dir_src = File::Spec->canonpath(shift);
589 $copy_dir_dst = File::Spec->canonpath(shift);
589 $copy_dir_exclude_regexp = shift;590 $copy_dir_exclude_regexp = shift;
590 $copy_dir_overwrite = shift;591 $copy_dir_overwrite = shift;
591592
592593
=== added file 'test/t/bug1002688.sh'
--- test/t/bug1002688.sh 1970-01-01 00:00:00 +0000
+++ test/t/bug1002688.sh 2012-05-22 16:52:20 +0000
@@ -0,0 +1,68 @@
1############################################################################
2# Bug #1002688: innobackupex incremental apply-log copies to wrong directory
3############################################################################
4. inc/common.sh
5
6init
7run_mysqld --innodb_file_per_table
8load_sakila
9
10# Full backup
11# backup root directory
12vlog "Starting backup"
13
14full_backup_dir=$topdir/full_backup
15innobackupex --no-timestamp $full_backup_dir
16
17# Changing data
18
19run_cmd $MYSQL $MYSQL_ARGS -e "CREATE DATABASE newdb"
20run_cmd $MYSQL $MYSQL_ARGS -e \
21 "CREATE TABLE actor_copy ENGINE=MyISAM SELECT * FROM sakila.actor" newdb
22
23# Saving the checksum of original table
24checksum_a=`checksum_table newdb actor_copy`
25test -n "$checksum_a" || die "Failed to checksum table actor_copy"
26
27vlog "Making incremental backup"
28
29# Incremental backup
30inc_backup_dir=$topdir/incremental_backup
31innobackupex --incremental --no-timestamp \
32 --incremental-basedir=$full_backup_dir $inc_backup_dir
33vlog "Incremental backup created in directory $inc_backup_dir"
34
35vlog "Preparing backup"
36innobackupex --apply-log --redo-only $full_backup_dir
37vlog "Log applied to full backup"
38
39innobackupex --apply-log --redo-only --incremental-dir=$inc_backup_dir/ \
40 $full_backup_dir
41vlog "Delta applied to full backup"
42
43innobackupex --apply-log $full_backup_dir
44vlog "Data prepared for restore"
45
46# Destroying mysql data
47stop_mysqld
48rm -rf $mysql_datadir/*
49vlog "Data destroyed"
50
51# Restore backup
52vlog "Copying files to their original locations"
53innobackupex --copy-back $full_backup_dir
54vlog "Data restored"
55
56run_mysqld --innodb_file_per_table
57
58vlog "Checking checksums"
59checksum_b=`checksum_table newdb actor_copy`
60
61vlog "Old checksum: $checksum_a"
62vlog "New checksum: $checksum_b"
63
64if [ "$checksum_a" != "$checksum_b" ]
65then
66 vlog "Checksums do not match"
67 exit -1
68fi

Subscribers

People subscribed via source and target branches