Re: visibility maps - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: visibility maps
Date
Msg-id 493AB0BB.3080401@enterprisedb.com
Whole thread Raw
In response to Re: visibility maps  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
List pgsql-hackers
Pavan Deolasee wrote:
> On Sat, Dec 6, 2008 at 7:57 PM, Heikki Linnakangas <
> heikki.linnakangas@enterprisedb.com> wrote:
> 
>> Umm, what non-atomic state could the bit be in? Half-set, half-cleared? Or
>> do you think that if some other bit in proximity is changed, the other bit
>> would temporarily flip 0->1->0, or something like that? I don't think that
>> should happen.
>>
> Since the lock is not held, the bit can be flipped while we are reading,
> isn't it ? IOW, the test is not reliable is what I fear.

If someone is changing the bit at the same time, it doesn't matter 
whether we read it as 1 or 0. Locking the page wouldn't change the 
situation: you would still read the old value if you got the lock before 
the concurrent updater, or the new value if you got the lock after.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: "Pavan Deolasee"
Date:
Subject: Re: visibility maps
Next
From: Heikki Linnakangas
Date:
Subject: Re: visibility maps