Skip site navigation (1) Skip section navigation (2)

Re: Block-level CRC checks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block-level CRC checks
Date: 2008-10-01 15:34:54
Message-ID: 23165.1222875294@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-10-01 15:36:44
Subject: Re: Block-level CRC checks
Previous:From: Alvaro HerreraDate: 2008-10-01 15:28:26
Subject: Re: Block-level CRC checks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group