pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: marko@joh.to
To: pgsql-bugs@postgresql.org
Subject: BUG #14279: Logical decoding misses a transaction completely
Date: Thu, 04 Aug 2016 19:17:57 +0000
Message-ID: <20160804191757.1430.39011@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14279
Logged by:          Marko Tiikkaja
Email address:      marko@joh.to
PostgreSQL version: 9.5.3
Operating system:   Linux
Description:        

Hi,

The following transaction does not get decoded at all in logical decoding:

BEGIN;
INSERT INTO foo VALUES ('bar');
SAVEPOINT s;
SELECT 1 FROM foo FOR UPDATE;
RELEASE SAVEPOINT s;
COMMIT;

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

    /*
     * If this transaction didn't have any real changes in our database,
it's
     * OK not to have a snapshot. Note that ReorderBufferCommitChild will
have
     * transferred its snapshot to this transaction if it had one and the
     * toplevel tx didn't.
     */
    if (txn->base_snapshot == NULL)
    {
        Assert(txn->ninvalidations == 0);
        ReorderBufferCleanupTXN(rb, txn);
        return;
   }

causes the entire transaction to be skipped.  I didn't debug further.

(Thanks to Andres Freund and Andrew Gierth for helping me track this problem
down!)


-- 
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: <20160804191757.1430.39011@wrigleys.postgresql.org>
Permalink:  ../20160804191757.1430.39011@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20160804191757.1430.39011@wrigleys.postgresql.org

 · 

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: marko@joh.to
  Subject: Re: BUG #14279: Logical decoding misses a transaction completely
  In-Reply-To: <20160804191757.1430.39011@wrigleys.postgresql.org>
  References: <20160804191757.1430.39011@wrigleys.postgresql.org>

* 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