[HACKERS] Logical replication origin tracking fix - Mailing list pgsql-hackers

From Petr Jelinek
Subject [HACKERS] Logical replication origin tracking fix
Date
Msg-id b235fa69-147a-5e09-f8f3-3f780a1abb2e@2ndquadrant.com
Whole thread Raw
Responses Re: Logical replication origin tracking fix  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
List pgsql-hackers
Hi,

while discussing with Craig issues around restarting logical replication
stream related to the patch he posted [1], I realized that we track
wrong origin LSN in the logical replication apply.

We currently track commit_lsn which is *start* of commit record, what we
need to track is end_lsn which is *end* of commit record otherwise we
might request transaction that was already replayed if the subscription
instance has crashed right after commit.

Attached patch fixes that.

[1]
https://www.postgresql.org/message-id/CAMsr+YGFvikx-U_mHQ0mAzTarqvCpwzvsPKv=7MfP9scDrMPjg@mail.gmail.com

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services

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

Attachment

pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Logical replication existing data copy
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] allow referring to functions without arguments whenunique