pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wood, Dan <hexpert@amazon.com>
To: Michael Paquier <michael.paquier@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Wong, Yi Wen <yiwong@amazon.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Date: Wed, 11 Oct 2017 02:31:13 +0000
Message-ID: <2BD5E9A0-4166-4CD6-8A66-2293AFE533AE@amazon.com> (raw)
In-Reply-To: <CAB7nPqRCR1DOZoOwAB42MDAgQUqsokAsFdKDdj4ka7BWQusQpg@mail.gmail.com>
References: <835EB743-A57A-49AE-ADA7-A16ACCB737D7@amazon.com>
	<20171010141444.s5tadnstsednska6@alvherre.pgsql>
	<CAB7nPqRCR1DOZoOwAB42MDAgQUqsokAsFdKDdj4ka7BWQusQpg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

I found one glitch with our merge of the original dup row fix.  With that corrected AND Alvaro’s Friday fix things are solid.
No dup’s.  No index corruption.

Thanks so much. 

On 10/10/17, 7:25 PM, "Michael Paquier" <michael.paquier@gmail.com> wrote:

    On Tue, Oct 10, 2017 at 11:14 PM, Alvaro Herrera
    <alvherre@alvh.no-ip.org> wrote:
    > I was seeing just the reindex problem.  I don't see any more dups.
    >
    > But I've tried to reproduce it afresh now, and let it run for a long
    > time and nothing happened.  Maybe I made a mistake last week and
    > ran an unfixed version.  I don't see any more problems now.
    
    Okay, so that's one person more going to this trend, making three with
    Peter and I.
    
    >> If you are getting the dup rows consider the code in the block in
    >> heapam.c that starts with the comment “replace multi by update xid”.
    >>
    >> When I repro this I find that MultiXactIdGetUpdateXid() returns 0.
    >> There is an updater in the multixact array however the status is
    >> MultiXactStatusForNoKeyUpdate and not MultiXactStatusNoKeyUpdate.  I
    >> assume this is a preliminary status before the following row in the
    >> hot chain has it’s multixact set to NoKeyUpdate.
    >
    > Yes, the "For" version is the locker version rather than the actual
    > update.  That lock is acquired by EvalPlanQual locking the row just
    > before doing the update.  I think GetUpdateXid has no reason to return
    > such an Xid, since it's not an update.
    >
    >> Since a 0 is returned this does precede cutoff_xid and
    >> TransactionIdDidCommit(0) will return false.  This ends up aborting
    >> the multixact on the row even though the real xid is committed.  This
    >> sets XMAX to 0 and that row becomes visible as one of the dups.
    >> Interestingly the real xid of the updater is 122944 and the cutoff_xid
    >> is 122945.
    >
    > I haven't seen this effect. Please keep us updated if you're able to
    > verify corruption this way.
    
    Me neither. It would be nice to not live long with such a sword of Damocles.
    -- 
    Michael
    
    


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


view thread (129+ messages)  latest in thread

Message-ID: <2BD5E9A0-4166-4CD6-8A66-2293AFE533AE@amazon.com>
Permalink:  ../2BD5E9A0-4166-4CD6-8A66-2293AFE533AE@amazon.com/
Also on:    postgresql.org/message-id/2BD5E9A0-4166-4CD6-8A66-2293AFE533AE@amazon.com

 · 

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: hexpert@amazon.com, michael.paquier@gmail.com, alvherre@alvh.no-ip.org, pg@bowt.ie, yiwong@amazon.com, pgsql-hackers@postgresql.org, robertmhaas@gmail.com
  Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
  In-Reply-To: <2BD5E9A0-4166-4CD6-8A66-2293AFE533AE@amazon.com>
  References: <835EB743-A57A-49AE-ADA7-A16ACCB737D7@amazon.com> <20171010141444.s5tadnstsednska6@alvherre.pgsql> <CAB7nPqRCR1DOZoOwAB42MDAgQUqsokAsFdKDdj4ka7BWQusQpg@mail.gmail.com> <2BD5E9A0-4166-4CD6-8A66-2293AFE533AE@amazon.com>

* 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