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

From Tom Lane
Subject Re: Block-level CRC checks
Date
Msg-id 23165.1222875294@sss.pgh.pa.us
Whole thread Raw
In response to Re: Block-level CRC checks  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> Unfortunately, it doesn't.  See hint bits.

> Hmm, so it seems we need to keep held of the bufferhead's spinlock while
> calculating the checksum, just after resetting BM_JUST_DIRTIED.  Yuck.

No, holding a spinlock that long is entirely unacceptable, and it's the
wrong thing anyway, because we don't hold the header lock while
manipulating hint bits.

What this would *actually* mean is that we'd need to hold exclusive not
shared buffer lock on a buffer we are about to write, and that would
have to be maintained while computing the checksum and until the write
is completed.  The JUST_DIRTIED business could go away, in fact.

(Thinks for a bit...)  I wonder if that could induce any deadlock
problems?  The concurrency hit might be the least of our worries.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Block-level CRC checks
Next
From: Tom Lane
Date:
Subject: Re: Block-level CRC checks