| From: | Melanie Plageman <melanieplageman(at)gmail(dot)com> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Assert correct VM page passed to pruning |
| Date: | 2026-09-22 21:28:14 |
| Message-ID: | E1x982A-00000000p6m-41lW@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)gmail(dot)com>
Reviewed-by: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Discussion: https://postgr.es/m/CAAKRu_amj7qLF4c=9ijd=708Fu2G8gg-2EqwBu=aCdAHU2sPHg@mail.gmail.com
Backpatch-through: 19
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d8516db39dfa73042e3ba28f9efc78da4dd6792d
Modified Files
--------------
src/backend/access/heap/pruneheap.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melanie Plageman | 2026-09-22 21:29:15 | pgsql: Assert correct VM page passed to pruning |
| Previous Message | noreply | 2026-09-22 20:40:27 | pgsql: Tag refs/tags/REL_19_BETA4 was created |