GTID_PURGED MISSING (global var)

Hi Guys ,

I’ve got schema Master+Slave1+Slave2 with gtid ON , recently found that on my master server gtid_purged global env has empty value.

show global variables like ‘gtid_purged’;
±--------------±------+
| Variable_name | Value |
±--------------±------+
| gtid_purged | |
±--------------±------+

I want to make a new slave3 , slave4 but for that purpose I need gtid_purged from master following instructions from sites. But what will happen if I connect my new slave without setting gtid_purged on slave ? Will my slaves work as expected ?

Slave steps:

RESET SLAVE;
RESET MASTER;
#SET GLOBAL gtid_purged=‘empty’
CHANGE MASTER TO MASTER_HOST
START SLAVE;

1 Like

Hi Mike,

You don’t need the gtid_purged value from your master to set up a new slave. You need to know gtid_executed instead. After you restore the new slave from a master’s backup, you should use the master’s gtid_executed value as a value for the slave’s gtid_purged. Depending on what type of backup you are going to use, you can find the proper gtid_executed value as follows:

a. If you are going to use mysqldump, your dump file will include a row like this
SET @@GLOBAL.GTID_PURGED=‘930fe4c0-2433-11ec-8b4d-00163e97ee29:1-2’;
This behavior is controlled by the –set-gtid-purged option of mysqldump
https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_set-gtid-purged

b. If you are going to use xtrabackup, the xtrabackup_binlog_info will contain the necessary gtid value.

There is a blog post with mysqldump example - How to create/restore a slave using GTID replication in MySQL 5.6 - Percona Database Performance Blog

Regards,
Max

1 Like