Merge lp:~sergei.glushchenko/percona-xtrabackup/ST-29497-bug1123335-20 into lp:percona-xtrabackup/2.0

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 505
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/ST-29497-bug1123335-20
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 42 lines (+26/-1)
2 files modified
innobackupex (+1/-1)
test/t/ib_rsync_nolock.sh (+25/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/ST-29497-bug1123335-20
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+148167@code.launchpad.net

Description of the change

Bug 1123335
innobackupex fails when --no-lock and --rsync are used in conjunction.
With rsync copy mode copying being done in two stages. During the first
stage files copied without holding a lock. During the second stage we
run rsync once again with tables locked. By doing this we minimize
the time when tables locked (as second rsync pass is shorter then
doing full copy). If If --no-lock is specified, there is no need to
perform two passes and we don't.
The bug is that we only perform second pass (backup_files(0)), and
doesn't tale into account that we don't performed the first one.
Solution is to take into account that with --no-lock option specified
first pass hadn't been performed.
Also adds testcase for --rsync --no-lock combination.

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) 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 2013-01-17 15:08:37 +0000
+++ innobackupex 2013-02-13 12:55:54 +0000
@@ -2256,7 +2256,7 @@
2256 # Remove from $backup_dir files that have been removed between first and2256 # Remove from $backup_dir files that have been removed between first and
2257 # second passes. Cannot use "rsync --delete" because it does not work2257 # second passes. Cannot use "rsync --delete" because it does not work
2258 # with --files-from.2258 # with --files-from.
2259 if (!$prep_mode) {2259 if (!$prep_mode && !$option_no_lock) {
2260 open(RSYNC, "<$rsync_tmpfile_pass1")2260 open(RSYNC, "<$rsync_tmpfile_pass1")
2261 || Die "Can't open $rsync_tmpfile_pass1 for reading: $!\n";2261 || Die "Can't open $rsync_tmpfile_pass1 for reading: $!\n";
22622262
22632263
=== added file 'test/t/ib_rsync_nolock.sh'
--- test/t/ib_rsync_nolock.sh 1970-01-01 00:00:00 +0000
+++ test/t/ib_rsync_nolock.sh 2013-02-13 12:55:54 +0000
@@ -0,0 +1,25 @@
1. inc/common.sh
2
3if ! which rsync > /dev/null 2>&1
4then
5 echo "Requires rsync to be installed" > $SKIPPED_REASON
6 exit $SKIPPED_EXIT_CODE
7fi
8
9start_server --innodb_file_per_table
10load_sakila
11
12innobackupex --rsync --no-lock --no-timestamp $topdir/backup
13
14stop_server
15
16run_cmd rm -r $mysql_datadir
17
18innobackupex --apply-log $topdir/backup
19
20run_cmd mkdir -p $mysql_datadir
21
22innobackupex --copy-back $topdir/backup
23
24start_server
25run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT COUNT(*) FROM actor" sakila

Subscribers

People subscribed via source and target branches