pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: amcheck: Generalize one of the recently-added update chain check
Date: Mon, 27 Mar 2023 17:41:32 +0000
Message-ID: <E1pgqqZ-00010g-E3@gemulon.postgresql.org> (raw)

amcheck: Generalize one of the recently-added update chain checks.

Commit bbc1376b39627c6bddd8a0dc0a7dda24c91a97a0 checked that if
a redirected line pointer pointed to a tuple, the tuple should be
marked both HEAP_ONLY_TUPLE and HEAP_UPDATED. But Andres Freund
pointed out that *any* tuple that is marked HEAP_ONLY_TUPLE should
be marked HEAP_UPDATED, not just one that is the target of a
redirected line pointer. Do that instead.

To see why this is better, consider a redirect line pointer A
which points to a heap-only tuple B which points (via CTID)
to another heap-only tuple C. With the old code, we'd complain
if B was not marked HEAP_UPDATED, but with this change, we'll
complain if either B or C is not marked HEAP_UPDATED.

(Note that, with or without this commit, if either B or C were
not marked HEAP_ONLY_TUPLE, we would also complain about that.)

Discussion: http://postgr.es/m/CA%2BTgmobLypZx%3DcOH%2ByY1GZmCruaoucHm77A6y_-Bo%3Dh-_3H28g%40mail.gmail.com

Branch
------
master

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

Modified Files
--------------
contrib/amcheck/verify_heapam.c           | 20 +++++++++-----------
src/bin/pg_amcheck/t/004_verify_heapam.pl | 11 +++++------
2 files changed, 14 insertions(+), 17 deletions(-)



Message-ID: <E1pgqqZ-00010g-E3@gemulon.postgresql.org>
Permalink:  ../E1pgqqZ-00010g-E3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pgqqZ-00010g-E3@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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: amcheck: Generalize one of the recently-added update chain check
  In-Reply-To: <E1pgqqZ-00010g-E3@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