MariaDB multi-source slave is not detected
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Triaged
|
Medium
|
Unassigned | ||
2.2 |
Triaged
|
Medium
|
Unassigned | ||
2.3 |
Triaged
|
Medium
|
Unassigned |
Bug Description
I'm trying to backup a MariaDB server which is a slave (of a multi-source replication), however innobackupex doesn't detect it as such:
-------
150122 10:28:53 innobackupex: Continuing after ibbackup has suspended
innobackupex:: Not checking slave open temp tables for --safe-slave-backup because host is not a slave
-------
Looking at how the detection is done, I can understand why it says so:
-------
sub get_mysql_
mysql_
}
...
get_
if (defined(
}
-------
Indeed, SHOW SLAVE STATUS has empty output on this server:
-------
MariaDB [(none)]> SHOW SLAVE STATUS;
Empty set (0.00 sec)
-------
This is because, on MariaDB >= 10.0.1, multi-source replication changes things a bit: https:/
In particular, SHOW SLAVE STATUS only show a *default* replication, which is not mandatory to have.
You can in addition have others replications defined, all of which have a connection_name that you need to add to the command in order to have more info:
-------
MariaDB [(none)]> SHOW SLAVE 'instance7-
*******
...
-------
You can also use the SHOW ALL SLAVES STATUS to have info on all the slaves defined:
-------
MariaDB [(none)]> show all slaves status\G
*******
-------
This surely has multiple implications for Xtrabackup to support this multi-source replication:
- Detection can be easy : checking server version, using SHOW ALL SLAVE STATUS to detect multi-source replication and acting as such.
- Stopping / restarting slave(s) needs to be enhanced to iterate on all active slave(s) connections.
- The CHANGE MASTER commands may also need to be handled (may be differently if the connection is in GTID or non-GTID mode)
There may also be other implications that I did not thought of.
-------
$ cat /etc/redhat-release
CentOS release 6.6 (Final)
-------
$ rpm -q percona-xtrabackup
percona-
-------
$ innobackupex --version
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
-------
$ xtrabackup --version
xtrabackup version 2.2.8 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
-------
$ mysql --version
mysql Ver 15.1 Distrib 10.0.15-MariaDB, for Linux (x86_64) using readline 5.1
-------
description: | updated |
Confirmed with MariaDB 10.0.1, If @@default_ master_ connection will be null, it will not show result in "show slave status \G"
mysql> \s 0.15-MariaDB- log MariaDB Server
--------------
mysql Ver 14.14 Distrib 5.6.22-71.0, for debian-linux-gnu (x86_64) using EditLine wrapper
...
Server version: 5.5.5-10.
mysql> select @@default_ master_ connection; ------- ------- ------- --+ master_ connection | ------- ------- ------- --+ ------- ------- ------- --+
+------
| @@default_
+------
| |
+------
1 row in set (0.00 sec)
mysql> show slave status \G
Empty set (0.00 sec)
mysql> show all slaves status\G ******* ******* ****** 1. row ******* ******* ******* ******
Connection_ name: master1
Slave_SQL_ State: Slave has read all relay log; waiting for the slave I/O thread to update it
Slave_ IO_State: Waiting for master to send event
Master_ Host: 127.0.0.1
Master_ User: rsandbox
Master_ Port: 24025
Connect_ Retry: 60
Master_ Log_File: mysql-bin.000002
Read_ Master_ Log_Pos: 326
Relay_ Log_File: mysql_sandbox24 026-relay- bin-master1. 000004
Relay_ Log_Pos: 535
Relay_ Master_ Log_File: mysql-bin.000002
Slave_ IO_Running: Yes
Slave_ SQL_Running: Yes
Replicate_ Do_DB:
Replicate_ Ignore_ DB:
Replicate_ Do_Table:
Replicate_ Ignore_ Table: _Wild_Do_ Table: Wild_Ignore_ Table:
Last_ Errno: 0
Last_ Error:
Skip_ Counter: 0
Exec_ Master_ Log_Pos: 326
Relay_Log_ Space: 853
Until_Condition : None
Until_ Log_File:
Until_ Log_Pos: 0
Master_ SSL_Allowed: No
Master_ SSL_CA_ File:
Master_ SSL_CA_ Path:
Master_ SSL_Cert:
Master_ SSL_Cipher:
Master_ SSL_Key:
Seconds_ Behind_ Master: 0 SSL_Verify_ Server_ Cert: No
Last_ IO_Errno: 0
Last_ IO_Error:
Last_SQL_ Errno: 0
Last_SQL_ Error: Ignore_ Server_ Ids:
Master_ Server_ Id: 1
Master_ SSL_Crl:
Master_ SSL_Crlpath:
Using_ Gtid: No
Gtid_ IO_Pos:
Retried_ transactions: 0
Max_ relay_log_ size: 1073741824
Executed_ log_entries: 6 received_ heartbeats: 0
Slave_heartbeat _period: 1800.000
Gtid_Slave_ Pos: 0-1-12 ******* ******* ****** 2. row ******* ******* ******* ******
Connection_ name: master2
Slave_SQL_ State: Slave has read all relay log; waiting for the slave I/O thread to update it
Slave_ IO_State: Waiting for master to send event
Master_ Host: 127.0.0.1
Master_ User: rsandbox
Master_ Port: 24027
Connect_ Retry: 60
Master_ Log_File: mysql-bin.000002
Read_ Master_ Log_Pos: 312
Relay_ Log_File: mysql_sandbox24 026-relay- bin-master2. 00000.. .
*******
Replicate
Replicate_
Master_
Replicate_
Slave_
*******