pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Assert redirect pointers are sensible after heap_page_prune().
Date: Fri, 14 Jan 2022 02:15:06 +0000
Message-ID: <E1n8C7O-00066k-QV@gemulon.postgresql.org> (raw)

Assert redirect pointers are sensible after heap_page_prune().

Corruption of redirect item pointers often only becomes visible well after
being corrupted, as e.g. bug #17255 shows: In the original reproducer,
gigabyte of WAL were between the source of the corruption and the corruption
becoming visible.

To make it easier to find / prevent such bugs, verify whether redirect
pointers are sensible at the end of heap_page_prune_execute(). 5cd7eb1f1c32
introduced related assertions while modifying the page, but they can't easily
detect marking the target of an existing redirect as unused. Sometimes the
corruption will be detected later, but that's harder to diagnose.

Author: Andres Freund <andres@andres@anarazel.de>
Reviewed-By: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/20211122175914.ayk6gg6nvdwuhrzb@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bb42bfb5ccb5f138a8b7ad3549cfb05c0cc5187b

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



Message-ID: <E1n8C7O-00066k-QV@gemulon.postgresql.org>
Permalink:  ../E1n8C7O-00066k-QV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1n8C7O-00066k-QV@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Assert redirect pointers are sensible after heap_page_prune().
  In-Reply-To: <E1n8C7O-00066k-QV@gemulon.postgresql.org>
  References: <E1n8C7O-00066k-QV@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox