innobackupex --galera-info incompatible with MGC-10.0

Bug #1306875 reported by Nirbhay Choubey
8
This bug affects 1 person
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

When --galera-info option is used, innobackupex script generates a file containing
values of wsrep_last_committed and wsrep_local_state_uuid status variables.
This generated file is required for state transfer in xtrabackup(-v2) mode.

Innobackupex internally stores server status variables in a hash with status variable
name as key. Now, as MGC-10.0 has capitalized wsrep status variable names (like other
server status variables) , the script's attempt to find the values of wsrep_local_state_uuid
& wsrep_last_committed would fail, and hence it won't generate the galera info file required
for state transfer.

One possible solution would be to use SHOW...LIKE:

$ diff -u percona-xtrabackup-2.1.8-Linux-i686/bin/innobackupex.orig percona-xtrabackup-2.1.8-Linux-i686/bin/innobackupex
--- percona-xtrabackup-2.1.8-Linux-i686/bin/innobackupex.orig 2014-04-11 10:14:35.413447410 -0400
+++ percona-xtrabackup-2.1.8-Linux-i686/bin/innobackupex 2014-04-12 00:46:46.970931144 -0400
@@ -2995,6 +2995,9 @@
       } elsif ($query eq 'SHOW STATUS') {
           $con->{status} = $con->{dbh}->selectall_hashref('SHOW STATUS',
                                                         'Variable_name');
+ } elsif ($query =~ m/SHOW STATUS LIKE/) {
+ $con->{status} = $con->{dbh}->selectall_hashref($query,
+ 'Variable_name');
       } elsif ($query eq 'SHOW MASTER STATUS') {
           $con->{master_status} =
               $con->{dbh}->selectrow_hashref("SHOW MASTER STATUS");
@@ -3091,14 +3094,29 @@
     my @info_lines = ();
     my $state_uuid = '';
     my $last_committed = '';
+ my $found = 1;

     # get binlog position
- get_mysql_status($con);

- $state_uuid = $con->{status}->{wsrep_local_state_uuid}->{Value};
- $last_committed = $con->{status}->{wsrep_last_committed}->{Value};
+ mysql_query($con, "SHOW STATUS LIKE 'wsrep_local_state_uuid'");
+ if (scalar keys($con->{status})) {
+ my $key= ((keys $con->{status})[0]);
+ $state_uuid = $con->{status}->{$key}->{Value};
+ } else {
+ # variable not found
+ $found = 0;
+ }
+
+ mysql_query($con, "SHOW STATUS LIKE 'wsrep_last_committed'");
+ if (scalar keys($con->{status})) {
+ my $key= ((keys $con->{status})[0]);
+ $last_committed = $con->{status}->{$key}->{Value};
+ } else {
+ # variable not found
+ $found = 0;
+ }

- if (!defined($state_uuid) || !defined($last_committed)) {
+ if (!$found || !defined($state_uuid) || !defined($last_committed)) {
         my $now = current_time();

         print STDERR "$now $prefix Failed to get master wsrep state " .

Related branches

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

Is --galera-info option taken care by PXC team? If not, I will file this under xtrabackup.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Nirbhay,

Indeed it belongs to PXB, moved it there.

affects: percona-xtradb-cluster → percona-xtrabackup
Revision history for this message
Alexey Kopytov (akopytov) wrote :

This will be fixed in the next PXB 2.2 release as a side effect from https://blueprints.launchpad.net/percona-xtrabackup/+spec/galera-gtid-autorecovery (because the wsrep_* status variables will no longer be used by innobackupex).

Revision history for this message
Alexey Kopytov (akopytov) wrote :

It's been decided to keep using wsrep_* status variables under some conditions for compatibility with older PXC releases.

Therefore, I have to make changes to innobackupex for MGC. I wonder if it's easier to just check for both capitalized and non-capitalized wsrep_* status variables. Are they called Wsrep_local_state_uuid and Wsrep_last_committed in MGC?

Revision history for this message
Nirbhay Choubey (nirbhay) wrote :

No, they have been left lower-cased, 'wsrep_local_state_uuid' and 'wsrep_last_committed'.

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-404

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.