<?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: How PostgreSQL protects against partial page writes and data corruption</title>
	<atom:link href="http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 20:41:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Enzo</title>
		<link>http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/#comment-19577</link>
		<dc:creator>Enzo</dc:creator>
		<pubDate>Mon, 15 Aug 2011 20:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1616#comment-19577</guid>
		<description>Postgres doesn&#039;t do that is the dumbest thing I&#039;ve heard when it comes to corruption. Explain this error then:


SQLERRM: missing chunk number 0 for toast value 9785285
SQLCODE: XX000

If you Google this, you will see that it is very common due to hardware failures. In my case, dropping the toast index, rebuilding it and vacuuming the database have done absolutely nothing to correct the problem. I&#039;m selecting * from the table to identify the ids and deleting them, but this is a 6 million row table and it is taking 5 min. to identify each bad record. I have no idea how many are bad. I could set the database parameter zero_damaged_pages to true, but then I won&#039;t have any idea of how many rows are corrupted.

Postgres is pretty lame when it comes to identifying database corruption and repairing it. The only way to detected it is by dumping the database or select * from every table in the database.</description>
		<content:encoded><![CDATA[<p>Postgres doesn&#8217;t do that is the dumbest thing I&#8217;ve heard when it comes to corruption. Explain this error then:</p>
<p>SQLERRM: missing chunk number 0 for toast value 9785285<br />
SQLCODE: XX000</p>
<p>If you Google this, you will see that it is very common due to hardware failures. In my case, dropping the toast index, rebuilding it and vacuuming the database have done absolutely nothing to correct the problem. I&#8217;m selecting * from the table to identify the ids and deleting them, but this is a 6 million row table and it is taking 5 min. to identify each bad record. I have no idea how many are bad. I could set the database parameter zero_damaged_pages to true, but then I won&#8217;t have any idea of how many rows are corrupted.</p>
<p>Postgres is pretty lame when it comes to identifying database corruption and repairing it. The only way to detected it is by dumping the database or select * from every table in the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/#comment-17837</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Fri, 19 Feb 2010 02:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1616#comment-17837</guid>
		<description>I won&#039;t be able to be at the BWPUG meeting this time, but maybe another time.

As far as I can understand, hint bits don&#039;t belong on disk or in the WAL anyway.  They say nothing about the data; they only reflect the current state of transactions in a way that&#039;s not meaningful for recovery.  But I appreciate why they&#039;re in the pages and not elsewhere.  Changing the page format looks like a good reason to delay page CRCs until someone&#039;s ready with a way to help with in-place upgrades (read old version, write new version).</description>
		<content:encoded><![CDATA[<p>I won&#8217;t be able to be at the BWPUG meeting this time, but maybe another time.</p>
<p>As far as I can understand, hint bits don&#8217;t belong on disk or in the WAL anyway.  They say nothing about the data; they only reflect the current state of transactions in a way that&#8217;s not meaningful for recovery.  But I appreciate why they&#8217;re in the pages and not elsewhere.  Changing the page format looks like a good reason to delay page CRCs until someone&#8217;s ready with a way to help with in-place upgrades (read old version, write new version).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Smith</title>
		<link>http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/#comment-17813</link>
		<dc:creator>Greg Smith</dc:creator>
		<pubDate>Sun, 14 Feb 2010 08:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1616#comment-17813</guid>
		<description>Let me summarize the giant pgsql-hackers thread...there&#039;s a whole stack of reasons there&#039;s not CRC checks on the data blocks in PostgreSQL yet, bu the major three are:

1) The database uses these things called hint bits:  http://wiki.postgresql.org/wiki/Hint_Bits to help reduce the work involved in checking visibility information on the page.  Changes to the hint bit info is not considered important--if they get screwed up, it can only be in the way that required doing more work; can&#039;t have any corruption issues from it.  Accordingly, hint bit changes aren&#039;t logged in the WAL, and the database is pretty loose about letting people change them.  Tightening that up, so that all hint bit changes go through the same WAL logging as other data on the page, is going to introduce a performance hit that everybody pays, whether or not they have CRCs turned on.

2) Torn pages, where only part of a page is written out, are handled pretty well by the current recovery design.  This gets much more complicated with CRCs.

3) Adding this feature requires expanding the header of data pages, which is going to add a new type of task for an in-place upgrade that introduces this feature.  This is difficult to put the work into resolving when the value of this feature seems so small.  Most don&#039;t care about it, and those who do already have options like ZFS (which avoids torn page issues at a lower level the database can&#039;t really match).</description>
		<content:encoded><![CDATA[<p>Let me summarize the giant pgsql-hackers thread&#8230;there&#8217;s a whole stack of reasons there&#8217;s not CRC checks on the data blocks in PostgreSQL yet, bu the major three are:</p>
<p>1) The database uses these things called hint bits:  <a href="http://wiki.postgresql.org/wiki/Hint_Bits" rel="nofollow">http://wiki.postgresql.org/wiki/Hint_Bits</a> to help reduce the work involved in checking visibility information on the page.  Changes to the hint bit info is not considered important&#8211;if they get screwed up, it can only be in the way that required doing more work; can&#8217;t have any corruption issues from it.  Accordingly, hint bit changes aren&#8217;t logged in the WAL, and the database is pretty loose about letting people change them.  Tightening that up, so that all hint bit changes go through the same WAL logging as other data on the page, is going to introduce a performance hit that everybody pays, whether or not they have CRCs turned on.</p>
<p>2) Torn pages, where only part of a page is written out, are handled pretty well by the current recovery design.  This gets much more complicated with CRCs.</p>
<p>3) Adding this feature requires expanding the header of data pages, which is going to add a new type of task for an in-place upgrade that introduces this feature.  This is difficult to put the work into resolving when the value of this feature seems so small.  Most don&#8217;t care about it, and those who do already have options like ZFS (which avoids torn page issues at a lower level the database can&#8217;t really match).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Smith</title>
		<link>http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/#comment-17812</link>
		<dc:creator>Greg Smith</dc:creator>
		<pubDate>Sun, 14 Feb 2010 07:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1616#comment-17812</guid>
		<description>BWPUG meetings are typically the 2nd Wednesday of the month, which makes next month&#039;s expected on March 9.  The pugs page is quite stale; the list archives at http://archives.postgresql.org/bwpug/ are more useful.

Given most people who attend the BWPUG and Baron will all be at PGEast, it may not be worth his trouble to hit the PUG when we&#039;ll all see each other a few weeks later anyway.</description>
		<content:encoded><![CDATA[<p>BWPUG meetings are typically the 2nd Wednesday of the month, which makes next month&#8217;s expected on March 9.  The pugs page is quite stale; the list archives at <a href="http://archives.postgresql.org/bwpug/" rel="nofollow">http://archives.postgresql.org/bwpug/</a> are more useful.</p>
<p>Given most people who attend the BWPUG and Baron will all be at PGEast, it may not be worth his trouble to hit the PUG when we&#8217;ll all see each other a few weeks later anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2010/02/08/how-postgresql-protects-against-partial-page-writes-and-data-corruption/#comment-17809</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Sat, 13 Feb 2010 00:38:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1616#comment-17809</guid>
		<description>(Lest I seem lazy -- I did look at http://pugs.postgresql.org/bwpug, but it&#039;s quite stale.)</description>
		<content:encoded><![CDATA[<p>(Lest I seem lazy &#8212; I did look at <a href="http://pugs.postgresql.org/bwpug" rel="nofollow">http://pugs.postgresql.org/bwpug</a>, but it&#8217;s quite stale.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

