← Back to team overview

maria-developers team mailing list archive

Re: Best way of starting multi-source connections with active slave.

 

----- On 6 Aug, 2015, at 4:54 PM, Giuseppe Maxia g.maxia@xxxxxxxxx wrote:

> Hi,
> I am setting up multi-source replication with four nodes, where nodes 1, 2, and
> 3 are masters and node 4 is the slave of the first 3. The slave is *active*,
> meaning that it has a binary log and runs transactions of its own.
> 
> All is well if I run 'reset master' in all nodes before setting up replication.
> 
> CHANGE MASTER 'node1' TO master_host='host1', master_port=3306,
> master_user='some_slave', master_password='some_slave',
> master_use_gtid=current_pos;
> CHANGE MASTER 'node2' TO master_host='host2', master_port=3306,
> master_user='some_slave', master_password='some_slave',
> master_use_gtid=current_pos;
> CHANGE MASTER 'node3' TO master_host='host3', master_port=3306,
> master_user='some_slave', master_password='some_slave',
> master_use_gtid=current_pos;
> start all slaves;
> 
> However, if host 4 has a binary log and has logged one or more transactions
> before starting replication, we get a conflict.

each master should be on a different gtid_domain_id

https://mariadb.com/kb/en/mariadb/global-transaction-id/#gtid_domain_id

also see variable gtid_ignore_duplicates

> Got fatal error 1236 from master when reading data from binary log: 'Error:
> connecting slave requested to start from GTID 0-104-1, which is not in the
> master's binlog. Since the master's binlog contains GTIDs with higher sequence
> numbers, it probably means that the slave has diverged due to executing extra
> erroneous transactions'


-- 
-- 
Daniel Black, Engineer @ Open Query (http://openquery.com.au)
Remote expertise & maintenance for MySQL/MariaDB server environments.


References