Merge lp:~gl-az/percona-xtrabackup/bug1250375-2.2 into lp:percona-xtrabackup/2.2

Proposed by George Ormond Lorch III
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4930
Proposed branch: lp:~gl-az/percona-xtrabackup/bug1250375-2.2
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 75 lines (+60/-0)
2 files modified
storage/innobase/xtrabackup/innobackupex.pl (+22/-0)
storage/innobase/xtrabackup/test/t/bug1250375.sh (+38/-0)
To merge this branch: bzr merge lp:~gl-az/percona-xtrabackup/bug1250375-2.2
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+201527@code.launchpad.net

Description of the change

Fix for bug 1250375 : PXB 56 in galera mode should backup last binlog file.

When --galera-info is specified and Executed_Gtid_Set is valid (PXB 5.6 only or better), innobackupex will execute FLUSH BINARY LOGS and then carry the current binary log as indicated in SHOW MASTER STATUS into the backup set.

Created simple test case (bug1250375.sh) based on xb_galera_info.sh that is only valid for PXC 5.6 or greater to test that the correct bin-log file is present within the backup set.

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) wrote :
Revision history for this message
George Ormond Lorch III (gl-az) wrote :

Similar to the 2.1 comments:

Reviewed the changes myself again after a break and re-orderd things a bit in write_galera_info...new jenkins here http://jenkins.percona.com/view/PXB%202.2/job/percona-xtrabackup-2.2-param/84/ but one host is now having issues. I will restart tests when the issue clears and post new comments.

Revision history for this message
George Ormond Lorch III (gl-az) wrote :
Revision history for this message
Alexey Kopytov (akopytov) :
review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :

After running it through PXC 5.6 enabled Jenkins:

- log_slave_updates is also a pre-requisite for gtid_mode
- $con->{master_status}->{Executed_Gtid_Set} is always defined on a 5.6 server (but is empty, if GTID is disabled).

I will fix it in the merge revision.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'storage/innobase/xtrabackup/innobackupex.pl'
--- storage/innobase/xtrabackup/innobackupex.pl 2014-01-12 13:29:37 +0000
+++ storage/innobase/xtrabackup/innobackupex.pl 2014-01-15 18:32:40 +0000
@@ -3149,6 +3149,28 @@
31493149
3150 write_to_backup_file("$galera_info", "$state_uuid" .3150 write_to_backup_file("$galera_info", "$state_uuid" .
3151 ":" . "$last_committed" . "\n");3151 ":" . "$last_committed" . "\n");
3152
3153 if (!defined($con->{master_status})) {
3154 get_mysql_master_status($con);
3155 }
3156
3157 if (defined($con->{master_status}->{Executed_Gtid_Set})) {
3158 my $log_bin_dir;
3159 my $log_bin_file;
3160
3161 mysql_query($con, "FLUSH BINARY LOGS");
3162 get_mysql_master_status($con);
3163
3164 $log_bin_file = $con->{master_status}->{File};
3165 $log_bin_dir = File::Basename::dirname($mysql{vars}->{log_bin_basename}->{Value});
3166
3167 if (!defined($log_bin_file) || !defined($log_bin_dir)) {
3168 die "Failed to get master binlog coordinates from SHOW MASTER STATUS";
3169 }
3170
3171 backup_file("$log_bin_dir", "$log_bin_file",
3172 "$backup_dir/$log_bin_dir/$log_bin_file")
3173 }
3152}3174}
31533175
31543176
31553177
=== added file 'storage/innobase/xtrabackup/test/t/bug1250375.sh'
--- storage/innobase/xtrabackup/test/t/bug1250375.sh 1970-01-01 00:00:00 +0000
+++ storage/innobase/xtrabackup/test/t/bug1250375.sh 2014-01-15 18:32:40 +0000
@@ -0,0 +1,38 @@
1. inc/common.sh
2
3require_galera
4require_server_version_higher_than 5.6.0
5
6ADDR=127.0.0.1
7
8if [[ -n ${WSREP_DEBUG:-} ]];then
9 start_server --log-bin=`hostname`-bin --binlog-format=ROW --wsrep-provider=${MYSQL_BASEDIR}/lib/libgalera_smm.so --wsrep_cluster_address=gcomm:// --wsrep-debug=1 --wsrep_provider_options="debug=1" --wsrep_node_address=$ADDR --gtid_mode=ON
10else
11 start_server --log-bin=`hostname`-bin --binlog-format=ROW --wsrep-provider=${MYSQL_BASEDIR}/lib/libgalera_smm.so --wsrep_cluster_address=gcomm:// --wsrep_node_address=$ADDR --gtid_mode=ON
12
13fi
14
15
16innobackupex --no-timestamp --galera-info $topdir/backup
17backup_dir=$topdir/backup
18vlog "Backup created in directory $backup_dir"
19
20count=0
21master_file=
22
23while read line; do
24 if [ $count -eq 1 ] # File:
25 then
26 master_file=`echo "$line" | sed s/File://`
27 break
28 fi
29 count=$((count+1))
30done <<< "`run_cmd $MYSQL $MYSQL_ARGS -Nse 'SHOW MASTER STATUS\G' mysql`"
31
32stop_server
33
34if [ -f "$backup_dir/$master_file" ]
35then
36 vlog "Could not find bin-log file in backup set, expecting to find $master_file"
37 exit 1
38fi

Subscribers

People subscribed via source and target branches