Re: Enabling Checksums
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Simon Riggs <simon@2ndQuadrant.com>, Andres Freund <andres@2ndQuadrant.com>, Ants Aasma <ants@cybertec.at>, Heikki Linnakangas <hlinnakangas@vmware.com>, Greg Smith <greg@2ndQuadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2013-03-19T18:07:53Z
Lists: pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes: > I will move back to verifying the page hole, as well. > There are a few approaches: > 1. Verify that the page hole is zero before write and after read. > 2. Include it in the calculation (if we think there are some corner > cases where the hole might not be all zero). > 3. Zero the page hole before write, and verify that it's zero on read. > This can be done during the memcpy at no performance penalty in > PageSetChecksumOnCopy(), but that won't work for > PageSetChecksumInplace(). TBH, I do not think that the checksum code ought to be so familiar with the page format as to know that there *is* a hole, much less be willing to zero out what it thinks is a hole. I consider #3 totally unacceptable from a safety standpoint, and don't much care for #1 either. #2 sounds like the thing to do. regards, tom lane