Re: "page is not marked all-visible" warning in regression tests - Mailing list pgsql-hackers

From Robert Haas
Subject Re: "page is not marked all-visible" warning in regression tests
Date
Msg-id CA+TgmoZMGT-+ciRRVkko3iUR0u5F=9waYm97d813z7ZrRmXCmg@mail.gmail.com
Whole thread Raw
In response to Re: "page is not marked all-visible" warning in regression tests  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: "page is not marked all-visible" warning in regression tests  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On Wed, Jun 6, 2012 at 3:07 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> Hm. For a short while I thought there would be an issue with heap_delete and
> IOS because the deleting transaction can commit without any barriers happening
> on the IOS side. But that only seems to be possible with non MVCC snapshots
> which are currently not allowed with index only scans.

Well, one, commits are irrelevant; the page ceases to be all-visible
as soon as the delete happens.  And two, you can't do a delete or a
commit without a memory barrier - every LWLockAcquire() or
LWLockRelease() is a full barrier, so any operation that requires a
buffer content lock is both preceded and followed by a full barrier.

Proposed patch attached.  This adds some more comments in various
places, and implements your suggestion of retesting the visibility-map
bit when we detect a possible mismatch with the page-level bit.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Early hint bit setting
Next
From: Andres Freund
Date:
Subject: Re: "page is not marked all-visible" warning in regression tests