pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hillel.Eilat@attunity.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13451: Logical decoding / replication - WAL rows are streamed more than once
Date: Wed, 17 Jun 2015 14:09:10 +0000
Message-ID: <20150617140910.2730.41532@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:      13451
Logged by:          Hillel Eilat
Email address:      Hillel.Eilat@attunity.com
PostgreSQL version: 9.4.2
Operating system:   Windows 7
Description:        

Attunity R & D							17-Jun-2015

PostgreSQL Logical decoding / replication - WAL rows are streamed more than
once?

My software uses "Logical Decoding" capabilities for harvesting changes made
at PostgreSQL database and forwarding them to an application processing
unit.
The application can provide a START_LSN - which is typically the last
processed / committed LSN recorded on a previous run.
In case where no START_LSN is given - the internal value sampled by
IDENTIFY_SYSTEM call is taken.

I face problems in "resume" scenarios that start at a middle of a
transaction.

These scenarios consist of 2 consecutive runs:
A.	First - start at BEGIN LSN, stream the WAL to an INSERT LSN of choice and
stop.
B.	Next - resume at the last streamed LSN obtained from A, and stream the
WAL to the ending COMMIT LSN.

Problems:
1.	Providing a START_LSN that points to a WAL row which is in a middle of a
transaction, actually conducts WAL streaming that starts at the LSN pointing
to the BEGIN row of that transaction. Is it a bug? Is it meant to be so?

2.	 Starting at a middle of a large transaction (say - 500000 rows), rows
having LSN-s which are prior to the specified START_LSN, occasionally show
up also. These unsolicited rows were already read on a previous run. Thus -
target consistency is violated. This smells to me like a bug.
   
3.	For smaller transactions (~1000 rows TXN which was simulated), this
misbehavior is not observed.  Under smaller volumes - "resume" scenarios
seem to work fine.

4.	Does this mean that the only "resume-able" LSN-s are those of BEGIN
events?
   
This report was obtained when working with a 9.4.2 version on Windows
platform:

select version();
"PostgreSQL 9.4.2, compiled by Visual C++ build 1800, 64-bit"

Did I miss something?

Kindest regards.

Hillel Eilat
Attunity R & D



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



Message-ID: <20150617140910.2730.41532@wrigleys.postgresql.org>
Permalink:  ../20150617140910.2730.41532@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150617140910.2730.41532@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: Hillel.Eilat@attunity.com
  Subject: Re: BUG #13451: Logical decoding / replication - WAL rows are streamed more than once
  In-Reply-To: <20150617140910.2730.41532@wrigleys.postgresql.org>
  References: <20150617140910.2730.41532@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