# GTID\_PURGED MISSING (global var)

**URL:** <https://forums.percona.com/t/gtid-purged-missing-global-var/12375>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [September 30, 2021, 7:28pm UTC](https://forums.percona.com/t/gtid-purged-missing-global-var/12375 "2021-09-30T19:28:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Torn](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Mike\_Torn](https://forums.percona.com/u/Mike_Torn)\
**Post date:** [September 30, 2021, 7:28pm UTC](https://forums.percona.com/t/gtid-purged-missing-global-var/12375/1 "2021-09-30T19:28:28Z")

</div>

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;

---

<div class="post-metadata">

**Author:** ![Maksim\_Larin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/maksim_larin/32/3503_2.png) [@Maksim\_Larin](https://forums.percona.com/u/Maksim_Larin)\
**Post date:** [October 3, 2021, 11:07am UTC](https://forums.percona.com/t/gtid-purged-missing-global-var/12375/2 "2021-10-03T11:07:41Z")

</div>

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](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](https://www.percona.com/blog/2013/02/08/how-to-createrestore-a-slave-using-gtid-replication-in-mysql-5-6/)

Regards,  
Max
