<?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"
	>
<channel>
	<title>Comments for One Free Voice</title>
	<atom:link href="http://blog.onefreevoice.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.onefreevoice.com</link>
	<description>a blog about databases and stuff</description>
	<pubDate>Thu, 28 Aug 2008 22:56:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>Comment on Creating an Intermediate Replication Layer by Gregory Haase</title>
		<link>http://blog.onefreevoice.com/2008/07/15/creating_intermediate_slaves/#comment-671</link>
		<dc:creator>Gregory Haase</dc:creator>
		<pubDate>Mon, 28 Jul 2008 15:10:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=103#comment-671</guid>
		<description>I made one final edit to this procedure. The &lt;code&gt;START SLAVE UNTIL&lt;/code&gt; directive only causes the slave SQL thread to stop at the given bin-log and position. At this point, the slave IO thread is still running. The original script had a &lt;code&gt;RESET SLAVE&lt;/code&gt; call immediately after &lt;code&gt;MASTER_POS_WAIT&lt;/code&gt;.  This resulted in the error:
&lt;pre lang="sql"&gt;ERROR 1198 (HY000) at line 6: This operation cannot be performed with a running slave; run STOP SLAVE first&lt;/pre&gt; 
Inserting &lt;code&gt;STOP SLAVE&lt;/code&gt; before &lt;code&gt;RESET SLAVE&lt;/code&gt; resolves the issue.</description>
		<content:encoded><![CDATA[<p>I made one final edit to this procedure. The <code>START SLAVE UNTIL</code> directive only causes the slave SQL thread to stop at the given bin-log and position. At this point, the slave IO thread is still running. The original script had a <code>RESET SLAVE</code> call immediately after <code>MASTER_POS_WAIT</code>.  This resulted in the error:</p>

<div class="wp_syntax"><div class="code"><pre class="sql">ERROR <span style="color: #cc66cc;">1198</span> <span style="color: #66cc66;">&#40;</span>HY000<span style="color: #66cc66;">&#41;</span> at line <span style="color: #cc66cc;">6</span>: This operation cannot be performed <span style="color: #993333; font-weight: bold;">WITH</span> a running slave; run STOP SLAVE first</pre></div></div>

<p>Inserting <code>STOP SLAVE</code> before <code>RESET SLAVE</code> resolves the issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Keep Binlogs in Sync? by Gregory Haase</title>
		<link>http://blog.onefreevoice.com/2008/06/24/how-to-keep-binlogs-in-sync/#comment-649</link>
		<dc:creator>Gregory Haase</dc:creator>
		<pubDate>Tue, 15 Jul 2008 19:52:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=100#comment-649</guid>
		<description>I've edited this procedure to reflect the fact that START SLAVE UNTIL is asynchronous (see &lt;a href="http://blog.onefreevoice.com/2008/07/15/creating_intermediate_slaves/#comment-647" rel="nofollow"&gt;comment&lt;/a&gt; from Mats Kindahl).</description>
		<content:encoded><![CDATA[<p>I&#8217;ve edited this procedure to reflect the fact that START SLAVE UNTIL is asynchronous (see <a href="http://blog.onefreevoice.com/2008/07/15/creating_intermediate_slaves/#comment-647" rel="nofollow">comment</a> from Mats Kindahl).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Creating an Intermediate Replication Layer by Gregory Haase</title>
		<link>http://blog.onefreevoice.com/2008/07/15/creating_intermediate_slaves/#comment-648</link>
		<dc:creator>Gregory Haase</dc:creator>
		<pubDate>Tue, 15 Jul 2008 19:46:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=103#comment-648</guid>
		<description>Thank you Mats for catching that one. I've edited the original thread to include MASTER_POS_WAIT as you suggested.</description>
		<content:encoded><![CDATA[<p>Thank you Mats for catching that one. I&#8217;ve edited the original thread to include MASTER_POS_WAIT as you suggested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Creating an Intermediate Replication Layer by Mats Kindahl</title>
		<link>http://blog.onefreevoice.com/2008/07/15/creating_intermediate_slaves/#comment-647</link>
		<dc:creator>Mats Kindahl</dc:creator>
		<pubDate>Tue, 15 Jul 2008 19:22:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=103#comment-647</guid>
		<description>Uhm... as I understand what you are trying to accomplish, there is a problem with following the procedure given. If the instructions are followed by the letter, the intermediate slave will be reset &lt;em&gt;immediately&lt;/em&gt; and not when the slave reaches the until-position given in the &lt;code&gt;START SLAVE UNTIL&lt;/code&gt;. This is because the &lt;code&gt;START SLAVE UNTIL&lt;/code&gt; starts the slave asynchronously, i.e., will return immediately with the slave running. To wait for the slaves to reach the given position before resetting them, it is necessary to add a &lt;code&gt;SELECT MASTER_POS_WAIT('bin-logs.000025', 106)&lt;/code&gt; after the &lt;code&gt;START SLAVE UNTIL&lt;/code&gt; but before the &lt;code&gt;RESET MASTER&lt;/code&gt; and the &lt;code&gt;RESET SLAVE&lt;/code&gt; respectively.</description>
		<content:encoded><![CDATA[<p>Uhm&#8230; as I understand what you are trying to accomplish, there is a problem with following the procedure given. If the instructions are followed by the letter, the intermediate slave will be reset <em>immediately</em> and not when the slave reaches the until-position given in the <code>START SLAVE UNTIL</code>. This is because the <code>START SLAVE UNTIL</code> starts the slave asynchronously, i.e., will return immediately with the slave running. To wait for the slaves to reach the given position before resetting them, it is necessary to add a <code>SELECT MASTER_POS_WAIT('bin-logs.000025', 106)</code> after the <code>START SLAVE UNTIL</code> but before the <code>RESET MASTER</code> and the <code>RESET SLAVE</code> respectively.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Keep Binlogs in Sync? by One Free Voice &#187; Blog Archive &#187; Creating an Intermediate Replication Layer</title>
		<link>http://blog.onefreevoice.com/2008/06/24/how-to-keep-binlogs-in-sync/#comment-646</link>
		<dc:creator>One Free Voice &#187; Blog Archive &#187; Creating an Intermediate Replication Layer</dc:creator>
		<pubDate>Tue, 15 Jul 2008 17:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=100#comment-646</guid>
		<description>[...] few weeks ago, I discussed how to keep binlogs in sync in a tree or pyramid replication scheme. That thread discussed how to re-distribute load in case of [...]</description>
		<content:encoded><![CDATA[<p>[...] few weeks ago, I discussed how to keep binlogs in sync in a tree or pyramid replication scheme. That thread discussed how to re-distribute load in case of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Keep Binlogs in Sync? by Gregory Haase</title>
		<link>http://blog.onefreevoice.com/2008/06/24/how-to-keep-binlogs-in-sync/#comment-634</link>
		<dc:creator>Gregory Haase</dc:creator>
		<pubDate>Thu, 26 Jun 2008 00:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=100#comment-634</guid>
		<description>I revised the process outlined above to include Mark's suggestion about START SLAVE UNTIL.

I also changed MASTER_LOG_FILE to RELAY_MASTER_LOG_FILE reflecting Baron's comment. 

RELAY_MASTER_LOG_FILE is the name of the master binary log file containing the most recent event executed by the SQL thread. It's companion EXEC_MASTER_LOG_POSITION is the position of the last event executed by the SQL thread from the master's binary log. See &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/show-slave-status.html" title="show slave status" rel="nofollow"&gt;Documentation&lt;/a&gt;.

I would note that in the case of one of my intermediate slaves going down, the SQL thread on the end slaves is not going to stop. It's going to process all the way through the relay logs. The I/O thread would keep trying to connect to the master every 60 seconds.  If the slaves were guaranteed in sync, one could theoretically map the IP Address of the failed server to one of your working servers and never miss a beat.</description>
		<content:encoded><![CDATA[<p>I revised the process outlined above to include Mark&#8217;s suggestion about START SLAVE UNTIL.</p>
<p>I also changed MASTER_LOG_FILE to RELAY_MASTER_LOG_FILE reflecting Baron&#8217;s comment. </p>
<p>RELAY_MASTER_LOG_FILE is the name of the master binary log file containing the most recent event executed by the SQL thread. It&#8217;s companion EXEC_MASTER_LOG_POSITION is the position of the last event executed by the SQL thread from the master&#8217;s binary log. See <a href="http://dev.mysql.com/doc/refman/5.1/en/show-slave-status.html" title="show slave status" rel="nofollow">Documentation</a>.</p>
<p>I would note that in the case of one of my intermediate slaves going down, the SQL thread on the end slaves is not going to stop. It&#8217;s going to process all the way through the relay logs. The I/O thread would keep trying to connect to the master every 60 seconds.  If the slaves were guaranteed in sync, one could theoretically map the IP Address of the failed server to one of your working servers and never miss a beat.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Keep Binlogs in Sync? by Xaprb</title>
		<link>http://blog.onefreevoice.com/2008/06/24/how-to-keep-binlogs-in-sync/#comment-633</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Wed, 25 Jun 2008 20:20:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=100#comment-633</guid>
		<description>MASTER_LOG_FILE, EXEC_MASTER_LOG_POSITION is quicksand for the unwary :-) Master_log_file is the I/O thread's position, and you care about what updates have been applied, not which have been read from the master.

I'm still working on automating this with mk-slave-move from Maatkit.  You can already do it *before* the server crashes, with the current code.  But after it crashes -- that's harder.  Even while the servers are all functioning normally there are a lot of tricky cases to cover.</description>
		<content:encoded><![CDATA[<p>MASTER_LOG_FILE, EXEC_MASTER_LOG_POSITION is quicksand for the unwary <img src='http://blog.onefreevoice.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Master_log_file is the I/O thread&#8217;s position, and you care about what updates have been applied, not which have been read from the master.</p>
<p>I&#8217;m still working on automating this with mk-slave-move from Maatkit.  You can already do it *before* the server crashes, with the current code.  But after it crashes &#8212; that&#8217;s harder.  Even while the servers are all functioning normally there are a lot of tricky cases to cover.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Keep Binlogs in Sync? by Gregory Haase</title>
		<link>http://blog.onefreevoice.com/2008/06/24/how-to-keep-binlogs-in-sync/#comment-632</link>
		<dc:creator>Gregory Haase</dc:creator>
		<pubDate>Wed, 25 Jun 2008 12:18:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=100#comment-632</guid>
		<description>That's a good point. I keep forgetting about START SLAVE UNTIL.</description>
		<content:encoded><![CDATA[<p>That&#8217;s a good point. I keep forgetting about START SLAVE UNTIL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Keep Binlogs in Sync? by Mark Leith</title>
		<link>http://blog.onefreevoice.com/2008/06/24/how-to-keep-binlogs-in-sync/#comment-631</link>
		<dc:creator>Mark Leith</dc:creator>
		<pubDate>Wed, 25 Jun 2008 10:12:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=100#comment-631</guid>
		<description>Yes there is a chance that there could be a statement issued from the slave SQL thread between the MASTER_POS_WAIT and the RESET MASTER. 

You want to look in to STOP SLAVE ; START SLAVE UNTIL instead, this guarantees that no statements run after the point that you want to be at. 

This was discussed a little before on Baron's blog (and in the comments) here:

http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/</description>
		<content:encoded><![CDATA[<p>Yes there is a chance that there could be a statement issued from the slave SQL thread between the MASTER_POS_WAIT and the RESET MASTER. </p>
<p>You want to look in to STOP SLAVE ; START SLAVE UNTIL instead, this guarantees that no statements run after the point that you want to be at. </p>
<p>This was discussed a little before on Baron&#8217;s blog (and in the comments) here:</p>
<p><a href="http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/" rel="nofollow">http://www.xaprb.com/blog/2007/01/20/how-to-make-mysql-replication-reliable/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on MySQL Event Scheduler - Is it Enterprise Ready? by Mark Robson</title>
		<link>http://blog.onefreevoice.com/2008/06/02/mysql-event-scheduler/#comment-623</link>
		<dc:creator>Mark Robson</dc:creator>
		<pubDate>Tue, 03 Jun 2008 08:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.onefreevoice.com/?p=96#comment-623</guid>
		<description>I don't think you should be using "I can't figure out a way to correctly distribute my software" as a valid reason to use mysql scheduler.

Distributing software correctly to all nodes in your service and having it only run on ones it needs to (i.e. only on master, not slaves) is a no-brainer and anyone can resolve it trivially.

Your software build / testing system should show up any problems in your distribution / install system.

Yes there are problems with MySQL scheduler. Yes, "cron" works. In practice it is quite easy to make cron jobs work correctly - for example, you can build your application into a set of RPMs (or other favourite package manager) which drop files into /etc/cron.d. Your cron jobs can check whether they're on a master or slave to decide what to do. All this can be tested in your development / testing environment (which clearly needs to have the same master/slave setup as production!).

Come on - it's not rocket science.

As regards spurious logging - mysql is not very good for this - the slave thread writes "[ERROR] Error reading relay log event: slave SQL thread was killed" when you shut it down administratively for a backup.

Of course any sane person puts a trigger on their monitoring system which spots things like [ERROR] on mysqld.log and generates alerts ... :)

Mark</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think you should be using &#8220;I can&#8217;t figure out a way to correctly distribute my software&#8221; as a valid reason to use mysql scheduler.</p>
<p>Distributing software correctly to all nodes in your service and having it only run on ones it needs to (i.e. only on master, not slaves) is a no-brainer and anyone can resolve it trivially.</p>
<p>Your software build / testing system should show up any problems in your distribution / install system.</p>
<p>Yes there are problems with MySQL scheduler. Yes, &#8220;cron&#8221; works. In practice it is quite easy to make cron jobs work correctly - for example, you can build your application into a set of RPMs (or other favourite package manager) which drop files into /etc/cron.d. Your cron jobs can check whether they&#8217;re on a master or slave to decide what to do. All this can be tested in your development / testing environment (which clearly needs to have the same master/slave setup as production!).</p>
<p>Come on - it&#8217;s not rocket science.</p>
<p>As regards spurious logging - mysql is not very good for this - the slave thread writes &#8220;[ERROR] Error reading relay log event: slave SQL thread was killed&#8221; when you shut it down administratively for a backup.</p>
<p>Of course any sane person puts a trigger on their monitoring system which spots things like [ERROR] on mysqld.log and generates alerts &#8230; <img src='http://blog.onefreevoice.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Mark</p>
]]></content:encoded>
	</item>
</channel>
</rss>
