From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Wood, Dan <hexpert@amazon.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-committers@postgresql.org, "Wong, Yi Wen" <yiwong@amazon.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Date: Thu, 14 Dec 2017 17:00:29 -0800
Message-ID: <20171215010029.3dxx56vjlymudvwo@alap3.anarazel.de> (raw)
In-Reply-To: <20171114030341.movhteyakqeqx5pm@alap3.anarazel.de>
References: <20171102112019.33wb7g5wp4zpjelu@alap3.anarazel.de>
<20171102124947.hshl7znx6ixy62pf@alvherre.pgsql>
<20171102130551.i2w33sqdw3bdvetn@alap3.anarazel.de>
<20171103145330.5ycjoje5s6lfwxps@alap3.anarazel.de>
<20171114030341.movhteyakqeqx5pm@alap3.anarazel.de>
Hi,
On 2017-11-13 19:03:41 -0800, Andres Freund wrote:
> diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
> index f93c194e182..7d163c91379 100644
> --- a/src/backend/access/heap/rewriteheap.c
> +++ b/src/backend/access/heap/rewriteheap.c
> @@ -407,7 +407,10 @@ rewrite_heap_tuple(RewriteState state,
> * While we have our hands on the tuple, we may as well freeze any
> * eligible xmin or xmax, so that future VACUUM effort can be saved.
> */
> - heap_freeze_tuple(new_tuple->t_data, state->rs_freeze_xid,
> + heap_freeze_tuple(new_tuple->t_data,
> + state->rs_old_rel->rd_rel->relfrozenxid,
> + state->rs_old_rel->rd_rel->relminmxid,
> + state->rs_freeze_xid,
> state->rs_cutoff_multi);
Hm. So this requires backpatching the introduction of
RewriteStateData->rs_old_rel into 9.3, which in turn requires a new
argument to begin_heap_rewrite(). It originally was added in the
logical decoding commit (i.e. 9.4).
I'm fine with that, but it could theoretically cause issues for somebody
with an extension that calls begin_heap_rewrite() - which seems unlikely
and I couldn't find any that does so.
Does anybody have a problem with that?
Regards,
Andres
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, alvherre@alvh.no-ip.org, hexpert@amazon.com, pg@bowt.ie, yiwong@amazon.com, michael.paquier@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
In-Reply-To: <20171215010029.3dxx56vjlymudvwo@alap3.anarazel.de>
References: <20171102112019.33wb7g5wp4zpjelu@alap3.anarazel.de> <20171102124947.hshl7znx6ixy62pf@alvherre.pgsql> <20171102130551.i2w33sqdw3bdvetn@alap3.anarazel.de> <20171103145330.5ycjoje5s6lfwxps@alap3.anarazel.de> <20171114030341.movhteyakqeqx5pm@alap3.anarazel.de> <20171215010029.3dxx56vjlymudvwo@alap3.anarazel.de>
* 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