# Repairing just one channel in multi-source master replica with GTID

**URL:** <https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002>\
**Category:** Percona Server for MySQL 8.0\
**Created:** [November 13, 2024, 5:26pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002 "2024-11-13T17:26:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vukopras](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@Vukopras](https://forums.percona.com/u/Vukopras)\
**Post date:** [November 13, 2024, 5:26pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/1 "2024-11-13T17:26:49Z")

</div>

Hello

I’m trying to set up multi-source replica, so one server will have 2 databases, each database will be replica from another remote server.

I set up first channel fine but I’m having issues setting up second one.  
I can see the issue is that I need to tell second channel what his GTID is but I don’t understand how can I do that without breaking first channel as well.

According to this link  
[https://dev.mysql.com/doc/mysql-replication-excerpt/8.0/en/replication-multi-source-provision-replica.html](https://dev.mysql.com/doc/mysql-replication-excerpt/8.0/en/replication-multi-source-provision-replica.html)  
only way to repair is rebuild both from start?

Is there a way I can do this

```auto
mysql> RESET MASTER;
mysql> SET @@GLOBAL.gtid_purged = "2174B383-5441-11E8-B90A-C80AA9429562:1-1029, 224DA167-0C0C-11E8-8442-00059A3C7B00:1-2695";

```

But just for 1 channel , if the other one is working fine.

Thank you

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [November 13, 2024, 8:33pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/2 "2024-11-13T20:33:41Z")

</div>

You need to set gtid\_purged to the GTID of both sources, then setting up the separate channels should work just fine.

What error are you getting on the second channel?

---

<div class="post-metadata">

**Author:** ![Vukopras](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@Vukopras](https://forums.percona.com/u/Vukopras)\
**Post date:** [November 13, 2024, 9:07pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/3 "2024-11-13T21:07:14Z")

</div>

Well one channel was working already for some time so I tried setting up second one.  
How can i set up GTID purged for both in that instance?

I mean I know GTID for second one, the one im trying to build but what to put for first one, the one that is working for some time.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [November 13, 2024, 9:20pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/4 "2024-11-13T21:20:34Z")

</div>

Stop replication for all channels. Set gtid\_purged to be the CONCAT($gtid1, ‘,’, $gtid2) (just put them together). You don’t set gtid\_purged for individual channels; you do this globally for all channels. Then start channel 1, start channel 2. When you run show replica status for channel 1, and for channel 2, you’ll see the entire GTID set.

---

<div class="post-metadata">

**Author:** ![Vukopras](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@Vukopras](https://forums.percona.com/u/Vukopras)\
**Post date:** [November 13, 2024, 9:43pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/5 "2024-11-13T21:43:16Z")

</div>

Well how can I get GTID purged from working channel aka first one.  
I always got GTID purged via backup, either xtradbackup or mysqldump on master server and restore those backups on slaves.  
Is there easier way to get gtid purged I was unaware, the one where i don’t need to make a backup and restore it?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [November 13, 2024, 9:55pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/6 "2024-11-13T21:55:24Z")

</div>

If replica #2 has a completely different dataset, then you must take a logical backup (mysqldump or mydumper) of replica #2 and restore that to the multi-source server (otherwise you have no starting point for channel #2). When you do this, you’ll get the GTID of replica #2. Concat that with GTID from replica #1 and that becomes your gtid\_purged.

---

<div class="post-metadata">

**Author:** ![Vukopras](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@Vukopras](https://forums.percona.com/u/Vukopras)\
**Post date:** [November 13, 2024, 10:06pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/7 "2024-11-13T22:06:36Z")

</div>

Yes, i understand that part. My question is how to get GTID purged from channel 1, the one I’m not restoring from backup.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [November 13, 2024, 10:34pm UTC](https://forums.percona.com/t/repairing-just-one-channel-in-multi-source-master-replica-with-gtid/35002/8 "2024-11-13T22:34:38Z")

</div>

STOP REPLICA FOR CHANNEL 1; SHOW REPLICA STATUS;  
use Executed\_GTID as the purged for channel 1.
