<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Random Thoughts &#187; corruption</title>
	<atom:link href="http://alexlurthu.wordpress.com/tag/corruption/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexlurthu.wordpress.com</link>
	<description>Straight from the heart!</description>
	<lastBuildDate>Fri, 04 Dec 2009 20:54:08 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='alexlurthu.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2e18259658cdc132622f409f5fd659ca?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Random Thoughts &#187; corruption</title>
		<link>http://alexlurthu.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://alexlurthu.wordpress.com/osd.xml" title="Random Thoughts" />
		<item>
		<title>Relay binlog corrupt</title>
		<link>http://alexlurthu.wordpress.com/2008/04/25/relay-binlog-corrupt/</link>
		<comments>http://alexlurthu.wordpress.com/2008/04/25/relay-binlog-corrupt/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:13:26 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[corruption]]></category>
		<category><![CDATA[relay log]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[slave]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=43</guid>
		<description><![CDATA[The slave failed with the error that the relay binlog is corrupt. It had copied close to 12 binlogs from the master and they were yet to be applied. Unfortunately those binlogs have been purged on the master. Now to sync up cleanly we might have to refresh data from the master which can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=43&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">The slave failed with the error that the relay binlog is corrupt. It had copied close to 12 binlogs from the master and they were yet to be applied. Unfortunately those binlogs have been purged on the master. Now to sync up cleanly we might have to refresh data from the master which can be costly since it was a 290 GB database. We had the option of shutting down the server. We thought we can try our luck with a crazy hack. We shutdown the server. Tried reading the binlog using mysqlbinlog utility from the corrupt position. It failed as expected. Then we tried reading from the next immediate position and it went through fine. Now we had a proof that our hack might work. We opened the relay-log.info and incremented the second row by a value of one. Then we started the server. Boom, the slave started running and we were saved from a great pain of resyncing the slave.</p>
<p>PS : We might have missed one transaction in this hack, but that was ok for our use case.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=43&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/04/25/relay-binlog-corrupt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
		<item>
		<title>Skip duplicate entries in a slave</title>
		<link>http://alexlurthu.wordpress.com/2008/04/04/skip-duplicate-entries-in-a-slave/</link>
		<comments>http://alexlurthu.wordpress.com/2008/04/04/skip-duplicate-entries-in-a-slave/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 06:53:56 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[corruption]]></category>
		<category><![CDATA[relay log]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/2008/04/04/skip-duplicate-entries-in-a-slave/</guid>
		<description><![CDATA[The following one liner helps to sync a slave that is facing duplicate entry errors.

 while [ 1 ]; do if [ `mysql -u root -e "show slave status \G;" &#124; grep "Duplicate entry" &#124; wc -l` -eq 1 ] ; then mysql -u root -e &#8220;stop slave; set global sql_slave_skip_counter=1; start slave;&#8221;; fi; sleep [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=39&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">The following one liner helps to sync a slave that is facing duplicate entry errors.<br />
<b><br />
</b><font color="#333399"> while [ 1 ]; do if [ `mysql -u root -e "show slave status \G;" | grep "Duplicate entry" | wc -l` -eq 1 ] ; then mysql -u root -e &#8220;stop slave; set global sql_slave_skip_counter=1; start slave;&#8221;; fi; sleep 1;  mysql -u root -e &#8220;show slave status\G&#8221;; done</font></p>
<div align="justify"></div>
<p align="justify">One of our peer groups had a badly configured setup where they were writing to 2 masters. Both the masters were setup with circular replication. They were also having a corrupted binlog event in the relay log.</p>
<p>To fix that, had to run a change master command to use the logfile listed under relay_master_log_file and the log position under exec_master_log_pos in show slave status.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=39&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/04/04/skip-duplicate-entries-in-a-slave/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
	</channel>
</rss>