Comments on: How MySQL replication got out of sync http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/ Stay curious! Fri, 10 May 2013 18:25:19 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: yingkuan http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-14182 yingkuan Tue, 22 Jan 2008 04:19:34 +0000 http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-14182 actually from a presentation of Youtube team, I learnt slaves of Mysql Replication are doomed to lag of master because replication is asynchronous and serialized.

updates on master is concurrent and while user doing one big update on table A, other user can do updates on table B for example.

when replicating, the update is serialized,
For slave it read the statement from binlog in the form of

update on tableA;
update on tableB;
….

update on tableB will not run until slave finish big update on tableA.

This seems to be trivial on small database, but for database driven website like youtube and other web2.0 site, this will cause serious problems. That’s why they will go horizontal partition route.

]]>
By: Diamond Notes » A Long Time Coming http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13696 Diamond Notes » A Long Time Coming Tue, 20 Nov 2007 15:18:21 +0000 http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13696 [...] http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/ [...]

]]>
By: Xaprb http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13661 Xaprb Fri, 09 Nov 2007 12:33:35 +0000 http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13661 Jeremy, that’s a good point. It never occurred to me.

safari, deadlocks are a fact of life in transactional systems; you can sometimes avoid them by making the different processes read the same index in the same direction, but it’s usually pretty hard to do. Better just build the application to detect and retry the work.

]]>
By: Toba http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13660 Toba Fri, 09 Nov 2007 05:27:40 +0000 http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13660 Good that you find your bug, that’s really not something you can spot easily. We have been running replication over 6 years now, and afaik we have never hit that bug/feature. :) But I guess we don’t do much updates/deletes with ORDER BY and LIMIT in it. For us, now days out of sync replication is much more rare than it was before (say 3.23 or 4.0).

]]>
By: safari http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13659 safari Fri, 09 Nov 2007 04:11:25 +0000 http://www.xaprb.com/blog/2007/11/08/how-mysql-replication-got-out-of-sync/#comment-13659 How about the deadlock I reported? Is there any way to get rid of it?

]]>