BUG #14319: Logical decoding dropping statements in subtransactions

From: leohuanruan(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14319: Logical decoding dropping statements in subtransactions
Date: 2016-09-09 01:26:10
Message-ID: 20160909012610.20024.58169@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14319
Logged by: Huan Ruan
Email address: leohuanruan(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Shay Rojansky 2016-09-09 06:51:40 Re: Array dimension lost if dimension length is zero
Previous Message soufiane.boussali 2016-09-08 21:29:03 BUG #14318: remote blind SQL injection vulnerability