# Problem with MySql Replication

**URL:** <https://forums.percona.com/t/problem-with-mysql-replication/3471>\
**Category:** Other MySQL® Questions\
**Created:** [May 14, 2014, 2:56am UTC](https://forums.percona.com/t/problem-with-mysql-replication/3471 "2014-05-14T02:56:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shafat\_Husain](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Shafat\_Husain](https://forums.percona.com/u/Shafat_Husain)\
**Post date:** [May 14, 2014, 2:56am UTC](https://forums.percona.com/t/problem-with-mysql-replication/3471/1 "2014-05-14T02:56:56Z")

</div>

I have Multi Server Replication setup which is described below:

1. Database DB1 is hosted on Server A (Transactional MyISAM DB)
2. Database DB2 and DB3 are hosted on Server B (Transactional MyISAM DB)
3. DB1 is replicated on Server B
4. DB1, DB2 and DB3 are replicated from Server B to Server C which is used for reporting purposes.

I am facing the the following issues :

1. There is a huge lag in replication from Server A to Server B. Update statements are taking a lot of time to execute at Server B.
2. Data for DB1 is not being replicated to Server C though it is coming on Server B.

Please help…!!!

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [May 14, 2014, 3:08am UTC](https://forums.percona.com/t/problem-with-mysql-replication/3471/2 "2014-05-14T03:08:27Z")

</div>

1. what version of MySQL you are using ? there can be many causes, as you using MyISAM tables so table level locking comes into play, slow SQL you may want to check my posts how to enable slow query logs and to analyze it here [url][http://www.mysqlperformanceblog.com/2014/03/14/tools-and-tips-for-analysis-of-mysqls-slow-query-log/[/url]](http://www.mysqlperformanceblog.com/2014/03/14/tools-and-tips-for-analysis-of-mysqls-slow-query-log/%5B/url%5D) and check this too for possible causes of replication delay and how to fix it here [url][http://www.mysqlperformanceblog.com/2014/05/02/how-to-identify-and-cure-mysql-replication-slave-lag/[/url]](http://www.mysqlperformanceblog.com/2014/05/02/how-to-identify-and-cure-mysql-replication-slave-lag/%5B/url%5D)

2. Make sure you have [log-slave-updates](http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#option_mysqld_log-slave-updates) enable on Server B in order to replicate DB1 to server C.

---

<div class="post-metadata">

**Author:** ![Shafat\_Husain](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Shafat\_Husain](https://forums.percona.com/u/Shafat_Husain)\
**Post date:** [May 14, 2014, 5:29am UTC](https://forums.percona.com/t/problem-with-mysql-replication/3471/3 "2014-05-14T05:29:29Z")

</div>

Thanks for the prompt response…!!  
I have made the changes in my.cnf of Server B and restarted it.

The problem is still with the update statements. I ran show processlist and found out a simple update query coming from master to this slave which is taking huge time.

Query : UPDATE ticket SET escalation\_response\_time = ‘0’ WHERE id = ‘1990757’  
Time taken till now : 14660  
Status: locked

this is a very simple update statement i am unable to understand why it is taking so much time.  
there are almost 3,50000 records in this table.

​Any ideas…???

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [May 14, 2014, 10:54pm UTC](https://forums.percona.com/t/problem-with-mysql-replication/3471/4 "2014-05-14T22:54:42Z")

</div>

I hope after enabling log-slave-updates replicaion should be stream to server C.  
For update query as you can see,

Status:locked

Which means some other query preventing this query to execute as it holding the lock. So, this query is locked waiting for lock to acquire quite long. I would suggest to inspect processlist to identify what query is blocked this update. This clearly suggests that some other query is really slow taking more than 14660 seconds.

---

<div class="post-metadata">

**Author:** ![Shafat\_Husain](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Shafat\_Husain](https://forums.percona.com/u/Shafat_Husain)\
**Post date:** [May 16, 2014, 1:03am UTC](https://forums.percona.com/t/problem-with-mysql-replication/3471/5 "2014-05-16T01:03:28Z")

</div>

Also I changed the Engine of Few of my main tables to InnoDB that seems to help with the locking.
