<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Introducing MySQL Slave Delay</title>
	<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/</link>
	<description>Stay curious!</description>
	<pubDate>Fri, 16 May 2008 04:18:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13336</link>
		<author>Xaprb</author>
		<pubDate>Fri, 24 Aug 2007 17:32:54 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13336</guid>
		<description>I have just one idea: it's a bug :)  I'll file it at the sourceforge project and take a look at reproducing and fixing it.</description>
		<content:encoded><![CDATA[<p>I have just one idea: it&#8217;s a bug :)  I&#8217;ll file it at the sourceforge project and take a look at reproducing and fixing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jodrell</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13335</link>
		<author>Jodrell</author>
		<pubDate>Fri, 24 Aug 2007 15:12:48 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13335</guid>
		<description>I'm running,
mysql-slave-delay u=user,h=localhost,p=pass --delay 10m --interval 15s --time 20m localhost

and seeing the following error,

2007-08-24T16:09:17 slave running 0 seconds behind
Use of uninitialized value in concatenation (.) or string at /usr/bin/mysql-slave-delay line 269.

Any ideas?</description>
		<content:encoded><![CDATA[<p>I&#8217;m running,<br />
mysql-slave-delay u=user,h=localhost,p=pass &#8211;delay 10m &#8211;interval 15s &#8211;time 20m localhost</p>
<p>and seeing the following error,</p>
<p>2007-08-24T16:09:17 slave running 0 seconds behind<br />
Use of uninitialized value in concatenation (.) or string at /usr/bin/mysql-slave-delay line 269.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#60;/depesz&#62; &#187; Blog Archive &#187; Log Buffer #57: a Carnival of the Vanities for DBAs</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13298</link>
		<author>&#60;/depesz&#62; &#187; Blog Archive &#187; Log Buffer #57: a Carnival of the Vanities for DBAs</author>
		<pubDate>Fri, 10 Aug 2007 16:01:49 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13298</guid>
		<description>[...] Zhuravlev on Xaprb wrote about new extension for MySQL replication - slave delay. Interesting idea with some obvious, [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Zhuravlev on Xaprb wrote about new extension for MySQL replication - slave delay. Interesting idea with some obvious, [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13296</link>
		<author>Xaprb</author>
		<pubDate>Wed, 08 Aug 2007 17:28:38 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13296</guid>
		<description>Hi,

It could be that the .my.cnf didn't work because the tool only reads the [mysql] section of the file, so if you have a [client] section it wouldn't read that.  Maybe that should be changed; I can't decide.

In the scenario you describe, I think you're talking about A-&gt;B-&gt;A replication.  If you run the tool against B, it will only slow B getting the changes from A.  This is because (I assume) you'll have both servers configured with log_slave_updates.  So an event on A will go to B's relay log, sit for half an hour, execute, go into B's binary log, go to A's relay log -- and be ignored, since it came from A to begin with.  However, events on B will go into B's binary log, A's relay log, and get executed on A right away.

If you are talking about A-&gt;B-&gt;C replication, though, it's different.  A's event will be delayed half an hour on B, then go into B's binary log and then to C's relay log, delayed half an hour.  So in case you're thinking about trying to delay B but not C, I don't think you can do it.

This conversation brings up an interesting thought: the relay logs could be delayed too.  I can't think of why that would be useful right now, though.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>It could be that the .my.cnf didn&#8217;t work because the tool only reads the [mysql] section of the file, so if you have a [client] section it wouldn&#8217;t read that.  Maybe that should be changed; I can&#8217;t decide.</p>
<p>In the scenario you describe, I think you&#8217;re talking about A->B->A replication.  If you run the tool against B, it will only slow B getting the changes from A.  This is because (I assume) you&#8217;ll have both servers configured with log_slave_updates.  So an event on A will go to B&#8217;s relay log, sit for half an hour, execute, go into B&#8217;s binary log, go to A&#8217;s relay log &#8212; and be ignored, since it came from A to begin with.  However, events on B will go into B&#8217;s binary log, A&#8217;s relay log, and get executed on A right away.</p>
<p>If you are talking about A->B->C replication, though, it&#8217;s different.  A&#8217;s event will be delayed half an hour on B, then go into B&#8217;s binary log and then to C&#8217;s relay log, delayed half an hour.  So in case you&#8217;re thinking about trying to delay B but not C, I don&#8217;t think you can do it.</p>
<p>This conversation brings up an interesting thought: the relay logs could be delayed too.  I can&#8217;t think of why that would be useful right now, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Penguinisto</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13295</link>
		<author>Penguinisto</author>
		<pubDate>Wed, 08 Aug 2007 16:24:41 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13295</guid>
		<description>No worries... I had a bit of trouble getting it to read out of my.cnf (where the requisite info was already lodged). This may be to some paranoia that we tend to implement around here, though.

Otherwise it does great for setting a 30m delay, and I see no problems (yet - still stress-testing it) with putting it into production. Any bugs will get sent up the chain, I promise :)

The error msgs I spoke are these (sanitized) - doesn't seem to slow anything down at all, though, so I'm not particularly worried about seeing them. That, and it was mentioned in the docs anyway. For the rubberneckers, here's what pops up (success, failure, success, failure, etc - all notes):
---
070808  8:15:36 [Note] Slave SQL thread initialized, starting replication in log '(binlog).000001' at position 3437288, relay log './(my)-relay-bin.000004' position: 2650095
070808  8:15:51 [Note] Error reading relay log event: slave SQL thread was killed
070808  8:45:52 [Note] Slave SQL thread initialized, starting replication in log '(binlog).000001' at position 3454088, relay log './(my)-relay-bin.000004' position: 2666895
070808  8:46:07 [Note] Error reading relay log event: slave SQL thread was killed
070808  9:16:07 [Note] Slave SQL thread initialized, starting replication in log '(binlog).000001' at position 3471168, relay log './(my)-relay-bin.000004' position: 2683975
070808  9:16:22 [Note] Error reading relay log event: slave SQL thread was killed
---

Like I said, no worries, and everything works as advertised. Just figured you'd want to peek at 'em.


I do have something to ponder, though; the slave server I implemented this on is about to be in the middle of a daisy-chain where two-way replication occurs. This is actually good in that changes I make to this DB propagate out immediately, while inbound changes are delayed. That said, I'm about to add another DB machine parallel to it (for a poor-man's RAC rig w/ heartbeat/STONITH/scripting). 

Is there a way to rig a delay for only one specific master, while letting the other roll its changes right in? I suspect that's part of what the master binary DB check can be used for, but I'm not sure.

If not, no worries - I can just set the new DB to replicate off the same one that my first one does, set up the STONITH/heartbeat and scripting, and possibly create a replication loop of sorts as a 'sanity check' (I haven't even checked to see if that's possible w/o inducing problems yet). If that works I'll document the whole thing (I have to document it anyway) and send it along w/ all the names/users/etc info sanitized out.

Besides, this is rather fun (and they pay me for it)... :)

Cheers!

/P</description>
		<content:encoded><![CDATA[<p>No worries&#8230; I had a bit of trouble getting it to read out of my.cnf (where the requisite info was already lodged). This may be to some paranoia that we tend to implement around here, though.</p>
<p>Otherwise it does great for setting a 30m delay, and I see no problems (yet - still stress-testing it) with putting it into production. Any bugs will get sent up the chain, I promise :)</p>
<p>The error msgs I spoke are these (sanitized) - doesn&#8217;t seem to slow anything down at all, though, so I&#8217;m not particularly worried about seeing them. That, and it was mentioned in the docs anyway. For the rubberneckers, here&#8217;s what pops up (success, failure, success, failure, etc - all notes):<br />
&#8212;<br />
070808  8:15:36 [Note] Slave SQL thread initialized, starting replication in log &#8216;(binlog).000001&#8242; at position 3437288, relay log &#8216;./(my)-relay-bin.000004&#8242; position: 2650095<br />
070808  8:15:51 [Note] Error reading relay log event: slave SQL thread was killed<br />
070808  8:45:52 [Note] Slave SQL thread initialized, starting replication in log &#8216;(binlog).000001&#8242; at position 3454088, relay log &#8216;./(my)-relay-bin.000004&#8242; position: 2666895<br />
070808  8:46:07 [Note] Error reading relay log event: slave SQL thread was killed<br />
070808  9:16:07 [Note] Slave SQL thread initialized, starting replication in log &#8216;(binlog).000001&#8242; at position 3471168, relay log &#8216;./(my)-relay-bin.000004&#8242; position: 2683975<br />
070808  9:16:22 [Note] Error reading relay log event: slave SQL thread was killed<br />
&#8212;</p>
<p>Like I said, no worries, and everything works as advertised. Just figured you&#8217;d want to peek at &#8216;em.</p>
<p>I do have something to ponder, though; the slave server I implemented this on is about to be in the middle of a daisy-chain where two-way replication occurs. This is actually good in that changes I make to this DB propagate out immediately, while inbound changes are delayed. That said, I&#8217;m about to add another DB machine parallel to it (for a poor-man&#8217;s RAC rig w/ heartbeat/STONITH/scripting). </p>
<p>Is there a way to rig a delay for only one specific master, while letting the other roll its changes right in? I suspect that&#8217;s part of what the master binary DB check can be used for, but I&#8217;m not sure.</p>
<p>If not, no worries - I can just set the new DB to replicate off the same one that my first one does, set up the STONITH/heartbeat and scripting, and possibly create a replication loop of sorts as a &#8217;sanity check&#8217; (I haven&#8217;t even checked to see if that&#8217;s possible w/o inducing problems yet). If that works I&#8217;ll document the whole thing (I have to document it anyway) and send it along w/ all the names/users/etc info sanitized out.</p>
<p>Besides, this is rather fun (and they pay me for it)&#8230; :)</p>
<p>Cheers!</p>
<p>/P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13290</link>
		<author>Xaprb</author>
		<pubDate>Wed, 08 Aug 2007 02:03:15 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13290</guid>
		<description>Hi!  If it doesn't hold up in production, it's a bug.  Report it via Sourceforge if so!

About the user/pass, I usually have these in a ~/.my.cnf file so they don't have to be specified at the commandline.</description>
		<content:encoded><![CDATA[<p>Hi!  If it doesn&#8217;t hold up in production, it&#8217;s a bug.  Report it via Sourceforge if so!</p>
<p>About the user/pass, I usually have these in a ~/.my.cnf file so they don&#8217;t have to be specified at the commandline.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Penguinisto</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13287</link>
		<author>Penguinisto</author>
		<pubDate>Tue, 07 Aug 2007 21:20:17 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13287</guid>
		<description>Nice, very nice. 

I'm giving it a bit of field trial now on some sandbox DBs, and if it holds up, yes it will be put into production.

NB: I saw a slave SQL thread kill "error" presented as a note in mysqld.log @ the slave machine, but am not worried ab't it just yet - I want to see if a dropped table on the master's DB actually waits 30 minutes --my setting-- to propagate to the slave. If so, we're golden here.

FYI, a typical default rig should look something like this, though:

mysql-slave-delay --quiet --delay 30m --interval 15s h=dhdb01,u=myLocalUser,p=myPassword dhdb01 

(well, aside from the intentionally munged user/pass names and a quickie ampersand on the end, that's exactly what I used).

Took a second to grok the syntax for user/pass, and a lot of folks lock down their DBs, so... there you go :)

Cheers!

/P</description>
		<content:encoded><![CDATA[<p>Nice, very nice. </p>
<p>I&#8217;m giving it a bit of field trial now on some sandbox DBs, and if it holds up, yes it will be put into production.</p>
<p>NB: I saw a slave SQL thread kill &#8220;error&#8221; presented as a note in mysqld.log @ the slave machine, but am not worried ab&#8217;t it just yet - I want to see if a dropped table on the master&#8217;s DB actually waits 30 minutes &#8211;my setting&#8211; to propagate to the slave. If so, we&#8217;re golden here.</p>
<p>FYI, a typical default rig should look something like this, though:</p>
<p>mysql-slave-delay &#8211;quiet &#8211;delay 30m &#8211;interval 15s h=dhdb01,u=myLocalUser,p=myPassword dhdb01 </p>
<p>(well, aside from the intentionally munged user/pass names and a quickie ampersand on the end, that&#8217;s exactly what I used).</p>
<p>Took a second to grok the syntax for user/pass, and a lot of folks lock down their DBs, so&#8230; there you go :)</p>
<p>Cheers!</p>
<p>/P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13062</link>
		<author>Jeremy</author>
		<pubDate>Sun, 05 Aug 2007 07:38:15 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/08/04/introducing-mysql-slave-delay/#comment-13062</guid>
		<description>Sergey and Baron,

Please send me your size information for twitter t-shirts.

You keep blowing me away with your tools (which we use!).

Also, please put up a donate link or wishlist.

Jeremy</description>
		<content:encoded><![CDATA[<p>Sergey and Baron,</p>
<p>Please send me your size information for twitter t-shirts.</p>
<p>You keep blowing me away with your tools (which we use!).</p>
<p>Also, please put up a donate link or wishlist.</p>
<p>Jeremy</p>
]]></content:encoded>
	</item>
</channel>
</rss>
