Merge lp:~longbow/percona-xtrabackup/fix_691090 into lp:percona-xtrabackup/2.0

Proposed by Valentine Gostev
Status: Superseded
Proposed branch: lp:~longbow/percona-xtrabackup/fix_691090
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 123 lines (+76/-6)
3 files modified
innobackupex (+6/-6)
test/t/xb_perm_basic.sh (+34/-0)
test/t/xb_perm_stream.sh (+36/-0)
To merge this branch: bzr merge lp:~longbow/percona-xtrabackup/fix_691090
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Needs Fixing
Stewart Smith (community) Needs Fixing
Review via email: mp+79396@code.launchpad.net

This proposal has been superseded by a proposal from 2011-10-26.

Description of the change

xtrabackup_suspended and xtrabackup_checkpoints now always created in tmp_dir.

To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) wrote :

Please also update the documentation as the documentation for the behavior of --suspend-at-end and --stream doesn't exist (and it should).

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

I would also like to see a separate test case rather than a modification of existing one(s).

review: Needs Fixing
318. By Valentine Gostev

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.

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

The problem with the tests is that if innobackupex fails for whatever reasons with permissions on $mysql_datadir modified, that directory cannot be removed, because the current user has no write access. So it stays there forever.

What's worse is that a Jenkins run for this MP has already poisoned slaves. There are failures like this: http://jenkins.percona.com/view/Percona%20Xtrabackup/job/percona-xtrabackup-param/80/BUILD_TYPE=release,Host=el6-64,xtrabackuptarget=xtradb55/testReport/junit/%28root%29/t_xb_perm_stream/sh/. And there are phantom xb_perm_* test failures even when the branch being tests does not have those tests!

review: Needs Fixing

Unmerged revisions

