Remove obsolette servers UID from Executed_Gtid_Set

Hello. On my master server show master status returns bunch of servers uuid in Executed_Gtid_Set field. Mosft of this servers are not exist anymore, so transcation id increases only for this server uid.
But if i want to create another slave i have to copy all this old servers uid in GTID_PURGED, otherwise i’get error, that master has not binary logs for this ild uids. So, the question - is there a way to cut off these old uid’s ?

1 Like

Unfortunately there is no way to do this easily at the moment. You need to run RESET MASTER but that will break any replicas, so you will need to develop a plan to run it on a rolling fashion.

2 Likes

I’m i understand right, that it needs to be done on master? If “yes” then broken replicas is not the worse things :slight_smile: This implies stop master for a while, and then set GTID_PURGED on master with existing servers uid only?

1 Like

Correct, you need to stop the master and after replicas are up-to-date, then run reset master on primary and all the replicas as well, to start fresh. I recommend you to test this process on a non-prod environment first.

2 Likes

Ok, and what about this approach, is it safely ?
Suppose, i’ve master with Executed_Gtid_Set like this “A:1-100, B:1-000”, where B is uuid of master and A is uid of old server that not exists any more. So, i will create copy of this master with xtrabackup, but before start this copy on new slave i manually create auto.conf with uid A, and my new slave will have uid A and not auto-generated.
Sounds like plan, but im not absolutelly sure.

1 Like

Can i ask you opinion about my last post?

1 Like

That approach should work but it doesn’t really help you get rid of all the extra GTID sets you already have

2 Likes

Yes, but at least this stop growing Executed_Gtid_Set with old servers UUID

1 Like