Re: Conflict detection for update_deleted in logical replication

From: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Conflict detection for update_deleted in logical replication
Date: 2024-10-25 10:20:48
Message-ID: CANtu0ohzMB38tcf2=q1HVCdz+eEpBBauHhMoATz_=YFEjDd7FQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, Hayato!

> Thanks for updating the patch! While reviewing yours, I found a corner
case that
> a recently deleted tuple cannot be detected when index scan is chosen.
> This can happen when indices are re-built during the replication.
> Unfortunately, I don't have any solutions for it.

I just randomly saw your message, so, I could be wrong and out of the
context - so, sorry in advance.

But as far as I know, to solve this problem, we need to wait for slot.xmin
during the [0] (WaitForOlderSnapshots) while creating index concurrently.

[1]:
https://github.com/postgres/postgres/blob/68dfecbef210dc000271553cfcb2342989d4ca0f/src/backend/commands/indexcmds.c#L1758-L1765

Best regards,
Mikhail.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-10-25 10:24:05 Re: Pgoutput not capturing the generated columns
Previous Message Alexander Korotkov 2024-10-25 10:13:29 Re: type cache cleanup improvements