318. By Valentine Gostev

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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'innobackupex'
--- innobackupex 2011-10-21 17:47:31 +0000
+++ innobackupex 2011-10-26 05:47:24 +0000
@@ -419,17 +419,17 @@
419 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_logfile': $!";419 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_logfile': $!";
420 unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!";420 unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!";
421421
422 system("scp $option_scp_opt '$orig_datadir/xtrabackup_checkpoints' '$option_remote_host:$backup_dir/xtrabackup_checkpoints'")422 system("scp $option_scp_opt '$option_tmpdir/xtrabackup_checkpoints' '$option_remote_host:$backup_dir/xtrabackup_checkpoints'")
423 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_checkpoints': $!";423 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_checkpoints': $!";
424 unlink "$orig_datadir/xtrabackup_checkpoints" || Die "Failed to delete '$orig_datadir/xtrabackup_checkpoints': $!";424 unlink "$option_tmpdir/xtrabackup_checkpoints" || Die "Failed to delete '$option_tmpdir/xtrabackup_checkpoints': $!";
425 } elsif ($option_stream eq 'tar') {425 } elsif ($option_stream eq 'tar') {
426 system("cd $option_tmpdir; tar chf - xtrabackup_logfile")426 system("cd $option_tmpdir; tar chf - xtrabackup_logfile")
427 and Die "Failed to stream 'xtrabackup_logfile': $!";427 and Die "Failed to stream 'xtrabackup_logfile': $!";
428 unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!";428 unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!";
429429
430 system("cd $orig_datadir; tar chf - xtrabackup_checkpoints")430 system("cd $option_tmpdir; tar chf - xtrabackup_checkpoints")
431 and Die "Failed to stream 'xtrabackup_checkpoints': $!";431 and Die "Failed to stream 'xtrabackup_checkpoints': $!";
432 unlink "$orig_datadir/xtrabackup_checkpoints" || Die "Failed to delete '$orig_datadir/xtrabackup_checkpoints': $!";432 unlink "$option_tmpdir/xtrabackup_checkpoints" || Die "Failed to delete '$option_tmpdir/xtrabackup_checkpoints': $!";
433 }433 }
434434
435 print STDERR "\n$prefix Backup created in directory '$backup_dir'\n";435 print STDERR "\n$prefix Backup created in directory '$backup_dir'\n";
@@ -758,7 +758,7 @@
758 $options = $options . " --target-dir=$backup_dir";758 $options = $options . " --target-dir=$backup_dir";
759 } else {759 } else {
760 #(datadir) for 'xtrabackup_suspended' and 'xtrabackup_checkpoints'760 #(datadir) for 'xtrabackup_suspended' and 'xtrabackup_checkpoints'
761 $options = $options . " --log-stream --target-dir=./";761 $options = $options . " --log-stream --target-dir=" . $option_tmpdir;
762 }762 }
763763
764 # prepare command line for running ibbackup764 # prepare command line for running ibbackup
@@ -1469,7 +1469,7 @@
1469 $binlog_info = $backup_dir . '/xtrabackup_binlog_info';1469 $binlog_info = $backup_dir . '/xtrabackup_binlog_info';
1470 $slave_info = $backup_dir . '/xtrabackup_slave_info';1470 $slave_info = $backup_dir . '/xtrabackup_slave_info';
1471 } else {1471 } else {
1472 $suspend_file = get_option(\%config, 'mysqld', 'datadir') . '/xtrabackup_suspended';1472 $suspend_file = $option_tmpdir . '/xtrabackup_suspended';
1473 $tmp_logfile = $option_tmpdir . '/xtrabackup_logfile';1473 $tmp_logfile = $option_tmpdir . '/xtrabackup_logfile';
1474 $mysql_stdout = $option_tmpdir . '/mysql-stdout';1474 $mysql_stdout = $option_tmpdir . '/mysql-stdout';
1475 $mysql_stderr = $option_tmpdir . '/mysql-stderr';1475 $mysql_stderr = $option_tmpdir . '/mysql-stderr';
14761476
=== added file 'test/t/xb_perm_basic.sh'
--- test/t/xb_perm_basic.sh 1970-01-01 00:00:00 +0000
+++ test/t/xb_perm_basic.sh 2011-10-26 05:47:24 +0000
@@ -0,0 +1,34 @@
1. inc/common.sh
2
3init
4run_mysqld
5load_dbase_schema sakila
6load_dbase_data sakila
7
8mkdir -p $topdir/backup
9chmod -R 500 $mysql_datadir
10innobackupex --no-timestamp $topdir/backup
11chmod -R 700 $mysql_datadir
12backup_dir=$topdir/backup
13vlog "Backup created in directory $backup_dir"
14
15stop_mysqld
16# Remove datadir
17rm -r $mysql_datadir
18#init_mysql_dir
19# Restore sakila
20vlog "Applying log"
21vlog "###########"
22vlog "# PREPARE #"
23vlog "###########"
24innobackupex --apply-log $backup_dir
25vlog "Restoring MySQL datadir"
26mkdir -p $mysql_datadir
27vlog "###########"
28vlog "# RESTORE #"
29vlog "###########"
30innobackupex --copy-back $backup_dir
31
32run_mysqld
33# Check sakila
34run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
035
=== added file 'test/t/xb_perm_stream.sh'
--- test/t/xb_perm_stream.sh 1970-01-01 00:00:00 +0000
+++ test/t/xb_perm_stream.sh 2011-10-26 05:47:24 +0000
@@ -0,0 +1,36 @@
1. inc/common.sh
2
3init
4run_mysqld
5load_dbase_schema sakila
6load_dbase_data sakila
7
8# Take backup
9chmod -R 500 $mysql_datadir
10mkdir -p $topdir/backup
11innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar
12chmod -R 700 $mysql_datadir
13
14stop_mysqld
15# Remove datadir
16rm -r $mysql_datadir
17# Restore sakila
18vlog "Applying log"
19backup_dir=$topdir/backup
20cd $backup_dir
21$TAR -ixvf out.tar
22cd - >/dev/null 2>&1
23vlog "###########"
24vlog "# PREPARE #"
25vlog "###########"
26innobackupex --apply-log $backup_dir
27vlog "Restoring MySQL datadir"
28mkdir -p $mysql_datadir
29vlog "###########"
30vlog "# RESTORE #"
31vlog "###########"
32innobackupex --copy-back $backup_dir
33
34run_mysqld
35# Check sakila
36run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila

Subscribers

People subscribed via source and target branches