pt-slave-restart fails on MariaDB 10.0.13 (gtid_mode confusion)

Bug #1362942 reported by Simon J Mudd
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Frank Cizmich

Bug Description

[root@myhost ~]# pt-slave-restart --error-numbers=1064
DBD::mysql::db selectrow_arrayref failed: Unknown system variable 'gtid_mode' [for Statement "SELECT @@GLOBAL.gtid_mode"] at /usr/bin/pt-slave-restart line 4996.
[root@myhost ~]# rpm -q percona-toolkit
percona-toolkit-2.2.10-1.noarch
[root@myhost ~]# rpm -q MariaDB-server
MariaDB-server-10.0.13-1.el6.x86_64
[root@myhost ~]# rpm -q centos-release
centos-release-6-4.el6.centos.10.x86_64
[root@myhost ~]#

This seems to work fine for MariaDB 5.5, MySQL 5.5 and I think also for MySQL 5.6.

I've not investigated further but MariaDB 10 is the latest GA version so I think this command would be expected to work.

Revision history for this message
Simon J Mudd (sjmudd) wrote :
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

This is easy to confirm with code review:

...
4991 # When MySQL 5.6.5 or higher is used and gtid is enabled, skipping a
4992 # transaction is not possible with SQL_SLAVE_SKIP_COUNTER
4993 my $skip_event;
4994 my $have_gtid = 0;
4995 if ( VersionParser->new($dbh) >= '5.6.5' ) {
4996 my $row = $dbh->selectrow_arrayref('SELECT @@GLOBAL.gtid_mode');
4997 PTDEBUG && _d('@@GLOBAL.gtid_mode:', $row->[0]);
4998 if ( $row && $row->[0] eq 'ON' ) {
4999 $have_gtid = 1;
5000 }
5001 }
5002 PTDEBUG && _d('Have GTID:', $have_gtid);
...

So, there is no special handling for MariaDB - only version matters.

Changed in percona-toolkit:
status: New → Confirmed
Revision history for this message
Claudio Nanni (claudio.nanni) wrote :

Hello!
In MariaDB GTID was implemented in version 10.0.2 and there is no 'gtid_mode' variable.
The GTID is always enabled by default, although it may or may not be used.
Note: MariaDB has a different GTID implementation.

Revision history for this message
Guillaume Lefranc (tanj) wrote :

Actually, it will work with an earlier version of pt-slave-restart (2.2.7, without GTID support) and MariaDB >= 10.0.13.
MariaDB 10.0.13 and later versions support skipping GTID events with SQL_SLAVE_SKIP_COUNTER.

Revision history for this message
Daniël van Eeden (dveeden) wrote :
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Fixed as suggested.

Changed in percona-toolkit:
status: Confirmed → Fix Committed
importance: Undecided → Medium
assignee: nobody → Frank Cizmich (frank-cizmich)
milestone: none → 2.2.17
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

I see this bug again while working with MariaDB 10.0.20 and pt-slave-restart 2.2.19:

openxs@ao756:~/sandboxes/rsandbox_mariadb-10_0_20/master$ mysql -umsandbox -pmsandbox --host=127.0.0.1 --port=25032 -e"select version()"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------------+
| version() |
+---------------------+
| 10.0.20-MariaDB-log |
+---------------------+
openxs@ao756:~/sandboxes/rsandbox_mariadb-10_0_20/master$ pt-slave-restart --version
pt-slave-restart 2.2.19
openxs@ao756:~/sandboxes/rsandbox_mariadb-10_0_20/master$ pt-slave-restart -umsandbox -pmsandbox --host=127.0.0.1 --port=25032
DBD::mysql::db selectrow_arrayref failed: Unknown system variable 'gtid_mode' [for Statement "SELECT @@GLOBAL.gtid_mode"] at /usr/bin/pt-slave-restart line 5039.

Changed in percona-toolkit:
milestone: 2.2.17 → 2.2.20
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/PT-656

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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