innobackupex --galera-info incompatible with MGC-10.0 - part 2

Bug #1326967 reported by Nirbhay Choubey
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
High
Alexey Kopytov
2.1
Won't Fix
Undecided
Unassigned
2.2
Fix Released
High
Alexey Kopytov

Bug Description

Fix for lp:1250375 introduced some changes which are incompatible with MariaDB-10.0
(and older versions).

I had reported a similar bug (lp:1306875), but opening a new one, as this requires
an additional patch.

In MariaDB,
a) "SHOW MASTER|SLAVE STATUS" does not contain "Executed_Gtid_Set" field, and
b) there is no log_bin_basename system variable available.

Suggested fix:

nirbhay@nirbhay-VirtualBox:~/project/packages/percona-xtrabackup-2.1.8-Linux-i686/bin$ diff -u innobackupex.orig innobackupex
--- innobackupex.orig 2014-06-05 11:49:12.523955742 -0400
+++ innobackupex 2014-06-05 16:19:53.444632655 -0400
@@ -3091,6 +3091,7 @@
     my @info_lines = ();
     my $state_uuid = '';
     my $last_committed = '';
+ my $gtid_exists= 0;

     # get binlog position
     get_mysql_status($con);
@@ -3116,9 +3117,16 @@
         get_mysql_master_status($con);
     }

- my $gtid = $con->{master_status}->{Executed_Gtid_Set} || '';
+ # Determine if GTIDs exist.
+ if (defined($con->{master_status}->{Executed_Gtid_Set})) { # >= MySQL-5.6
+ $gtid_exists= 1;
+ } elsif (defined($con->{vars}->{gtid_binlog_state})) { # >= MariaDB-10.0
+ if ($con->{vars}->{gtid_binlog_state}->{Value}) {
+ $gtid_exists= 1;
+ }
+ }

- if ($gtid) {
+ if ($gtid_exists) {
         my $log_bin_dir;
         my $log_bin_file;

@@ -3126,7 +3134,13 @@
         get_mysql_master_status($con);

         $log_bin_file = $con->{master_status}->{File};
- $log_bin_dir = File::Basename::dirname($mysql{vars}->{log_bin_basename}->{Value});
+
+ if (defined($mysql{vars}->{log_bin_basename})) { # >= MySQL-5.6
+ # sysvar.log_bin_basename does not exist in MariaDB
+ $log_bin_dir = File::Basename::dirname($mysql{vars}->{log_bin_basename}->{Value});
+ } else { # fallback to datadir
+ $log_bin_dir = $mysql{vars}->{datadir}->{Value};
+ }

         if (!defined($log_bin_file) || !defined($log_bin_dir)) {
             die "Failed to get master binlog coordinates from SHOW MASTER STATUS";

I have tested this cset with Codership's MySQL Galera server.

Additionally, write_binlog_info & write_slave_info subroutines also try to
extract "Executed_Gtid_Set" value from "SHOW MASTER|SLAVE STATUS".

Tags: mariadb

Related branches

summary: - innobackupex --galera-info incompatible with MGC-10.0
+ innobackupex --galera-info incompatible with MGC-10.0 - part 2
Revision history for this message
Nirbhay Choubey (nirbhay) wrote :

FYI, the patch submitted for lp:1329539 also addresses this issue.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-407

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.