pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: leohuanruan@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14319: Logical decoding dropping statements in subtransactions
Date: Fri, 09 Sep 2016 01:26:10 +0000
Message-ID: <20160909012610.20024.58169@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:      14319
Logged by:          Huan Ruan
Email address:      leohuanruan@gmail.com
PostgreSQL version: 9.5.4
Operating system:   CentOS 7.2.1511 x86_64
Description:        

When inserting records within a subtransaction, not all inserts are reported
by pg_logical_slot_peek_changes(). With more than 4096 inserts, the output
is truncated to the nearest multiple of 4096.

This occurs in 9.5.4, but not in 9.5.3.

To reproduce:


/usr/pgsql-9.5/bin/initdb
echo 'wal_level=logical' >> $PGDATA/postgresql.conf
echo 'max_replication_slots=1' >> $PGDATA/postgresql.conf
/usr/pgsql-9.5/bin/pg_ctl start -w

createdb test1
psql test1 <<EOF
SELECT pg_create_logical_replication_slot('regression_slot',
'test_decoding');
CREATE TABLE t (x BIGINT);

BEGIN;
SAVEPOINT s;
INSERT INTO t SELECT generate_series(1, 5000);
RELEASE SAVEPOINT s;
COMMIT;

/* Reports 4096 inserts, rather than the expected 5000 */
SELECT COUNT(*) FROM pg_logical_slot_peek_changes('regression_slot', NULL,
NULL) WHERE data ~ 'INSERT';
EOF


-- 
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 (12+ messages)  latest in thread

Message-ID: <20160909012610.20024.58169@wrigleys.postgresql.org>
Permalink:  ../20160909012610.20024.58169@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20160909012610.20024.58169@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: leohuanruan@gmail.com
  Subject: Re: BUG #14319: Logical decoding dropping statements in subtransactions
  In-Reply-To: <20160909012610.20024.58169@wrigleys.postgresql.org>
  References: <20160909012610.20024.58169@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