<?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: Debugging problems with row based replication</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Alexandr Yatsuk Leonidovich</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-773559</link>
		<dc:creator>Alexandr Yatsuk Leonidovich</dc:creator>
		<pubDate>Wed, 08 Sep 2010 00:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-773559</guid>
		<description>Hi All. 
I using MIXED binlog format. And having problem with simple delete query.
DELETE FROM temp.tenp WHERE id = 10;
This query must delete 3000000 rows from my innodb table.
But slave came to out of sync. (like in comment#2 by Justin Swanhart were hi used STATEMENT binlog format)

But if I&#039;ve change  binlog format to ROW based, I&#039;ve got error like in comment#8 by Kim Carlsen ..... 

What I must to do ? Some configuratuin tuning? 
do not delete a lot of rows in one query ?
How much rows I can delete per query if I using MIXED binlog format ?</description>
		<content:encoded><![CDATA[<p>Hi All.<br />
I using MIXED binlog format. And having problem with simple delete query.<br />
DELETE FROM temp.tenp WHERE id = 10;<br />
This query must delete 3000000 rows from my innodb table.<br />
But slave came to out of sync. (like in comment#2 by Justin Swanhart were hi used STATEMENT binlog format)</p>
<p>But if I&#8217;ve change  binlog format to ROW based, I&#8217;ve got error like in comment#8 by Kim Carlsen &#8230;.. </p>
<p>What I must to do ? Some configuratuin tuning?<br />
do not delete a lot of rows in one query ?<br />
How much rows I can delete per query if I using MIXED binlog format ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Swanhart</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-769787</link>
		<dc:creator>Justin Swanhart</dc:creator>
		<pubDate>Wed, 21 Jul 2010 19:41:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-769787</guid>
		<description>Hi Kim, 

I wanted to let you know that the next release of mysqlbinlog should include a --max-allowed-packet option instead of hard coding it to 1G.  This should resolve your problem with mysqldump.</description>
		<content:encoded><![CDATA[<p>Hi Kim, </p>
<p>I wanted to let you know that the next release of mysqlbinlog should include a &#8211;max-allowed-packet option instead of hard coding it to 1G.  This should resolve your problem with mysqldump.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kim Carlsen</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-763069</link>
		<dc:creator>Kim Carlsen</dc:creator>
		<pubDate>Wed, 12 May 2010 08:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-763069</guid>
		<description>One problem I have experienced with ROW based binary logging, is that mysql can make log entries that get too huge to be parsed through mysql client.

An example is, if you delete all rows in a huge table 
DELETE * FROM huge_table;

This will be formulated as one BINLOG &#039;&#039; entry in the binary log, with a delete statement for each row in the table. 
As a result you will get the error &#039;ERROR 1153 (08S01) at line 1074175: Got a packet bigger than &#039;max_allowed_packet&#039; bytes&#039; when trying to apply 
this log to a database (mysqlbinlog bin-log.000001 &#124; mysql -uroot)

You can increase the max_allowed_packet to a maximum of 1GB, but you will still be able to get larger entries in the log.</description>
		<content:encoded><![CDATA[<p>One problem I have experienced with ROW based binary logging, is that mysql can make log entries that get too huge to be parsed through mysql client.</p>
<p>An example is, if you delete all rows in a huge table<br />
DELETE * FROM huge_table;</p>
<p>This will be formulated as one BINLOG &#8221; entry in the binary log, with a delete statement for each row in the table.<br />
As a result you will get the error &#8216;ERROR 1153 (08S01) at line 1074175: Got a packet bigger than &#8216;max_allowed_packet&#8217; bytes&#8217; when trying to apply<br />
this log to a database (mysqlbinlog bin-log.000001 | mysql -uroot)</p>
<p>You can increase the max_allowed_packet to a maximum of 1GB, but you will still be able to get larger entries in the log.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760697</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sat, 08 May 2010 00:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760697</guid>
		<description>Justin,

On Compatibility - I think this is why there is MySQL and Drizzle.  MySQL has a lot of weight with bad choices over many years which can&#039;t be easily broken because this unsettles a lot of customers who relay on these behaviors. 

Also people do not often know they relay on any side effects. They just upgrade Master and Slave to MySQL 5.1 and just expect things work as before. If it breaks this is serious issue.
I think moving back to STATEMENT by default in MySQL 5.0 was a good choice.   Breaking existing applications is a lot more serious issue than  improving things (which row level replication does)</description>
		<content:encoded><![CDATA[<p>Justin,</p>
<p>On Compatibility &#8211; I think this is why there is MySQL and Drizzle.  MySQL has a lot of weight with bad choices over many years which can&#8217;t be easily broken because this unsettles a lot of customers who relay on these behaviors. </p>
<p>Also people do not often know they relay on any side effects. They just upgrade Master and Slave to MySQL 5.1 and just expect things work as before. If it breaks this is serious issue.<br />
I think moving back to STATEMENT by default in MySQL 5.0 was a good choice.   Breaking existing applications is a lot more serious issue than  improving things (which row level replication does)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760693</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sat, 08 May 2010 00:13:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760693</guid>
		<description>Justin,

With Statement Level replication MySQL 5.1 to 5.0 works for some kinds of applications.  It is not guaranteed to work in all cases of course but it does for many simple MySQL use cases in practice.
This is in fact important case because it allows to get extra assurance for MySQL 5.0 -&gt; 5.1 migrations  - you can keep MySQL 5.0 slave for some time after promoting Master to MySQL 5.1 to  have something to roll back to.</description>
		<content:encoded><![CDATA[<p>Justin,</p>
<p>With Statement Level replication MySQL 5.1 to 5.0 works for some kinds of applications.  It is not guaranteed to work in all cases of course but it does for many simple MySQL use cases in practice.<br />
This is in fact important case because it allows to get extra assurance for MySQL 5.0 -> 5.1 migrations  &#8211; you can keep MySQL 5.0 slave for some time after promoting Master to MySQL 5.1 to  have something to roll back to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Swanhart</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760523</link>
		<dc:creator>Justin Swanhart</dc:creator>
		<pubDate>Fri, 07 May 2010 16:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760523</guid>
		<description>And I don&#039;t buy the argument in: http://bugs.mysql.com/bug.php?id=39812

The people who were relying on statement side effects should manually use statement, or fix their application to set binlog_format=STATEMENT before statements where the stupid statement side-effects are desired.</description>
		<content:encoded><![CDATA[<p>And I don&#8217;t buy the argument in: <a href="http://bugs.mysql.com/bug.php?id=39812" rel="nofollow">http://bugs.mysql.com/bug.php?id=39812</a></p>
<p>The people who were relying on statement side effects should manually use statement, or fix their application to set binlog_format=STATEMENT before statements where the stupid statement side-effects are desired.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Swanhart</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760520</link>
		<dc:creator>Justin Swanhart</dc:creator>
		<pubDate>Fri, 07 May 2010 16:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760520</guid>
		<description>Also, how is statement &quot;more compatible&quot;?  You can&#039;t safely replicate from a 5.1 to a 5.0 host, which is the only place the &quot;compatibility&quot; issue seems to make sense.  A 5.1 slave can consume both Query and RBR events, so how does using statement improve anything?  Triggers, cascading foreign keys and other indirect data changes are much more safely captured using RBR than statement logs.  Using non-deterministic functions like UUID or RAND() are much safer with RBR.</description>
		<content:encoded><![CDATA[<p>Also, how is statement &#8220;more compatible&#8221;?  You can&#8217;t safely replicate from a 5.1 to a 5.0 host, which is the only place the &#8220;compatibility&#8221; issue seems to make sense.  A 5.1 slave can consume both Query and RBR events, so how does using statement improve anything?  Triggers, cascading foreign keys and other indirect data changes are much more safely captured using RBR than statement logs.  Using non-deterministic functions like UUID or RAND() are much safer with RBR.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Swanhart</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760514</link>
		<dc:creator>Justin Swanhart</dc:creator>
		<pubDate>Fri, 07 May 2010 15:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760514</guid>
		<description>And I&#039;ve run into this problem when SQL_LOG_BIN=0 was set on the master and changes were made.  Since deletions (or insertions) happened on the master that were not on the slave the slave was out of sync.  By diagnosing the problem using this technique, I was able to track down how the rows went &#039;missing&#039; on the slave.

My simple example is just that - a simple example.  Reality is complex and there are very many reasons a slave can get out of sync.  When it happens you need to know how to discover what isn&#039;t in sync (which is not obvious from the error message) so that you can find the underlying cause and prevent it from happening again.

Further, it is possible to change from MIXED to ROW to STATEMENT in an individual session, thus a slave could get RBR updates even when the master is in STATEMENT mode.</description>
		<content:encoded><![CDATA[<p>And I&#8217;ve run into this problem when SQL_LOG_BIN=0 was set on the master and changes were made.  Since deletions (or insertions) happened on the master that were not on the slave the slave was out of sync.  By diagnosing the problem using this technique, I was able to track down how the rows went &#8216;missing&#8217; on the slave.</p>
<p>My simple example is just that &#8211; a simple example.  Reality is complex and there are very many reasons a slave can get out of sync.  When it happens you need to know how to discover what isn&#8217;t in sync (which is not obvious from the error message) so that you can find the underlying cause and prevent it from happening again.</p>
<p>Further, it is possible to change from MIXED to ROW to STATEMENT in an individual session, thus a slave could get RBR updates even when the master is in STATEMENT mode.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Swanhart</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760512</link>
		<dc:creator>Justin Swanhart</dc:creator>
		<pubDate>Fri, 07 May 2010 15:43:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760512</guid>
		<description>The &#039;human mistake&#039; is just one reason a slave can get out of sync...

Try this on your statement based master:
DELETE FROM some_table ORDER BY RAND() LIMIT 1000;

Your slave is now out of sync.  Oops..</description>
		<content:encoded><![CDATA[<p>The &#8216;human mistake&#8217; is just one reason a slave can get out of sync&#8230;</p>
<p>Try this on your statement based master:<br />
DELETE FROM some_table ORDER BY RAND() LIMIT 1000;</p>
<p>Your slave is now out of sync.  Oops..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe Maxia</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/06/debugging-problems-with-row-based-replication/comment-page-1/#comment-760411</link>
		<dc:creator>Giuseppe Maxia</dc:creator>
		<pubDate>Fri, 07 May 2010 09:47:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2590#comment-760411</guid>
		<description>MySQL 5.1 default binlog_format in GA has always been STATEMENT. The main reason for this choice is that we wanted to avoid compatibility issues. 
Notice that 5.1 has been GA since version 5.1.30.
I must say that your example is quite unsettling, as it is based on a human mistake that puts the slave in a non recoverable state.
See also this post, where the enhancement of mysqlbinlog was announced.
http://datacharmer.blogspot.com/2008/09/dsclosing-binlog-entries-with-row-based.html</description>
		<content:encoded><![CDATA[<p>MySQL 5.1 default binlog_format in GA has always been STATEMENT. The main reason for this choice is that we wanted to avoid compatibility issues.<br />
Notice that 5.1 has been GA since version 5.1.30.<br />
I must say that your example is quite unsettling, as it is based on a human mistake that puts the slave in a non recoverable state.<br />
See also this post, where the enhancement of mysqlbinlog was announced.<br />
<a href="http://datacharmer.blogspot.com/2008/09/dsclosing-binlog-entries-with-row-based.html" rel="nofollow">http://datacharmer.blogspot.com/2008/09/dsclosing-binlog-entries-with-row-based.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

