# Master-master asynchronous replication issue between two 5.6.24 PXC clusters

**URL:** <https://forums.percona.com/t/master-master-asynchronous-replication-issue-between-two-5-6-24-pxc-clusters/4290>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [July 8, 2015, 10:57am UTC](https://forums.percona.com/t/master-master-asynchronous-replication-issue-between-two-5-6-24-pxc-clusters/4290 "2015-07-08T10:57:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pxc127](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pxc127](https://forums.percona.com/u/pxc127)\
**Post date:** [July 8, 2015, 10:57am UTC](https://forums.percona.com/t/master-master-asynchronous-replication-issue-between-two-5-6-24-pxc-clusters/4290/1 "2015-07-08T10:57:29Z")

</div>

To meet the DR requirements for production, we have set up bidirectional master - master asynchronous mysql replication between two 3 node PXC clusters. binlog\_format=ROW and log-slave-updates are set on each node.

The Server version: 5.6.24-72.2-56-log Percona XtraDB Cluster (GPL), Release rel72.2, Revision 1, WSREP version 25.11, wsrep\_25.11

The asynchronous slave runs on node 3 in each cluster.

For instance:

cluster a is the slave of cluster b. The slave runs on node a3.  
cluster b is the slave of cluster a. The slave runs on node b3.

On cluster a, if a transaction is executed on node a3, where the asynchronous slave is running, it is replicated to a1 and a2 and cluster b without error. However, if a transaction is executed on a1 or a2, where no asynchronous slave is running, the transaction is replicated to the rest of nodes in cluster a and cluster b. But the asyncrhonous slave on a3 is stopped trying to replicate the same transaction again.

The same behavior is observedd on cluster b. If a transaction is executed on b1 or b2, the salve on b3 will stop failing to apply the duplicate transaction.

Is master - master asynchronous mysql replication supported between two PXC clusters?

What can we do to prevent the recursive replication?

Here are the examples of the slave errors:

2015-07-07 20:22:12 11098 [ERROR] Slave SQL: Error ‘Table ‘test’ already exists’ on query. Default database: ‘spxna’. Query: ‘create table test ( i int unsigned not null auto\_increment primary key, j char(32))’, Error\_code: 1050  
2015-07-07 20:22:12 11098 [Warning] Slave: Table ‘test’ already exists Error\_code: 1050  
2015-07-07 20:22:12 11098 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with “SLAVE START”. We stopped at log ‘spxus-slcprdmagdb03-master-bin.000002’ position 527

2015-07-07 20:39:10 12272 [ERROR] Slave SQL: Could not execute Write\_rows event on table spxna.test; Duplicate entry ‘1’ for key ‘PRIMARY’, Error\_code: 1062; handler error HA\_ERR\_FOUND\_DUPP\_KEY; the event’s master log spxus-slcprdmagdb03-master-bin.000003, end\_log\_pos 569, Error\_code: 1062  
2015-07-07 20:39:10 12272 [Warning] Slave: Duplicate entry ‘1’ for key ‘PRIMARY’ Error\_code: 1062  
2015-07-07 20:39:10 12272 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with “SLAVE START”. We stopped at log ‘spxus-slcprdmagdb03-master-bin.000003’ position 408

Thanks.

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [July 11, 2015, 3:02pm UTC](https://forums.percona.com/t/master-master-asynchronous-replication-issue-between-two-5-6-24-pxc-clusters/4290/2 "2015-07-11T15:02:05Z")

</div>

So you are not using MySQL’s GTIDs, which would prevent such issue.  
I think the problem is how the server\_id variables are set across the nodes. I’d suggest to set server\_id to one value on cluster A and different value on cluster B. All 3 nodes in the same cluster may have the same id.

---

<div class="post-metadata">

**Author:** ![pxc127](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pxc127](https://forums.percona.com/u/pxc127)\
**Post date:** [July 13, 2015, 11:19am UTC](https://forums.percona.com/t/master-master-asynchronous-replication-issue-between-two-5-6-24-pxc-clusters/4290/3 "2015-07-13T11:19:58Z")

</div>

Thanks a lot! Both solutions worked!

For 5.6, I am wondering if it is recommended to use GTID versus the log file position. If GTID is enabled, do we only need to run change master\_host=new node in the cluster to switch the async slave to a different node in the cluster in the event of master node failure?  
Is it allowed to use VIP for the master\_host?

Thanks again.

---

<div class="post-metadata">

**Author:** ![sarath](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sarath](https://forums.percona.com/u/sarath)\
**Post date:** [August 7, 2024, 11:31am UTC](https://forums.percona.com/t/master-master-asynchronous-replication-issue-between-two-5-6-24-pxc-clusters/4290/4 "2024-08-07T11:31:09Z")

</div>

Can you please give me the Doc to setup this
