Re: Buffer access rules, and a probable bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bill Studenmund <wrstuden(at)zembu(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Buffer access rules, and a probable bug
Date: 2001-07-10 20:38:39
Message-ID: 8841.994797519@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bill Studenmund <wrstuden(at)zembu(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-07-10 21:06:28 Re: SOMAXCONN (was Re: Solaris source code)
Previous Message Vince Vielhaber 2001-07-10 20:34:16 Re: grant and SQL92