Re: Block-level CRC checks - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Block-level CRC checks
Date
Msg-id 87ljvrw42y.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Block-level CRC checks  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Block-level CRC checks  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:

> Gregory Stark wrote:
>
>> I think you could checksum the block including the hint bits then go back and
>> remove them from the checksum.
>
> I'm not sure what you're proposing here.  It sounds to me like you are
> saying that we can read the page, make it available to other users, and
> then check the CRC.  I don't think this works though, because if you do
> that the possibly-invalid buffer is available to the other readers.

No, I just meant that you could calculate the CRC by scanning the whole buffer
efficiently using one of the good word-wise CRC algorithms, then look at the
line pointers to find the hint bits and subtract them out of the CRC. The
result should be zero after adjusting for the hint bits.

It doesn't solve much though.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Block-level CRC checks
Next
From: Bruce Momjian
Date:
Subject: Re: gram.y=>preproc.y