Re: heapam_index_build_range_scan's anyvisible

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: heapam_index_build_range_scan's anyvisible
Date: 2019-06-07 21:26:03
Message-ID: 20190607212603.GA26702@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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.


> 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

Álvaro Herrera
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thierry Husson 2019-06-07 21:40:27 Re: BUG #15840: Vacuum does not work after database stopped for wraparound protection. Database seems unrepearable.
Previous Message Robert Haas 2019-06-07 21:11:33 Re: heapam_index_build_range_scan's anyvisible