[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: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |