<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fighting MySQL Replication Lag</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/09/22/fighting-mysql-replication-lag/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/09/22/fighting-mysql-replication-lag/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:23:57 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Erik Ljungstrom</title>
		<link>http://www.mysqlperformanceblog.com/2008/09/22/fighting-mysql-replication-lag/comment-page-1/#comment-357534</link>
		<dc:creator>Erik Ljungstrom</dc:creator>
		<pubDate>Wed, 24 Sep 2008 07:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=507#comment-357534</guid>
		<description>Chad, 

SQL_LOG_BIN which Peter mentioned is a session variable. Any statement you run in that thread will not end up in the binary log, thus not be replicated. So rather than skipping a transaction on all the slaves, you simply don&#039;t log it on the master.

In terms of promoting slaves, it&#039;s not entirely necessary to get them to the same binlog position. If you as per your previous comment have the luxury of being able to ensure that no updates hit the DBs, you can simply do it with a series of CHANGE MASTER statements whilst you are certain that the DBs have the same data (ie. the writes doesn&#039;t go through and all slaves are caught up).</description>
		<content:encoded><![CDATA[<p>Chad, </p>
<p>SQL_LOG_BIN which Peter mentioned is a session variable. Any statement you run in that thread will not end up in the binary log, thus not be replicated. So rather than skipping a transaction on all the slaves, you simply don&#8217;t log it on the master.</p>
<p>In terms of promoting slaves, it&#8217;s not entirely necessary to get them to the same binlog position. If you as per your previous comment have the luxury of being able to ensure that no updates hit the DBs, you can simply do it with a series of CHANGE MASTER statements whilst you are certain that the DBs have the same data (ie. the writes doesn&#8217;t go through and all slaves are caught up).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chad walker</title>
		<link>http://www.mysqlperformanceblog.com/2008/09/22/fighting-mysql-replication-lag/comment-page-1/#comment-357516</link>
		<dc:creator>chad walker</dc:creator>
		<pubDate>Wed, 24 Sep 2008 03:37:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=507#comment-357516</guid>
		<description>Yeah I never thought about trying to disable replication for that one command. It would be nice if there was a comment way to do it, like:
ALTER TABLE foo /* NO_BIN_LOG */ ADD INDEX foo_a_b (a, b);

I&#039;ve seen you talk about promoting a slave to be the new master before, but in my eyes that has always seemed like a huge pain that is full of potential pitfalls. We run with one master and 4 slaves, the master does about 20k questions a minute and the slaves each do about 11k. How hard is it to synchronize them to the same master bin log position? FWIW, our site wasn&#039;t down for the above index update, we have an intermediate proxy layer that acts as a write-through cache and queued the writes until the master could handle them.</description>
		<content:encoded><![CDATA[<p>Yeah I never thought about trying to disable replication for that one command. It would be nice if there was a comment way to do it, like:<br />
ALTER TABLE foo /* NO_BIN_LOG */ ADD INDEX foo_a_b (a, b);</p>
<p>I&#8217;ve seen you talk about promoting a slave to be the new master before, but in my eyes that has always seemed like a huge pain that is full of potential pitfalls. We run with one master and 4 slaves, the master does about 20k questions a minute and the slaves each do about 11k. How hard is it to synchronize them to the same master bin log position? FWIW, our site wasn&#8217;t down for the above index update, we have an intermediate proxy layer that acts as a write-through cache and queued the writes until the master could handle them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/09/22/fighting-mysql-replication-lag/comment-page-1/#comment-357480</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 23 Sep 2008 22:51:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=507#comment-357480</guid>
		<description>Chad,

You&#039;re completely right.   Even though MySQL Replication is great in its ability to replicate DDL too  it is often not practical because of replication lag it causes and other reason.

It often makes sense to use SQL_LOG_BIN=0 to run query only on master  (or start from the slave).  Plus this often allows you to do massive DDL without taking sight down - you just run it on the slave, promote it to the master and run on ex-master.</description>
		<content:encoded><![CDATA[<p>Chad,</p>
<p>You&#8217;re completely right.   Even though MySQL Replication is great in its ability to replicate DDL too  it is often not practical because of replication lag it causes and other reason.</p>
<p>It often makes sense to use SQL_LOG_BIN=0 to run query only on master  (or start from the slave).  Plus this often allows you to do massive DDL without taking sight down &#8211; you just run it on the slave, promote it to the master and run on ex-master.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chad walker</title>
		<link>http://www.mysqlperformanceblog.com/2008/09/22/fighting-mysql-replication-lag/comment-page-1/#comment-357472</link>
		<dc:creator>chad walker</dc:creator>
		<pubDate>Tue, 23 Sep 2008 21:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=507#comment-357472</guid>
		<description>Recently we had to add an index to a table with 12M rows. It took a couple minutes to run in testing, so we knew we couldn&#039;t just run it on the master and let it trickle through replication. What we did was take a slave at a time out of rotation, add the index, then add the slave back into rotation. Once all the slaves were done we added the index on the master. When the master was done and replicated the index, we went to each slave and skipped that transaction.</description>
		<content:encoded><![CDATA[<p>Recently we had to add an index to a table with 12M rows. It took a couple minutes to run in testing, so we knew we couldn&#8217;t just run it on the master and let it trickle through replication. What we did was take a slave at a time out of rotation, add the index, then add the slave back into rotation. Once all the slaves were done we added the index on the master. When the master was done and replicated the index, we went to each slave and skipped that transaction.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
