signal18 / replication-manager

Signal 18 repman - Replication Manager for MySQL / MariaDB / Percona Server
https://signal18.io/products/srm
GNU General Public License v3.0
655 stars 167 forks source link

No need to change gtid_slave_pos on slaves, breaks multi-domain intermediate master setup #33

Open michaeldg opened 8 years ago

michaeldg commented 8 years ago

Hi,

Currently mrm changes the gtid_slave_pos on the slaves. I don't see why that is needed in normal operation.

I am testing MRM in a slightly special setup, -> is a replication stream domain 1 and => is replication stream domain 2: Server A -> B, C, D, Server C => D The SET GLOBAL gtid_slave_pos fails on server C due to domain 2 not present, on server D it fails because the secondary replication stream is down.

We came to 2 caveats: If you failover a master and have to let it rejoin the cluster. However there is an easy fix for that situation: If there is not gtid_slave_pos present on a master that has to become slave, we have to do CHANGE MASTER TO MASTER_USE_GTID=current_pos;

Another problem arises when the slave receives writes on the same GTID domain as the master. This is an incorrect setup and if we have strict_mode enabled writing on the slave will break replication anyways.

Perhaps I missed anything? Very interested in your response!

Cheers, Michaël

michaeldg commented 8 years ago

Perhaps also gtid_current_pos should be used if gtid_current_pos is higher the gtid_slave_pos.