Re: Block-level CRC checks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block-level CRC checks
Date: 2008-11-18 17:37:26
Message-ID: 21582.1227029846@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2008-11-18 17:39:23 Re: Simple postgresql.conf wizard
Previous Message Aidan Van Dyk 2008-11-18 17:34:06 Re: Block-level CRC checks