Re: heapam_index_build_range_scan's anyvisible - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: heapam_index_build_range_scan's anyvisible
Date
Msg-id 20190607212603.GA26702@alvherre.pgsql
Whole thread Raw
In response to Re: heapam_index_build_range_scan's anyvisible  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 2019-Jun-07, Robert Haas wrote:

> Yeah, I wondered whether SnapshotNonVacuumable might've been added
> later, but I was too lazy to check the commit log.  I'll try coding up
> that approach and see how it looks.

Thanks.

> But do you have any comment on the question of whether this function
> is actually safe with < ShareLock, per the comments about caching
> HOT-related state across buffer lock releases?

Well, as far as I understand we do hold a buffer pin on the page the
whole time until we abandon it, which prevents HOT pruning, so the root
offset cache should be safe (since heap_page_prune requires cleanup
lock).  The thing we don't keep held is a buffer lock, so I/U/D could
occur, but those are not supposed to be hazards for the BRIN use, since
that's covered by the anyvisible / SnapshotNonVacuumable
hack^Wtechnique.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: heapam_index_build_range_scan's anyvisible
Next
From: Daniel Gustafsson
Date:
Subject: Re: tableam: abstracting relation sizing code