Percona 5.7.32 switch to GTID online

Hi,
I would like to switch a running Master-Master-Slave setup to GITD based replication.
As for MariaDB this step is quite straight forward and I’ve done this successfully several times.

For percona this seems to be a little different.
I’ve found this guide: Online GTID deployment

If i try to set gtid_mode=on I get the following error: “The value of @@GLOBAL.GTID_MODE can only be changed one step at a time: OFF <-> OFF_PERMISSIVE <-> ON_PERMISSIVE <-> ON. Also note that this value must be stepped up or down simultaneously on all servers. See the Manual for instructions.”
Do I just have to follow the steps OFF_PERMISSIVE → ON_PERMISSIVE → ON?

Another Way to migrate online to GTID I’ve found is as followed:
On each server, execute:
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = WARN
SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE
SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE

Wait until there are no more ongoing client transactions that need to be GTID-free.
Wait until all transactions that existed are replicated to all servers
On each server, execute: SET @@GLOBAL.GTID_MODE = ON

STOP SLAVE;
CHANGE MASTER TO MASTER_AUTO_POSITION = 1;
START SLAVE;

This has to be executed on each slave server that should use the auto-positioning protocol.

So which way should be used?

Thanks in advance

1 Like

Yes. This is correct. Set GTID = OFF_PERMISSIVE on all servers in the group. Then, set ON_PERMISSIVE on all servers. Then, lastly, set ON to all servers.

Once GTID is enabled on all machines, then you can stop replication and use auto-position.

2 Likes