Re: Block-level CRC checks

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block-level CRC checks
Date: 2008-11-10 21:53:46
Message-ID: 87prl3w8lx.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> Greg Stark wrote:
>>> I'm beginning to think just excluding the hint bits would be simpler and
>>> safer. If we're double buffering then it might be possible to do that
>>> pretty cheaply. Copy the whole buffer with memcpy then loop through the
>>> line pointers unsetting the hint bits. Then do the crc. Though that would
>>> prevent us from doing "zero-copy" crc by doing it in the copy.
>
>> The downside to this idea is that we need to create a copy of the page
>> and call those routines when we read the page in, too.

oh, good point.

> Ugh. The cost on write was bad enough, but paying it on read is a lot
> worse ...

I think you could checksum the block including the hint bits then go back and
remove them from the checksum. I didn't realize you were handling more than
just the heap transaction hint bits though. It would be hard to do it in any
kind of abstract away like you were describing.

How happy are you with the wal logging entries? Have you done any tests to see
how much extra wal traffic it is? Are you sure you always generate enough logs
soon enough?

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-11-10 22:08:02 Re: Reducing some DDL Locks to ShareLock
Previous Message Tom Lane 2008-11-10 21:41:09 Re: Re: Updated interval patches (SQL std output, ISO8601 intervals, and interval rounding)