pgsql: Add VM corruption check to verify_heapam()

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add VM corruption check to verify_heapam()
Date: 2026-09-23 22:23:02
Message-ID: E1x9VMk-00000000yh4-1sdY@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add VM corruption check to verify_heapam()

Detect heap pages whose PD_ALL_VISIBLE flag is clear while either
visibility map bit is set. This inconsistent state can cause incorrect
index-only scan results and is not currently reported by verify_heapam().

This also helps users who have access to amcheck but not pg_visibility
to diagnose corruption.

Author: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/66mqpfyti3qhfttcsv6r2lbvqqd32rrmpn6i47ovrsnvguts46@gou54xc5jld3

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5d84c76021cb5a7591be848cd0004b8fd9453d1c

Modified Files
--------------
contrib/amcheck/verify_heapam.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-09-23 23:51:11 pgsql: Allocate pgstats entry body before insert into shared hashtable
Previous Message Masahiko Sawada 2026-09-23 21:58:24 pgsql: doc: Clarify phase descriptions of pg_stat_progress_repack.