RE: Conflict detection for update_deleted in logical replication

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: Conflict detection for update_deleted in logical replication
Date: 2025-07-31 10:18:53
Message-ID: OS0PR01MB57160C92142C9D1912E48C169427A@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thursday, July 31, 2025 5:26 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Tue, Jul 29, 2025 at 10:51 AM Zhijie Hou (Fujitsu) <houzj(dot)fnst(at)fujitsu(dot)com>
> wrote:
> >
> >
> > This is the V54 patch set, with only patch 0001 updated to address the
> > latest comments.
> >
>
> Thanks for the patch.
>
> While performing tests on the latest patch, I found an assert in tablesync
> worker in FindDeletedTupleInLocalRel (see
> Assert(TransactionIdIsValid(oldestxmin))). Logs at [1].
>
> It seems table sync worker is trying to apply changes and going to
> update-deleted conflict detection patch but is not able to find
> MyLogicalRepWorker->oldest_nonremovable_xid as this xid is set only
> for apply-worker.

Thanks for reporting. I have fixed it by referring to conflict detection slot's
xmin instead of the leader worker's oldest_nonremovable_xid. This should
be safe because the slot.xmin is always valid.

Best Regards,
Hou zj

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ajin Cherian 2025-07-31 10:52:26 Re: 024_add_drop_pub.pl might fail due to deadlock
Previous Message Zhijie Hou (Fujitsu) 2025-07-31 10:18:51 RE: Conflict detection for update_deleted in logical replication