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

From Tom Lane
Subject Re: Block-level CRC checks
Date
Msg-id 21582.1227029846@sss.pgh.pa.us
Whole thread Raw
In response to Re: Block-level CRC checks  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Alvaro Herrera wrote:
>> Right now we flip hint bits without taking any kind
>> of lock on the page.

> That's not quite true. You need to hold a shared lock on heap page to 
> examine the visibility of a tuple, and that's when the hint bits are 
> set. So we always hold at least a shared lock on the page while hint 
> bits are set.

Right, but we couldn't let hint-bit-setters update the page LSN with
only shared lock.  Too much chance of ending up with a scrambled LSN
value.

Could we arrange for the actual LSN-updating to be done while still
holding WALInsertLock?  Then we'd be depending on that lock, not the
page-level locks, to serialize.  It's not great to be pushing more work
inside that global lock, but it's not very much more work ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Aidan Van Dyk
Date:
Subject: Re: Block-level CRC checks
Next
From: Josh Berkus
Date:
Subject: Re: Simple postgresql.conf wizard