Re: BUG #14319: Logical decoding dropping statements in subtransactions - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #14319: Logical decoding dropping statements in subtransactions
Date
Msg-id CAB7nPqSvrUR5j1bhnBbYspvCEj3T_o4JCjoh62LDM9innUqcvA@mail.gmail.com
Whole thread Raw
In response to BUG #14319: Logical decoding dropping statements in subtransactions  (leohuanruan@gmail.com)
Responses Re: BUG #14319: Logical decoding dropping statements in subtransactions  (Huan Ruan <leohuanruan@gmail.com>)
List pgsql-bugs
On Fri, Sep 9, 2016 at 10:26 AM,  <leohuanruan@gmail.com> wrote:
> 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.

And the first commit to cause this regression is this one:
commit: 8caf9fe62544b351d4f6219bf416f5ce08ef3c21
author: Tom Lane <tgl@sss.pgh.pa.us>
date: Thu, 30 Jun 2016 12:37:02 -0400
Fix typo in ReorderBufferIterTXNInit().

This looks like it would cause changes from subtransactions to be missed
by the iterator being constructed, if those changes had been spilled to
disk previously.  This implies that large subtransactions might be lost
(in whole or in part) by logical replication.  Found and fixed by
Petru-Florin Mihancea, per bug #14208.

Report: <20160622144830.5791.22512@wrigleys.postgresql.org>

4096 matches the maximum number of changes that can be saved in memory
from reorderbuffer.c. Andres?
--
Michael

pgsql-bugs by date:

Previous
From: lilacyd@gmail.com
Date:
Subject: BUG #14323: char input does not work
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #14320: systemd terminates postgresql hot standby instance 90 seconds after start