[MDEV-19264] Better support MariaDB GTID for Mariabackup's --slave-info option Created: 2019-04-16  Updated: 2020-10-06  Resolved: 2020-09-14

Status: Closed
Project: MariaDB Server
Component/s: mariabackup, Replication
Fix Version/s: 10.2.35, 10.3.26, 10.4.16, 10.5.7, 10.6.0

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Vladislav Lesin
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-21157 --slave-info only contains gtid infor... Closed
Relates
relates to MDEV-14746 mariabackup doesn't read [mariabackup... Closed
relates to MDEV-18347 mariabackup doesn't read all server o... Closed
relates to MDEV-18405 Add Mariabackup option to set gtid_sl... Stalled
relates to MDEV-18917 Don't create xtrabackup_binlog_pos_in... Closed
relates to MDEV-18931 Rename Mariabackup's xtrabackup_* fil... Closed
relates to MDEV-18985 Remove support for XtraDB's changed p... Confirmed
relates to MDEV-19246 Change database and table used for Ma... Closed
relates to MDEV-20552 Remove innobackupex mode from Mariaba... Stalled
relates to MDEV-20556 Remove references to "xtrabackup" and... Closed

 Description   

Mariabackup's --slave-info option writes a CHANGE MASTER command to xtrabackup_slave_info:

https://mariadb.com/kb/en/library/mariabackup-options/#-slave-info

https://mariadb.com/kb/en/library/files-created-by-mariabackup/#xtrabackup_slave_info

This does not currently fully support MariaDB's GTID implementation. It only fully supports MySQL's GTID implementation.

It *does* write the CHANGE MASTER command to use master_use_gtid=slave_pos if the gtid_slave_pos system variable is non-empty. However, just because gtid_slave_pos is non-empty, that does not mean that the current slave thread has master_use_gtid=slave_pos set.

For MySQL's GTID, it parses the SHOW SLAVE STATUS output to determine if Executed_Gtid_Set is non-empty. If it is non-empty, then it uses MySQL's GTID in the CHANGE MASTER command. This check does guarantee that the current slave thread is using GTID.

If we wanted to make the MariaDB GTID checks as thorough as the MySQL GTID check, then we would parse SHOW SLAVE STATUS output for the "Using_Gtid" column. If the value were "no", then we would use the old log file and position. If the value were either "Slave_Pos" or "Current_Pos", then we would use GTID.

https://mariadb.com/kb/en/library/show-slave-status/

See here:

https://github.com/MariaDB/server/blob/mariadb-10.4.4/extra/mariabackup/backup_mysql.cc#L1056

https://github.com/MariaDB/server/blob/mariadb-10.4.4/extra/mariabackup/backup_mysql.cc#L1095

https://github.com/MariaDB/server/blob/mariadb-10.4.4/extra/mariabackup/backup_mysql.cc#L1115

We should probably change it to remove MySQL's GTID implementation and better support MariaDB's GTID implementation at some point.


Generated at Thu Feb 08 08:50:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.