Re: Enabling Checksums
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndQuadrant.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, 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-19T17:45:07Z
Lists: pgsql-hackers
On 19 March 2013 17:18, Jeff Davis <pgsql@j-davis.com> wrote: > I will move back to verifying the page hole, as well. That was agreed long ago... > 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(). > > With option #2 or #3, we might also verify that the hole is all-zero if > asserts are enabled. (3) seems likely to be more expensive than (2), since we're talking unaligned memory writes rather than a single pre-fetchable block read. In any case, at initial patch commit, we should CRC the whole block and allow for the possibility of improvement following measurements. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services