Merge lp:~sergei.glushchenko/percona-xtrabackup/ST-29497-bug1123335-21 into lp:percona-xtrabackup/2.1

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 495
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/ST-29497-bug1123335-21
Merge into: lp:percona-xtrabackup/2.1
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-21
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+148168@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
1=== modified file 'innobackupex'
2--- innobackupex 2013-01-22 01:23:45 +0000
3+++ innobackupex 2013-02-13 12:56:34 +0000
4@@ -2108,7 +2108,7 @@
5 # Remove from $backup_dir files that have been removed between first and
6 # second passes. Cannot use "rsync --delete" because it does not work
7 # with --files-from.
8- if (!$prep_mode) {
9+ if (!$prep_mode && !$option_no_lock) {
10 open(RSYNC, "<$rsync_tmpfile_pass1")
11 || Die "Can't open $rsync_tmpfile_pass1 for reading: $!\n";
12
13
14=== added file 'test/t/ib_rsync_nolock.sh'
15--- test/t/ib_rsync_nolock.sh 1970-01-01 00:00:00 +0000
16+++ test/t/ib_rsync_nolock.sh 2013-02-13 12:56:34 +0000
17@@ -0,0 +1,25 @@
18+. inc/common.sh
19+
20+if ! which rsync > /dev/null 2>&1
21+then
22+ echo "Requires rsync to be installed" > $SKIPPED_REASON
23+ exit $SKIPPED_EXIT_CODE
24+fi
25+
26+start_server --innodb_file_per_table
27+load_sakila
28+
29+innobackupex --rsync --no-lock --no-timestamp $topdir/backup
30+
31+stop_server
32+
33+run_cmd rm -r $mysql_datadir
34+
35+innobackupex --apply-log $topdir/backup
36+
37+run_cmd mkdir -p $mysql_datadir
38+
39+innobackupex --copy-back $topdir/backup
40+
41+start_server
42+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT COUNT(*) FROM actor" sakila

Subscribers

People subscribed via source and target branches