On Fri, Jan 27, 2012 at 9:07 PM, Dan Scales <scales@vmware.com> wrote:
> The advantage of putting the checksum calculation in smgrwrite() (or mdwrite()) is that it catches a bunch of page
writesthat don't go through the buffer pool (see calls to smgrwrite() in nbtree.c, nbtsort.c, spginsert.c)
I'll have another look at that. Seems like we can make it various
ways, we just need to decide the code placement.
> Also, I missed this before: don't you want to add the checksum calculation (PageSetVerificationInfo) to mdextend()
(orpreferably smgrextend()) as well? Otherwise, you won't be checksumming a bunch of the new pages.
You don't need to checksum the extend because no data is written at
that point. It create a new block that will become dirty at some point
and then be written out, which will trigger the checksum.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services