agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Assert correct VM page passed to pruning
Date: Tue, 22 Sep 2026 21:29:15 +0000
Message-ID: <E1x9839-00000000p8F-3LJ4@gemulon.postgresql.org> (raw)

Assert correct VM page passed to pruning

Before pruning a heap page, we get the current status of the
corresponding VM page. If the passed in vmbuffer isn't the right one,
visibilitymap_get_status() will silently unpin it and pin the correct
page. Pruning assumes the caller manages the vmbuffer lifecycle, so this
would leave the caller with a stale VM reference and would leak the new
VM pin. To avoid mistakes in development, assert that the correct VM
page is pinned before beginning.

Reported-by: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CAAKRu_amj7qLF4c=9ijd=708Fu2G8gg-2EqwBu=aCdAHU2sPHg@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/40cc0662ed7c0bf07e8c6534b1291ec5bcb5fee0

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)



view thread (2+ messages)

Message-ID: <E1x9839-00000000p8F-3LJ4@gemulon.postgresql.org>
Permalink:  ../E1x9839-00000000p8F-3LJ4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x9839-00000000p8F-3LJ4@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Assert correct VM page passed to pruning
  In-Reply-To: <E1x9839-00000000p8F-3LJ4@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox