pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Wood, Dan <hexpert@amazon.com>
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] pgsql: Fix freezing of a dead HOT-updated tuple
Date: Sat, 04 Nov 2017 02:03:45 +0530
Message-ID: <698409B0-5E70-4F88-A07B-7460C674874B@anarazel.de> (raw)
In-Reply-To: <20171103195204.omoi4olywmv3nyqk@alvherre.pgsql>
References: <20171103195204.omoi4olywmv3nyqk@alvherre.pgsql>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>



On November 4, 2017 1:22:04 AM GMT+05:30, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>Peter Geoghegan wrote:
>> Andres Freund <andres@anarazel.de> wrote:
>
>> > Staring at the vacuumlazy hunk I think I might have found a related
>bug:
>> > heap_update_tuple() just copies the old xmax to the new tuple's
>xmax if
>> > a multixact and still running.  It does so without verifying
>liveliness
>> > of members.  Isn't that buggy? Consider what happens if we have
>three
>> > blocks: 1 has free space, two is being vacuumed and is locked,
>three is
>> > full and has a tuple that's key share locked by a live tuple and is
>> > updated by a dead xmax from before the xmin horizon. In that case
>afaict
>> > the multi will be copied from the third page to the first one. 
>Which is
>> > quite bad, because vacuum already processed it, and we'll set
>> > relfrozenxid accordingly.  I hope I'm missing something here?
>> 
>> Can you be more specific about what you mean here? I think that I
>> understand where you're going with this, but I'm not sure.
>
>He means that the tuple that heap_update moves to page 1 (which will no
>longer be processed by vacuum) will contain a multixact that's older
>than relminmxid -- because it is copied unchanged by heap_update
>instead
>of properly checking against age limit.

Right. That, or a member xid below relminxid. I think both scenarios are possible.

Andres
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (129+ messages)  latest in thread

Message-ID: <698409B0-5E70-4F88-A07B-7460C674874B@anarazel.de>
Permalink:  ../698409B0-5E70-4F88-A07B-7460C674874B@anarazel.de/
Also on:    postgresql.org/message-id/698409B0-5E70-4F88-A07B-7460C674874B@anarazel.de

 · 

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, alvherre@alvh.no-ip.org, pg@bowt.ie, hexpert@amazon.com, yiwong@amazon.com, michael.paquier@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] pgsql: Fix freezing of a dead HOT-updated tuple
  In-Reply-To: <698409B0-5E70-4F88-A07B-7460C674874B@anarazel.de>
  References: <20171103195204.omoi4olywmv3nyqk@alvherre.pgsql> <698409B0-5E70-4F88-A07B-7460C674874B@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