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: Use TransactionXmin instead of RecentGlobalXmin in heap_abort_sp
Date: Mon, 06 Apr 2020 01:07:14 +0000
Message-ID: <E1jLGEM-0002GK-03@gemulon.postgresql.org> (raw)

Use TransactionXmin instead of RecentGlobalXmin in heap_abort_speculative().

There's a very low risk that RecentGlobalXmin could be far enough in
the past to be older than relfrozenxid, or even wrapped
around. Luckily the consequences of that having happened wouldn't be
too bad - the page wouldn't be pruned for a while.

Avoid that risk by using TransactionXmin instead. As that's announced
via MyPgXact->xmin, it is protected against wrapping around (see code
comments for details around relfrozenxid).

Author: Andres Freund
Discussion: https://postgr.es/m/20200328213023.s4eyijhdosuc4vcj@alap3.anarazel.de
Backpatch: 9.5-

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0e708d3115958ffcd8e91123f405dc482871abf6

Modified Files
--------------
src/backend/access/heap/heapam.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1jLGEM-0002GK-03@gemulon.postgresql.org>
Permalink:  ../E1jLGEM-0002GK-03@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jLGEM-0002GK-03@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: Use TransactionXmin instead of RecentGlobalXmin in heap_abort_sp
  In-Reply-To: <E1jLGEM-0002GK-03@gemulon.postgresql.org>
  References: <E1jLGEM-0002GK-03@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