# Sporadic MySQL lag with master-master replication and slave\_parallel\_workers

**URL:** <https://forums.percona.com/t/sporadic-mysql-lag-with-master-master-replication-and-slave-parallel-workers/6825>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [January 29, 2019, 9:28am UTC](https://forums.percona.com/t/sporadic-mysql-lag-with-master-master-replication-and-slave-parallel-workers/6825 "2019-01-29T09:28:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aerialls1](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@aerialls1](https://forums.percona.com/u/aerialls1)\
**Post date:** [January 29, 2019, 9:28am UTC](https://forums.percona.com/t/sporadic-mysql-lag-with-master-master-replication-and-slave-parallel-workers/6825/1 "2019-01-29T09:28:55Z")

</div>

Hello,

I’ve two MySQL servers running version 5.7.24-27 in a master-master replication configuration (all the traffic goes to the “primary” server and the “secondary” node is only here for backup).

To try to improve the replication, I decided to enable “slave\_parallel\_workers” to 4 and slave\_parallel\_type to “LOGICAL\_CLOCK”. Since then, I observe, sometimes, a replication lag on the primary server (and not the backup master) to a high value (30 minutes, 1 hour, …) and just after the value drops to 0 again, nothing on the secondary node.

I found this article ([url][https://www.percona.com/blog/2013/09/16/possible-reasons-when-mysql-replication-lag-is-flapping-between-0-and-xxxxx/[/url]](https://www.percona.com/blog/2013/09/16/possible-reasons-when-mysql-replication-lag-is-flapping-between-0-and-xxxxx/%5B/url%5D)). I’m very close to the first case (even if we didn’t change the server-id), I tried to reset the replication without any successes.

This behavior was not here before activating the slave\_parallel\_workers. We can have 1,2 or 3 hours between two spikes or only 10 minutes. I can’t find a correlation between a spike and others MySQL metrics.

Does someone already seen something like that?

Thanks!
