pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wood, Dan <hexpert@amazon.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Wong, Yi Wen <yiwong@amazon.com>
Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Date: Wed, 4 Oct 2017 18:00:41 +0000
Message-ID: <CB2B4460-3564-48D9-B014-7BDA6A5B3DB7@amazon.com> (raw)
In-Reply-To: <20171004095159.wi277fwlmky6ymmz@alvherre.pgsql>
References: <10CE2AE7-B1AC-4E81-BF00-E9EF4BA855EE@amazon.com>
	<20171004095159.wi277fwlmky6ymmz@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Sorry.  Should have looked at the macro.  I sent this too soon.  The early “break;” here is likely the xmin frozen reason as I found in the other loop. 

On 10/4/17, 2:52 AM, "Alvaro Herrera" <alvherre@alvh.no-ip.org> wrote:

    Wood, Dan wrote:
    
    > There is a tangled web of issues here.  With the community fix we get a corrupted page(invalid redirect ptr from indexed item).  The cause of that is:
    > pruneheap.c:
    > 
    >                   /*
    >                    * Check the tuple XMIN against prior XMAX, if any
    >                    */
    >                   if (TransactionIdIsValid(priorXmax) &&
    >                           !TransactionIdEquals(HeapTupleHeaderGetXmin(htup), priorXmax))
    >                           break;
    > 
    > 	chainitems[nchain++] = offnum;
    > 
    > The priorXmax is a multixact key share lock,
    
    Uhh, what?  That certainly shouldn't happen -- the priorXmax comes from
    
    			priorXmax = HeapTupleHeaderGetUpdateXid(htup);
    
    so only the XID of the update itself should be reported, not a multixact
    and certainly not just a tuple lock XID.
    
    -- 
    Álvaro Herrera                https://www.2ndQuadrant.com/
    PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
    


On Tue, Oct 3, 2017 at 6:09 PM, Wood, Dan <hexpert@amazon.com> wrote:
> I’ve just started looking at this again after a few weeks break.

>                 if (TransactionIdIsValid(priorXmax) &&
>                         !TransactionIdEquals(priorXmax, HeapTupleHeaderGetXmin(htup)))
>                         break;

> We need to understand why these TXID equal checks exist.  Can we differentiate the cases they are protecting against with the two exceptions I’ve found?

I haven't read your remarks here in full, since I'm about to stop
working for the day, but I will point out that
src/backend/access/heap/README.HOT says a fair amount about this,
under "Abort Cases".


-- 
Peter Geoghegan

-- 
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: <CB2B4460-3564-48D9-B014-7BDA6A5B3DB7@amazon.com>
Permalink:  ../CB2B4460-3564-48D9-B014-7BDA6A5B3DB7@amazon.com/
Also on:    postgresql.org/message-id/CB2B4460-3564-48D9-B014-7BDA6A5B3DB7@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, alvherre@alvh.no-ip.org, michael.paquier@gmail.com, pg@bowt.ie, pgsql-hackers@postgresql.org, yiwong@amazon.com
  Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
  In-Reply-To: <CB2B4460-3564-48D9-B014-7BDA6A5B3DB7@amazon.com>
  References: <10CE2AE7-B1AC-4E81-BF00-E9EF4BA855EE@amazon.com> <20171004095159.wi277fwlmky6ymmz@alvherre.pgsql> <CB2B4460-3564-48D9-B014-7BDA6A5B3DB7@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