[pgjdbc/pgjdbc] 170d9c: Bug: Not valid calculate lastReceiveLSN for logica...

From: Vladimir Gordiychuk <folyga(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] 170d9c: Bug: Not valid calculate lastReceiveLSN for logica...
Date: 2017-04-07 10:42:44
Message-ID: 58e76d24a2e5_14413f893cf3fc3c17723c@hookshot-fe5-cp1-prd.iad.github.net.mail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 170d9c27810349456e56aff1c36a0ad6584b9e28
https://github.com/pgjdbc/pgjdbc/commit/170d9c27810349456e56aff1c36a0ad6584b9e28
Author: Vladimir Gordiychuk <folyga(at)gmail(dot)com>
Date: 2017-04-07 (Fri, 07 Apr 2017)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/core/v3/replication/V3PGReplicationStream.java
M pgjdbc/src/main/java/org/postgresql/core/v3/replication/V3ReplicationProtocol.java
A pgjdbc/src/main/java/org/postgresql/replication/ReplicationType.java
M pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationStatusTest.java
M pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java
M pgjdbc/src/test/java/org/postgresql/replication/PhysicalReplicationTest.java

Log Message:
-----------
Bug: Not valid calculate lastReceiveLSN for logical replication (#801)

* Bug: Not valid receiveLSN that lead to lost parallel transactions

Add test that reproduce issue from
https://www.postgresql.org/message-id/CAHHbV7V4XvdHGw_jpR9Xyq3fz%3Df%2BO4oa%2B73sbizGTv_AvmDXhQ%40mail.gmail.com

* bug: lastReceiveLSN not valid for logical replication

Logical and Physical replication use different algorithms
to calculate the lastReceiveLSN.
For physical replication the calculation is:
startLsn from XLogData plus the payloadsize; this is correct as we have the raw data.
For logical replication the lastReceiveLSN uses startLSN from XLogData without the payload size as payload size is not available as a result logical decoding message size
can change and we get LSN from the future random future transaction.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Daniel Migowski 2017-04-08 05:13:30 New driver logging proposal
Previous Message Thomas Kellerer 2017-04-07 06:17:33 Re: Upcoming pgjdbc release: todo list