pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't test HEAP_XMAX_INVALID when freezing xmax.
Date: Wed, 23 Nov 2022 18:50:31 +0000
Message-ID: <E1oxupK-000WwJ-Ud@gemulon.postgresql.org> (raw)

Don't test HEAP_XMAX_INVALID when freezing xmax.

We shouldn't ever need to rely on whether HEAP_XMAX_INVALID is set in
t_infomask when considering whether or not an xmax should be deemed
already frozen, since that status flag is just a hint.  The only
acceptable representation for an "xmax_already_frozen" raw xmax field is
the transaction ID value zero (also known as InvalidTransactionId).

Adjust code that superficially appeared to rely on HEAP_XMAX_INVALID to
make the rule about xmax_already_frozen clear.  Also avoid needlessly
rereading the tuple's raw xmax.

Oversight in bugfix commit d2599ecf.  There is no evidence that this
ever led to incorrect behavior, so no backpatch.  The worst consequence
of this bug was that VACUUM could hypothetically fail to notice and
report on certain kinds of corruption, which seems fairly benign.

Author: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/CAH2-Wzkh3DMCDRPfhZxj9xCq9v3WmzvmbiCpf1dNKUBPadhCbQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/02d647bbf0576ebb87f9dc24e1db4dd034f04048

Modified Files
--------------
src/backend/access/heap/heapam.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)



Message-ID: <E1oxupK-000WwJ-Ud@gemulon.postgresql.org>
Permalink:  ../E1oxupK-000WwJ-Ud@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oxupK-000WwJ-Ud@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: pg@bowt.ie
  Subject: Re: pgsql: Don't test HEAP_XMAX_INVALID when freezing xmax.
  In-Reply-To: <E1oxupK-000WwJ-Ud@gemulon.postgresql.org>
  References: <E1oxupK-000WwJ-Ud@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