Insights into duplicate records seen in snapshot & logical replication slot.

From: Chandy G <vgchandru(at)yahoo(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Insights into duplicate records seen in snapshot & logical replication slot.
Date: 2025-07-10 07:18:39
Message-ID: 1946402070.121016.1752131919475@mail.yahoo.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,  I am using postgres version 15.5 along with debezium to do CDC using logical replication slot after the initial snapshot of the db is complete.  Recently, observed a few cases where a record in a table showed up both via snapshot as well as from the replication slot. (this was a insert dml).

The understanding is that any dmls in a transaction has to either fall into the snapshot phase (as its a consistent snapshot done using the id returned during the replication slot along with repeatable read) or into the streaming phase , as read from the replication slot.
This issue is also not reproducible consistently, looks like a race condition. Am i stumbling upon a bug?

TIA

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-07-10 07:33:53 Re: Adding support for SSLKEYLOGFILE in the frontend
Previous Message sunil s 2025-07-10 06:35:07 Re: Unnecessary delay in streaming replication due to replay lag