pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: marko@joh.to
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14279: Logical decoding misses a transaction completely
Date: Thu, 04 Aug 2016 20:40:18 +0100
Message-ID: <8760rgfhrr.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <20160804191757.1430.39011@wrigleys.postgresql.org>
References: <20160804191757.1430.39011@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

>>>>> "marko" == marko  <marko@joh.to> writes:

 marko> The problem seems to be that ReorderBufferCommitChild()
 marko> overwrites the main transaction's base_snapshot with a NULL
 marko> because it thinks the subtransaction's base_snapshot_lsn=0 is
 marko> older than the main transaction's actual snapshot

i.e. here in ReorderBufferCommitChild:

    /*
     * Pass the our base snapshot to the parent transaction if it doesn't have
     * one, or ours is older. That can happen if there are no changes in the
     * toplevel transaction but in one of the child transactions. This allows
     * the parent to simply use it's base snapshot initially.
     */
    if (txn->base_snapshot == NULL ||
        txn->base_snapshot_lsn > subtxn->base_snapshot_lsn)
    {

it's possible for subtxn to exist, but for subtxn->base_snapshot to be
NULL and base_snapshot_lsn to be 0, and obviously propagating this to
txn is wrong.

-- 
Andrew (irc:RhodiumToad)


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



view thread (7+ messages)  latest in thread

Message-ID: <8760rgfhrr.fsf@news-spur.riddles.org.uk>
Permalink:  ../8760rgfhrr.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/8760rgfhrr.fsf@news-spur.riddles.org.uk

 · 

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-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, marko@joh.to
  Subject: Re: BUG #14279: Logical decoding misses a transaction completely
  In-Reply-To: <8760rgfhrr.fsf@news-spur.riddles.org.uk>
  References: <20160804191757.1430.39011@wrigleys.postgresql.org> <8760rgfhrr.fsf@news-spur.riddles.org.uk>

* 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