Re: Buffer access rules, and a probable bug - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Buffer access rules, and a probable bug
Date
Msg-id 8841.994797519@sss.pgh.pa.us
Whole thread Raw
In response to Re: Buffer access rules, and a probable bug  (Bill Studenmund <wrstuden@zembu.com>)
List pgsql-hackers
Bill Studenmund <wrstuden@zembu.com> writes:
> One problem though is that if you don't have a spin lock around the flag,
> you can end up clearing it inadvertenty. i.e. two backends go to update
> (different) bit flags. They each load the current value, and each set the
> (different) bit they want to set. They then store the new value they each
> have come up with. The second store will effectively clear the bit set in
> the first store.

Yes, this is the scenario we're talking about.  The point is that losing
the bit is harmless, in this particular situation, because it will be
set again the next time the tuple is visited.  It's only a hint.  That
being the case, we judge that avoiding the necessity for an exclusive
lock during read is well worth a (very infrequent) need to do an extra
pg_log lookup due to loss of a hint bit.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: grant and SQL92
Next
From: Michel Soto
Date:
Subject: Strange query execution time