Merge lp:~lachlan-mulcahy/percona-xtrabackup/1.7-bug903984 into lp:percona-xtrabackup/2.0

Proposed by Lachlan Mulcahy
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 348
Proposed branch: lp:~lachlan-mulcahy/percona-xtrabackup/1.7-bug903984
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 50 lines (+34/-8)
1 file modified
innobackupex (+34/-8)
To merge this branch: bzr merge lp:~lachlan-mulcahy/percona-xtrabackup/1.7-bug903984
Reviewer Review Type Date Requested Status
Stewart Smith Pending
Review via email: mp+86126@code.launchpad.net

Commit message

Fixed bug 903984.
When applying incremental deltas to a backup dir:

If a new xtrabackup_slave_info exists in the incremental delta dir, we update the target dir with the new file
If there is no xtrabackup_slave_info file in the incremental delta dir, we simply remove the xtrabackup_slave_info file from the target dir, to prevent the slave position information being used incorrectly.

Description of the change

Fixed bug 903984.
When applying incremental deltas to a backup dir:

If a new xtrabackup_slave_info exists in the incremental delta dir, we update the target dir with the new file
If there is no xtrabackup_slave_info file in the incremental delta dir, we simply remove the xtrabackup_slave_info file from the target dir, to prevent the slave position information being used incorrectly.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2011-12-14 05:52:46 +0000
3+++ innobackupex 2011-12-16 23:03:23 +0000
4@@ -705,14 +705,40 @@
5 # We should not create ib_logfile files if we prepare for following incremental applies
6 # Also we do not prepare ib_logfile if we applied incremental changes
7 if (!( ($option_redo_only) or ($option_incremental_dir))) {
8- $now = current_time();
9- print STDERR "\n$now $prefix Restarting xtrabackup with command: $cmdline\nfor creating ib_logfile*\n\n";
10- $rcode = system("$cmdline");
11- if ($rcode) {
12- # failure
13- Die "\n$prefix xtrabackup (2nd execution) failed";
14- }
15- }
16+ $now = current_time();
17+ print STDERR "\n$now $prefix Restarting xtrabackup with command: $cmdline\nfor creating ib_logfile*\n\n";
18+ $rcode = system("$cmdline");
19+ if ($rcode) {
20+ # failure
21+ Die "\n$prefix xtrabackup (2nd execution) failed";
22+ }
23+ }
24+
25+ # If we were applying an incremental change set, we need to make sure the xtrabackup_slave_info is still correct
26+ if ( $option_incremental_dir ) {
27+
28+ # If the latest backup has this file, then update the target dir with the new file
29+ if ( -e "$option_incremental_dir/xtrabackup_slave_info" ) {
30+ print STDERR "\n$now $prefix Updating xtrabackup_slave_info with new slave position info...";
31+ $cmdline = "cp $option_incremental_dir/xtrabackup_slave_info $backup_dir/xtrabackup_slave_info";
32+ $rcode = system("$cmdline");
33+ if ($rcode) {
34+ # failure
35+ Die "\n$prefix Failed to update xtrabackup_slave_info in $backup_dir";
36+ }
37+ # If the latest backup has no file, we need to remove the old xtrabackup_slave_info file, because it is out of date
38+ } elsif ( -e "$backup_dir/xtrabackup_slave_info" ) {
39+ print STDERR "\n$now $prefix No updated xtrabackup_slave_info found in incremental dir, removing stale xtrabackup_slave_info file from target dir.";
40+ $cmdline = "rm $backup_dir/xtrabackup_slave_info";
41+ $rcode = system("$cmdline");
42+ if ($rcode) {
43+ # failure
44+ Die "\n$prefix Failed to remove stale xtrabackup_slave_info in $backup_dir";
45+ }
46+
47+ }
48+ }
49+
50 }
51
52

Subscribers

People subscribed via source and target branches