Merge lp:~akopytov/percona-xtrabackup/bug834657 into lp:percona-xtrabackup/2.0

Proposed by Alexey Kopytov on 2011-08-30
Status: Merged
Approved by: Stewart Smith on 2011-09-14
Approved revision: 302
Merged at revision: 302
Proposed branch: lp:~akopytov/percona-xtrabackup/bug834657
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 63 lines (+33/-1)
2 files modified
innobackupex (+8/-1)
test/t/ib_slave_info.sh (+25/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug834657
Reviewer Review Type Date Requested Status
Stewart Smith (community) 2011-08-30 Approve on 2011-09-14
Review via email: mp+73322@code.launchpad.net
To post a comment you must log in.
Stewart Smith (stewart) :
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 2011-06-12 10:17:35 +0000
3+++ innobackupex 2011-08-30 03:13:50 +0000
4@@ -388,6 +388,7 @@
5 mysql_check();
6 mysql_lockall() if !$option_no_lock;
7
8+ write_slave_info() if $option_slave_info;
9
10 # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files
11 backup_files();
12@@ -1219,7 +1220,6 @@
13 mysql_send "COMMIT;";
14 }
15 write_binlog_info;
16- write_slave_info if $option_slave_info;
17
18 $now = current_time();
19 print STDERR "$now $prefix All tables locked and flushed to disk\n";
20@@ -1686,6 +1686,13 @@
21 $backup_dir = File::Spec->rel2abs($ARGV[0]);
22 }
23
24+ if ($option_slave_info) {
25+ if ($option_no_lock and !$option_safe_slave_backup) {
26+ print STDERR "--slave-info is used with --no-lock but without --safe-slave-backup. The binlog position cannot be consistent with the backup data.\n";
27+ exit(1);
28+ }
29+ }
30+
31 print STDERR "\n";
32
33 parse_databases_option_value();
34
35=== added file 'test/t/ib_slave_info.sh'
36--- test/t/ib_slave_info.sh 1970-01-01 00:00:00 +0000
37+++ test/t/ib_slave_info.sh 2011-08-30 03:13:50 +0000
38@@ -0,0 +1,25 @@
39+. inc/common.sh
40+
41+init
42+run_mysqld --innodb_file_per_table
43+load_dbase_schema incremental_sample
44+
45+# Adding initial rows
46+vlog "Adding initial rows to database..."
47+numrow=100
48+count=0
49+while [ "$numrow" -gt "$count" ]
50+do
51+ ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
52+ let "count=count+1"
53+done
54+vlog "Initial rows added"
55+
56+# Full backup
57+# backup root directory
58+mkdir -p $topdir/backup
59+
60+vlog "Check that --slave-info with --no-lock and no --safe-slave-backup fails"
61+run_cmd_expect_failure $IB_BIN $IB_ARGS --slave-info --no-lock $topdir/backup
62+
63+# TODO: add positive tests when the test suite is able to setup replication

Subscribers

People subscribed via source and target branches