Merge lp:~sergei.glushchenko/percona-xtrabackup/bug691090-1.6 into lp:percona-xtrabackup/1.6

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 320
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/bug691090-1.6
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 75 lines (+28/-6)
3 files modified
innobackupex (+6/-6)
test/t/xb_perm_basic.sh (+10/-0)
test/t/xb_perm_stream.sh (+12/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/bug691090-1.6
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+90279@code.launchpad.net

Description of the change

Bug 691090
Files xtrabackup_checkpoints and xtrabackup_suspended should be kept in tmp
dir, since user running innobackupex may not have permissions to write mysql
datadir.

Modified xb_basic and xb_stream tests to make datadir readonly while
innobackupex is running.

http://jenkins.percona.com/view/Percona%20Xtrabackup/job/percona-xtrabackup-1.6-param/102/

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

OK to merge.

review: Approve
Revision history for this message
Alexey Kopytov (akopytov) wrote :

But in future please add the bug # and bug summary to revision comments.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2012-01-09 05:26:49 +0000
3+++ innobackupex 2012-01-27 11:32:03 +0000
4@@ -409,17 +409,17 @@
5 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_logfile': $!";
6 unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!";
7
8- system("scp $option_scp_opt '$orig_datadir/xtrabackup_checkpoints' '$option_remote_host:$backup_dir/xtrabackup_checkpoints'")
9+ system("scp $option_scp_opt '$option_tmpdir/xtrabackup_checkpoints' '$option_remote_host:$backup_dir/xtrabackup_checkpoints'")
10 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_checkpoints': $!";
11- unlink "$orig_datadir/xtrabackup_checkpoints" || Die "Failed to delete '$orig_datadir/xtrabackup_checkpoints': $!";
12+ unlink "$option_tmpdir/xtrabackup_checkpoints" || Die "Failed to delete '$option_tmpdir/xtrabackup_checkpoints': $!";
13 } elsif ($option_stream eq 'tar') {
14 system("cd $option_tmpdir; tar chf - xtrabackup_logfile")
15 and Die "Failed to stream 'xtrabackup_logfile': $!";
16 unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!";
17
18- system("cd $orig_datadir; tar chf - xtrabackup_checkpoints")
19+ system("cd $option_tmpdir; tar chf - xtrabackup_checkpoints")
20 and Die "Failed to stream 'xtrabackup_checkpoints': $!";
21- unlink "$orig_datadir/xtrabackup_checkpoints" || Die "Failed to delete '$orig_datadir/xtrabackup_checkpoints': $!";
22+ unlink "$option_tmpdir/xtrabackup_checkpoints" || Die "Failed to delete '$option_tmpdir/xtrabackup_checkpoints': $!";
23 }
24
25 print STDERR "\n$prefix Backup created in directory '$backup_dir'\n";
26@@ -785,7 +785,7 @@
27 $options = $options . " --target-dir=$backup_dir";
28 } else {
29 #(datadir) for 'xtrabackup_suspended' and 'xtrabackup_checkpoints'
30- $options = $options . " --log-stream --target-dir=./";
31+ $options = $options . " --log-stream --target-dir=" . $option_tmpdir;
32 }
33
34 # prepare command line for running ibbackup
35@@ -1519,7 +1519,7 @@
36 $binlog_info = $backup_dir . '/xtrabackup_binlog_info';
37 $slave_info = $backup_dir . '/xtrabackup_slave_info';
38 } else {
39- $suspend_file = get_option(\%config, 'mysqld', 'datadir') . '/xtrabackup_suspended';
40+ $suspend_file = $option_tmpdir . '/xtrabackup_suspended';
41 $tmp_logfile = $option_tmpdir . '/xtrabackup_logfile';
42 if ($option_stream) {
43 $backup_config_file = $option_tmpdir . '/backup-my.cnf';
44
45=== added file 'test/t/xb_perm_basic.sh'
46--- test/t/xb_perm_basic.sh 1970-01-01 00:00:00 +0000
47+++ test/t/xb_perm_basic.sh 2012-01-27 11:32:03 +0000
48@@ -0,0 +1,10 @@
49+# Test for fix of https://bugs.launchpad.net/percona-xtrabackup/+bug/691090
50+. inc/common.sh
51+
52+init
53+run_mysqld
54+
55+chmod -R 500 $mysql_datadir
56+trap "vlog restoring permissions on datadir $mysql_datadir ; \
57+chmod -R 700 $mysql_datadir" INT TERM EXIT
58+innobackupex --no-timestamp $topdir/backup
59
60=== added file 'test/t/xb_perm_stream.sh'
61--- test/t/xb_perm_stream.sh 1970-01-01 00:00:00 +0000
62+++ test/t/xb_perm_stream.sh 2012-01-27 11:32:03 +0000
63@@ -0,0 +1,12 @@
64+# Test for fix of https://bugs.launchpad.net/percona-xtrabackup/+bug/691090
65+. inc/common.sh
66+
67+init
68+run_mysqld
69+
70+# Take backup
71+chmod -R 500 $mysql_datadir
72+trap "vlog restoring permissions on datadir $mysql_datadir ; \
73+chmod -R 700 $mysql_datadir" INT TERM EXIT
74+mkdir -p $topdir/backup
75+innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar

Subscribers

People subscribed via source and target branches