Merge lp:~lachlan-mulcahy/percona-xtrabackup/1.6-bug857788 into lp:percona-xtrabackup/1.6

Proposed by Lachlan Mulcahy
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 300
Proposed branch: lp:~lachlan-mulcahy/percona-xtrabackup/1.6-bug857788
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 63 lines (+13/-10)
1 file modified
innobackupex (+13/-10)
To merge this branch: bzr merge lp:~lachlan-mulcahy/percona-xtrabackup/1.6-bug857788
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+77064@code.launchpad.net

Commit message

Merged fix for bug 857788

In some cases certain combinations of options would create a situation where innobackupex attempted to send commands through a mysql connection that was no longer open.

Description of the change

  Fixed bug 857788

  In some cases certain combinations of options would create a situation where innobackupex attempted to send commands through a mysql connection that was no longer open.

  This patch greatly simplifies the connection open and closing so that it's less confusing to know, depending on which options you are using, whether you need to open a fresh connection or not, just always try to reuse the same one.

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

Looks good.

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-09-21 09:00:00 +0000
3+++ innobackupex 2011-09-26 22:57:28 +0000
4@@ -359,24 +359,27 @@
5 wait_for_ibbackup_suspend();
6 }
7
8+ # connect to database
9+ mysql_open();
10+ mysql_check();
11+
12 if ($option_safe_slave_backup) {
13- mysql_open();
14 mysql_check();
15 wait_for_safe_slave();
16- mysql_close();
17 }
18
19 if (!$option_incremental) {
20- # connect to database
21- mysql_open();
22-
23 # flush tables with read lock
24 mysql_check();
25 mysql_lockall() if !$option_no_lock;
26
27 }
28
29- write_slave_info() if $option_slave_info;
30+ if ($option_slave_info) {
31+ mysql_check();
32+ write_slave_info();
33+ }
34+
35
36 # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files
37 backup_files();
38@@ -385,21 +388,21 @@
39 my $ibbackup_exit_code = resume_ibbackup();
40
41 if (!$option_incremental) {
42+ mysql_check();
43 # release read locks on all tables
44 mysql_unlockall() if !$option_no_lock;
45
46- # disconnect from database
47- mysql_close();
48 }
49
50 if ( $option_safe_slave_backup ) {
51- mysql_open();
52 mysql_check();
53 print STDERR "$prefix: Starting slave SQL thread\n";
54 mysql_send('START SLAVE SQL_THREAD;');
55- mysql_close();
56 }
57
58+ # Close the DB connection
59+ mysql_close();
60+
61 if ($option_remote_host) {
62 system("scp $option_scp_opt '$tmp_logfile' '$option_remote_host:$backup_dir/xtrabackup_logfile'")
63 and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_logfile': $!";

Subscribers

People subscribed via source and target branches