RE: Logical replication: lost updates/deletes and invalid log messages caused by SnapshotDirty + concurrent updates

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Mihail Nikalayeu' <mihailnikalayeu(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "manuelreyesbravo(at)gmail(dot)com" <manuelreyesbravo(at)gmail(dot)com>
Subject: RE: Logical replication: lost updates/deletes and invalid log messages caused by SnapshotDirty + concurrent updates
Date: 2026-10-28 07:10:57
Message-ID: OS7PR01MB18317F04864E6C590B92432B4F56F2@OS7PR01MB18317.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I re-visited this thread, sorry for quite late. I felt comments from senior
members are still needed to understand the initial intention, but let me share
few comments.

01.
```
retry:
found = false;
+ PushActiveSnapshot(GetLatestSnapshot());
```

Can you put a comment why we need to get the GetLatestSnapshot()? Per my
understanding it's for observing tuples which are updated by concurrent transactions.
I initially wondered it may break the transaction isolation level REPEATABLE READ
and the function should return false: but this can lose changes from the publisher.

02.
You told that this patch does not cause the performance isuse because
GetLatestSnapshot() had already been eventually called, but what if the
update_missing happens? Can the performance decrease in the extreme case which
the lots of XXX_missing happens?

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-10-28 07:51:21 Re: Publication of same parent table with ONLY-ness mismatch should error
Previous Message Kirill Reshke 2026-10-28 07:02:05 Re: Fix BRIN numeric_minmax_multi_ops out of range value range merging